Saturday, March 19, 2011

Three extension are common to most EBNFs

The first extension denotes an optional part of a RHS, which is delimited by brackets. For example:

<if_stmt> -> if ( <expr> ) stmt [ else <stmt> ]

The second extension is the use of braces in an RHS to indicate that the enclosed part can be repeated indefinitely or left out altogether. For example:



<ident_list> -> ident {, <ident> } 


The third extension deals with multiple choice options. For example:



<term> -> <term> ( *|/|% ) <factor>


No comments:

Post a Comment