Code Monkey home page Code Monkey logo

rtk's People

Contributors

prozak avatar unmyth avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

rtk's Issues

Imports in metagrammar

Implement the way to add user-specified 'import' clauses to the generated haskell code.

make test-grammar improvement

make test-grammar should regenerate files only if needed. Currently it doing so always. This improvement is needed for debugging of generated Lexer and Parser files.

Lexer error output

More informative output when there is a lexer error. Now there is the following one:

rtk: lexical error

Start rule generation

Fix 'addStartRule' from Grammar module and find a place for it in the normalization process.

Usage of any rule in list rule.

Now just rule with the type that is the same as rule can be in the list.
This is because during Normalization for the following rule:
*

Proxy rules should be added to the type of the .
But information on rule type is unavailable during the Normalization.
For now type named is used.

Lexer macro generation

In order to reference one lexical rule from another one macro should be generated in Alex. Currently <TODO: macro ref here> is generated.

grammar.pg issue

Somewhy ImportsOpt is not added for quasiquotation tokens. Needs investigation

Start rule should not be generated

After parsing file we receiving term that could not be matched against main grammar terminal. This rule should not be generated. It should be enough to add all QQ stuff in root non-terminal.

Obtaining primitive data

There should be a way to get primitive value from a terminal.
For example:

Name = id;

There should be either a functions, so one can write:

getId (n :: Name),

or user-defined constructor name:

let (IdName id) = (n :: Name)

Notworking case in qq pattern matching

let [rule|$name:nm = $clause:cl1 | $clause:cl2 | $clause:cl3 | $clause:cl4 ;|] = [rule| Rule = id '=' Clause ';' 
                                                                                     | id ':' id '=' Clause ';'
                                                                                     | id '.' id ':' id '=' Clause ';'
                                                                                     | '.' id ':' id '=' Clause ';' ;|]
putStrLn $ show cl1

Default 'id' token

Problem is that when QQ vars added some token needed that match the following rules:
[a-zA-Z][a-zA-Z_]*

There is already exists one in test-grammar.pg. So I cannot just add new one because they will overlap during lexer.
So, lexical rules should be normalized and possibility should be added to find token rule.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.