Simple precedence parser: Difference between revisions

Content deleted Content added
Qsebas (talk | contribs)
Qsebas (talk | contribs)
Line 51:
| E || || || || || ||<math>\dot =</math>|| || ||<math>\dot ></math> || ||<math>\dot ></math>
|-
| E'|| || || || || || || || ||<math>\dot =</math>|| ||
|-
| T || || || || || ||<math>\dot ></math>||<math>\dot =</math>|| ||<math>\dot ></math>|| ||<math>\dot ></math>
Line 59:
| F || || || || || ||<math>\dot ></math>||<math>\dot ></math>|| ||<math>\dot ></math>|| ||<math>\dot ></math>
|-
| + || || ||<math>\dot <</math>||<math>\dot =</math>||<math>\dot <</math>|| || ||<math>\dot <</math>|| ||<math>\dot <</math> ||
|-
| * || || || || ||<math>\dot =</math>|| || ||<math>\dot <</math>|| ||<math>\dot <</math> ||
|-
| ( ||<math>\dot <</math>||<math>\dot =</math>||<math>\dot <</math>||<math>\dot <</math>||<math>\dot <</math>|| || ||<math>\dot <</math>|| ||<math>\dot <</math> ||
|-
| ) || || || || || || ||<math>\dot ></math>|| ||<math>\dot ></math>|| ||<math>\dot ></math>
Line 70:
|-
| $ ||<math>\dot <</math>|| ||<math>\dot <</math>||<math>\dot <</math>||<math>\dot <</math>|| || ||<math>\dot
<</math>|| ||<math>\dot <</math> ||
|}
 
Line 79:
 
$ < 2 * ( 1 + 3 )$ SHIFT
$ < 2 > * ( 1 + 3 )$ REDUCE (F -> 2num)
$ < F > * ( 1 + 3 )$ REDUCE (T -> F)
$ < T = * ( 1 + 3 )$ SHIFT
$ < T = * < ( 1 + 3 )$ SHIFT
$ < T = * < ( < 1 + 3 )$ SHIFT
$ < T = * < ( < 1 > + 3 )$ REDUCE 4 times (F -> 1num) (T -> F) (T' -> T) (E -> T ')
$ < T = * < ( < E = + 3 )$ SHIFT
$ < T = * < ( < E = + < 3 )$ SHIFT
$ < T = * < ( < E = + < 3 > )$ REDUCE 3 times (F -> 3num) (T -> F) (T' -> T)
$ < T = * < ( < E = + = T > )$ REDUCE 2 times (E -> E + T) (E' -> E)
$ < T = * < ( < E ' = )$ SHIFT
$ < T = * < ( = E' = ) > $ REDUCE (F -> ( E' ))
$ < T = * = F > $ REDUCE (T -> T * F)
$ < T > $ REDUCE 2 times (T' -> T) (E -> T')