Parse EBNF: Difference between revisions

Better link. Note that example is incomplete.
(→‎{{header|Ruby}}: It can now print errors about tokens.)
(Better link. Note that example is incomplete.)
Line 5:
* You can use regular expressions for lexing.
* Generate the calculator in [[Arithmetic evaluation]] using an [http://karmin.ch/ebnf/examples EBNF description] of the calculator.
Here areis part of the simple parser rules for a calculator taken from the [http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3#FiveminuteintroductiontoANTLR3-2.1Createasimplegrammar antlr tutorial]<pre>expr : term ( ( PLUS | MINUS ) term )* ;
 
term : factor ( ( MULT | DIV ) factor )* ;
Anonymous user