Content deleted Content added
Minor edits |
Minor formatting |
||
Line 37:
</pre>
[[Terminals]] are expressed in quotes (except for the well defined ''ident''
and ''number''). Each [[nonterminal]] is defined by a rule in the grammar.
Notice how closely the code below mirrors the grammar above. There is a procedure for each nonterminal in the grammar. Parsing descends in a top-down manner, until the final nonterminal has been processed. The program fragment depends on a global variable, ''sym'', which contains the next symbol from the input, and the global function ''getsym'', which updates ''sym'' when called.
|