In theoretical terms - not looking for specific implementation details, but how do I write a top-down recursive parser for a simple grammar example such as this:
 HAZ ::= FOO | BAR
 FOO ::= “tea” BAR | POT
 BAR ::= POT
 POT ::= “abc” FOO “tea"
In theoretical terms - not looking for specific implementation details, but how do I write a top-down recursive parser for a simple grammar example such as this:
 HAZ ::= FOO | BAR
 FOO ::= “tea” BAR | POT
 BAR ::= POT
 POT ::= “abc” FOO “tea"
 
    
    See this answer for a general method for coding top down recursive descent parsers directly from a grammar:
Is there an alternative for flex/bison that is usable on 8-bit embedded systems?
 
    
    