-
Notifications
You must be signed in to change notification settings - Fork 97
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
"Phase 2" after Parsing #32
Comments
there's something called AST (abstract syntax tree), google it, Irony supports this, AST construction, and you can treat your model as AST. Look at expression evaluator grammar - the executable model of the expression is a graph of expr objects. |
Ok so I created an AstNode for the RegisterReference
I then added the following to the SLCGrammar Class
I did a rebuild but I still have a blank AST, obviously, my new Properties will be null, but I expect at least something to show in the AST. Am I missing something? Further, if I want to get all of the children of RegisterReference, do I need to create an AstNode for each one? I'm looking to flatten everything below RegisterReference. |
no, defining a single node is not enough to see something in AST tab in GE. GE shows the AST tree starting from the top, building the tree by accessing each node's children using IBrowsableAstNode interface, from top/root. So if you don't anything at the top-root, you won't see anything. |
@rivantsov mentioned in one of his emails to me
So I assume that implementing phase to is something I need to do from scratch by traversing the parse tree and that there is no built-in way in irony to handle this, or really even help. Correct?
Basically I want to get this grammar into a flat class like this
This would be an example of grammar where a number can mean different things in different places.
The text was updated successfully, but these errors were encountered: