Giter Site home page Giter Site logo

ll1pg's People

Contributors

benpigchu avatar paulzfm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ll1pg's Issues

Better error report for undefined character terminate token

If there is a rule using undefined character terminated token. It will report confusing error:
Test : '^' { // An confusing error will report for '^' // for '^' is not a defined token } ;
For the above code, if i haven't defined %token '^', it will report
Error at (The position of quotation token): string matching regex [_A-Za-z][_A-za-z0-9]* expected but `'' found
it's somehow confusing and maybe an undefined token is better if the right side is an undefined terminate character token.

Should we warn about unused productions?

https://github.com/paulzfm/LL1-Parser-Gen/blob/688381a09a262b31091665838e89143e3d607e4f/src/main/scala/JavaCodeFile.scala#L227

Before write this line, should we check if ts is empty? If it is empty, the production is unused, and should we warn about it?

Currently, in some situation, this program may generate a Table.java like this:

// ...
                switch (lookahead) {
                    case PRINT:
                    case CASE:
                    case COMPLEX:
                    case VOID:
                    case FOR:
                    case '!':
                    case '-':
                    case CLASS:
                    case READ_LINE:
                    case WHILE:
                    case RETURN:
                    case NULL:
                    case INT:
                    case PRINT_COMP:
                    case SCOPY:
                    case '}':
                    case '@':
                    case DO:
                    case IDENTIFIER:
                    case NEW:
                    case '$':
                    case IF:
                    case THIS:
                    case INSTANCEOF:
                    case STRING:
                    case LITERAL:
                    case BRANCH:
                    case ELSE:
                    case '(':
                    case ';':
                    case '#':
                    case OD:
                    case DCOPY:
                    case BOOL:
                    case SUPER:
                    case BREAK:
                    case READ_INTEGER:
                    case '{':
                        return new Pair<>(131, Arrays.asList());           // <---
                        return new Pair<>(43, Arrays.asList(ELSE, Stmt));  // <---
                    default: return null;
                }
// ...

This two lines make Java compiler unhappy.

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.