Grammar example |
Example for a XML grammar file<?xml version="1.0"?> <grammar> <priority> <terminal symbol="mult"/> <terminal symbol="div"/> <terminal symbol="plus"/> <terminal symbol="minus"/> </priority> <associativity symbol="mult" type="right"/> <associativity symbol="div" type="right"/> <associativity symbol="plus" type="right"/> <associativity symbol="minus" type="right"/> <production symbol="exp"> <nonterminal symbol="exp"/><terminal symbol="plus"/><nonterminal symbol="exp"/> </production> <production symbol="exp"> <nonterminal symbol="exp"/><terminal symbol="minus"/><nonterminal symbol="exp"/> </production> <production symbol="exp"> <nonterminal symbol="exp"/><terminal symbol="mult"/><nonterminal symbol="exp"/> </production> <production symbol="exp"> <nonterminal symbol="exp"/><terminal symbol="div"/><nonterminal symbol="exp"/> </production> <production symbol="exp"> <terminal symbol="pleft"/><nonterminal symbol="exp"/><terminal symbol="pright"/> </production> <production symbol="exp"> <terminal symbol="id"/> </production> <production symbol="exp"> <terminal symbol="number"/> </production> <start symbol="exp"/> </grammar> |