Recursive Descent Example 1 S a S b S b S a S x All “symbols” starting with uppercase are non-terminals, all other symbols are terminals
Recursive Descent Example 2 S F F ID ( ARGS ) ARGS ARG , ARGS ARGS ARG ARG ID | IntLit ID x | y | z IntLit 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Recursive Descent Example 3 S if ( ID RelOP ID ) A A A A A ID = ID A ID = IntLit ID x | y | z IntLit 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 RelOp < | > | == | != | <= | >=
Recursive Descent Example 3a S if ( ID RelOP ID ) A A B A A ε // empty string B LID = ID LID x | y | z ID LID | IntLit IntLit 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 RelOp < | > | == | != | <= | >=