Parse EBNF: Difference between revisions
Content added Content deleted
No edit summary |
(link to ebnf example for calculator) |
||
Line 4: | Line 4: | ||
* You can use regular expressions for lexing. |
* You can use regular expressions for lexing. |
||
* Generate the calculator in [[Arithmetic evaluation]] using an EBNF description of the calculator. |
* Generate the calculator in [[Arithmetic evaluation]] using an [http://karmin.ch/ebnf/examples EBNF description] of the calculator. |
||
Here are simple 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 )* ; |
Here are simple 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 )* ; |
||