Grammar example |
Example for a XML grammar file<?xml version="1.0" encoding="ASCII"?> <grammar xmlns="http://chaperon.sourceforge.net/schema/grammar/2.0" start="E"> <definition name="F"> <choice> <one-or-more> <class> <interval> <char value="0"/> <char value="9"/> </interval> </class> </one-or-more> <sequence> <char value="("/> <element name="ws"/> <element name="E"/> <element name="ws"/> <char value=")"/> </sequence> </choice> </definition> <definition name="T"> <sequence> <element name="F"/> <zero-or-more> <sequence> <element name="ws"/> <char value="*"/> <element name="ws"/> <element name="F"/> </sequence> </zero-or-more> </sequence> </definition> <definition name="E"> <sequence> <element name="T"/> <zero-or-more> <sequence> <element name="ws"/> <char value="+"/> <element name="ws"/> <element name="T"/> </sequence> </zero-or-more> </sequence> </definition> <definition name="ws"> <zero-or-more> <class> <char value=" "/> <char value="#9"/> <char value="#13"/> <char value="#10"/> </class> </zero-or-more> </definition> </grammar> |