-
Notifications
You must be signed in to change notification settings - Fork 125
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
add lark-based grammar #325
Conversation
5a3c364
to
3acd3ea
Compare
ea95a18
to
21c349a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me.
I played around with it locally using
import os
path = os.path.dirname(__file__)
with open(os.path.join(path, 'grammar.lark')) as fin:
grammar = fin.read()
from lark import Lark
parser = Lark(grammar, start='specification')
import code
code.interact(local=locals())
There are some odd things that I assume will be caught by something after the parser, like any literal can be assigned to any type.
# Parser accepts this
parser.parse('const double not_a_double = "Hello World";')
Correct, that kind of check is out of scope for the grammar. |
I disabled the |
868bace
to
95b264f
Compare
95b264f
to
8a2e80d
Compare
This is the fourth PR integrating #298 step-by-step.
Builds on top of #324.
The grammar covers a subset of the IDL spec.
Linux CI: