Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create parser when lexer is defined in class #99

Closed
5nizza opened this issue Aug 23, 2016 · 1 comment
Closed

Unable to create parser when lexer is defined in class #99

5nizza opened this issue Aug 23, 2016 · 1 comment

Comments

@5nizza
Copy link

5nizza commented Aug 23, 2016

hey!

attached is ctl_lexer_desc.py and ctl_parser_desc.py.
The lexer is defined inside the class as documented in 1.
Unfortunately I cannot create the yacc object --- it fails with "ERROR: No token list is defined".

Is it a bug or I do smth wrong? How to create the parser when the lexer is in the class?
(the original problem -- I need some tokens to be defined dynamically at runtime, like some special string names)

ctl.zip

@dabeaz
Copy link
Owner

dabeaz commented Aug 30, 2016

Tokens also needs to be defined in the parser specification.

# ctl_parser_desc.py
...
tokens = CTLLexer.tokens

@dabeaz dabeaz closed this as completed Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants