I have two questions on how to write a recursive descent parser:
First, when do you have a non-terminal that can match one of several different non-terminals? How do you check which path is correct?
Secondly, how do you build AST? Using YACC, I can simply write a piece of code to execute for each instance of the nonterminal and have special variables that refer to the "values" of the rules. How do you do this in a recursive descent parser?
c ++ parsing abstract-syntax-tree recursive-descent
mtk358
source share