Metagrammar Grammar

--- metagrammar : Agrammar : metagrammar ---
Grammar metagrammar :

Option

  version    = 5
  suffix= '.gram'

  BobsOption = '32,34'
  comBegin   = '(*'
  comEnd     = '*)'
  stringChar = '\'' 

Rule


  <AGrammar>    ::= 'Grammar' <GrammarName> ':' <OptionOp>
                    'Rule' <ProductionList> <AttributeOp>;
  <GrammarName> ::= <NameDecl>;
  <ProductionList>::+ <Prod> ';';

  <Prod>        ::|<Alternation>|<Constructor>|<Lst>
                  |<Opt>|<Dummy>|<ErrorProd>;

  <LeftSide>    ::= '<' <SynDeclName> '>';

  <Alternation> ::= <LeftSide> '::|' <SynCatList>;
  <SynCatList>  ::+ <SynCat> '|';

  <Constructor> ::= <LeftSide> '::=' <ConsElemList>;
  <ConsElemList>::+ <ConsElem>;
  <ConsElem>    ::| <TaggedSyn> | <SynCat> | <Term> | <ErrorSpec>;
  <TaggedSyn>   ::= '<' <TagName> ':' <SynName> '>';
  <SynCat>      ::= '<' <SynName> '>';
  <ErrorSpec>   ::= 'error';

  <Lst>         ::| <ListOne> | <ListZero>;
  <ListOne>     ::= <LeftSide> '::+' <SynCat> <TermOp>;
  <ListZero>    ::= <LeftSide> '::*' <SynCat> <TermOp>; 
  <TermOp>      ::? <Term>;

  <Opt>         ::= <LeftSide> '::?' <SynCat>;

  <Dummy>       ::= <LeftSide> '::'  <SynCat>;

  <SynName>     ::= <NameAppl>;
  <TagName>     ::= <NameDecl>;
  <SynDeclName> ::= <NameDecl>;
  <Term>        ::= <String>;                                           

  <OptionOp>    ::? <OptionPart>;
  <OptionPart>  ::= 'option' <optionList>;
  <optionList>  ::+ <optionElement>;
  <optionElement> ::= <optionName> '=' <optionSpecification>;
  <optionSpecification> ::| <singleOption> | <optionSpecLst>;
  <optionSpecLst>   ::= '(' <optionSpecList> ')';
  <optionSpecList>  ::+ <singleOption>;

  <singleOption>::| <optionName> | <optionConst> 
                  | <optionString> | <optionError>;
  <optionName>  ::= <NameAppl>;
  <optionConst> ::= <Const>;
  <optionString>::= <String>;

  <AttributeOp> ::? <AttributePart>;
  <AttributePart>::= 'attribute' <attriblist>;
  <AttribList>  ::* <Attrib>;

  <Attrib>      ::| <SimpleAttrib> 
                  | <ComplexAttrib> ;

  <SimpleAttrib> ::= <SynCat> ':' <NoOfAttributes>;
  <ComplexAttrib> ::= <SynCat> ':' '(#' <DeclList> '#)';
  <DeclList>      ::+ <Decl> ';' ;
  <Decl> ::= <DeclName> ':' <ApplName> ;
  <DeclName> ::= <NameDecl> ;
  <ApplName> ::= <NameAppl> ;
  <NoOfAttributes> ::= <const>;
  <errorProd> ::= Error;
  <optionError> ::= Error

Attribute


  <LeftSide> : 2 
  <SynName>  : 1

  <Decl>     : 0
  <Prod>     : 0
  <ConsElem> : 0
  <AGrammar> : 0
  <TaggedSyn>: 0
  <SynCat>   : 0
  <Term>     : 0


Metagrammar Grammar
© 1990-2004 Mjølner Informatics
[Modified: Monday March 22nd 2004 at 8:53]