Parse EBNF: Difference between revisions

m
minor
(simple parser generator example ?)
 
m (minor)
Line 5:
* You can use regular expressions for lexing.
* Generate the calculator in [[Arithmetic evaluation]] using an EBNF description of the calculator.
Here isare thesimple parser rules for a calculator taken from the [http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3 antlr tutorial]<pre>expr : term ( ( PLUS | MINUS ) term )* ;
 
term : factor ( ( MULT | DIV ) factor )* ;
Anonymous user