cc/td/doc/product/rtrmgmt/ugm/ugca
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

BNF for Markup Interpreter:
Terminals and Nonterminals

BNF for Markup Interpreter:
Terminals and Nonterminals


This appendix lists terminals and nonterminals used by the markup interpreter. Backaus Naur Form (BNF) is a formal compiler-syntax notation system. A terminals is a symbol that is to be written exactly as represented (for example, a token). A nonterminals is a sequence of alternatives consisting of terminals or nonterminals separated by a metasymbol such as "|".

Terminals
<IDENTIFIER> ::= <LETTER> (<LETTER>|<DIGIT>|<SYMBOL>)*
<LETTER> ::= ["a"-"z", "A"-"Z"]
<SYMBOL> ::= ["_", "."]
<STR_CHAR> ::= (~["\"","\\","\n","\r"])
| ("\\"
( ["n","t","b","r","f","\\","'","\""]
| ["0"-"7"] ( ["0"-"7"] )?
| ["0"-"3"] ["0"-"7"] ["0"-"7"]
)
<DIGIT> ::= ["0"-"9"]
<BOOL_VALUE> ::= "TRUE"|"FALSE"|"true"|"false"
Nonterminals
CompilationUnit ::= ( Statement )* <EOF>
Expression ::= Assignment
| ConditionalMatchExpression
Assignment ::= PrimaryExpression "=" Expression
ConditionalMatchExpression ::= ConditionalOrExpression ( "~~" ConditionalOrExpression )*
ConditionalOrExpression ::= ConditionalAndExpression ( "||" ConditionalAndExpression )*
ConditionalAndExpression ::= EqualityExpression ( "&&" EqualityExpression )*
EqualityExpression ::= RelationalExpression ( "==" RelationalExpression |
"!=" RelationalExpression )*
RelationalExpression ::= MatchingExpression ( "<" MatchingExpression |
">" MatchingExpression |
"<=" MatchingExpression |
">=" MatchingExpression )*
MatchingExpression ::= AdditiveExpression ( "~" StringLiteral )?
AdditiveExpression ::= MultiplicativeExpression ( "+" MultiplicativeExpression |
"-" MultiplicativeExpression )*
MultiplicativeExpression ::= PrimaryExpression ( "*" PrimaryExpression |
"/" PrimaryExpression )*
PrimaryExpression ::= Literal
| Variable
| "(" Expression ")"
Variable ::= <IDENTIFIER>
Literal ::= ( <NUMBER_LITERAL> )
| ( <BOOL_LITERAL> )
| StringLiteral
StringLiteral ::= ( <STRING_LITERAL> )
Statement ::= ";"
| Block
| StatementExpression
| IfStatement
Block ::= "{" ( Statement )* "}"
StatementExpression ::= Assignment ";"
IfStatement ::= "if" "(" Expression ")" Statement ( "else" Statement )?


hometocprevnextglossaryfeedbacksearchhelp
Posted: Fri Mar 28 17:00:31 PST 2003
All contents are Copyright © 1992--2002 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.