Parse EBNF: Difference between revisions

From Rosetta Code
(link to ebnf example for calculator)
m (moved EBNF Parser to EBNF parser: capitalization policy)
(No difference)

Revision as of 09:06, 1 December 2010

Parse EBNF is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Create a simple parser for EBNF grammars. Here is an ebnf grammar in itself and a parser for it in php.

Here are simple parser rules for a calculator taken from the antlr tutorial

expr	: term ( ( PLUS | MINUS )  term )* ;

term	: factor ( ( MULT | DIV ) factor )* ;

factor	: NUMBER ;