Simple precedence parser: Difference between revisions

Content deleted Content added
Qsebas (talk | contribs)
Qsebas (talk | contribs)
Line 34:
<pre>
Given the language:
E --> E + T ' | T'
T' --> T
T --> T * F | F
F --> ( E ) | [0..9]num
 
'''num''' is a terminal, and the [[lexer]] parse any integer as '''num'''.
 
</pre>
 
and the Parsing table:
 
 
<math>\dot <</math>
 
{|border="1" cellpadding="2"
| ||E||T||T'||F||+||*||(||)||num
|-
|E || || || || ||<math>\dot =</math>|| || || ||
|-
|T || || || || || || || || ||
|-
|T'|| || || || || || || || ||
|-
|F || || || || || || || || ||
|-
|+ || || || || || || || || ||
|-
|* || || || || || || || || ||
|-
|( || || || || || || || || ||
|-
|) || || || || || || || || ||
|-
|num|| || || || || || || || ||
|}