Simple precedence parser: Difference between revisions

Content deleted Content added
grammar
Example: use special characters
Line 81:
STACK PRECEDENCE INPUT ACTION
 
$ < 2 * ( 1 + 3 )$ SHIFT
$ < 2 > * ( 1 + 3 )$ REDUCE (F -> num)
$ < 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 -> num) (T -> F) (T' -> T) (E ->T ')
$ < T = * < ( < E = + 3 )$ SHIFT
$ < T = * < ( < E = + < 3 )$ SHIFT
$ < T = * < ( < E = + < 3 > )$ REDUCE 3 times (F -> num) (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')
$ < E > $ ACCEPT
</pre>