Closed nscaife closed 8 years ago
I figured out that I need to add the translations to get the nodes to output correctly.
Sorry, I should have answered it earlier. I thought it was a real bug for which I have no time to fix it right now.
YEAP translation is described by so called simple directed translation. It is enough to represent a parse tree but have some constraints. Only one abstract node can represent a rule in a parsing tree. For example, you can write
expr = '-' expr # neg (2)
but you can not write
expr = '-' expr # minus (zero 2)
Using sub-tree in the translation is on my very old TODO list for YAEP. But I don't think it will be actually implemented.
When I parse a string with YAEP, I'm getting back an YAEP_NIL root node. I've enabled the debug logging, and it appears that it is parsing correctly, but is not returning the root of this tree. Here's the debug output:
Here's the grammar. I'm passing in string
leifh
.Everything looks OK to me during the parse. Am I doing something wrong? Thanks!