X-definition
If you have a collection with more X-definitions enter the name of X-definition with root INI data:
<xd:def xmlns:xd="http://www.xdef.org/xdef/4.2" name="Example" root="root" > <xd:BNFGrammar name = "base"> S ::= [#9#10#13 ]+ /* white spaces */ sign ::= [-+] /* sign or unary operator */ number ::= [0-9]+ ("." [0-9]+)? (("E"|"e") (sign)? [0-9]+)? identifier ::= [a-zA-Z] [a-zA-Z0-9]* </xd:BNFGrammar> <xd:BNFGrammar name = "expr" extends = "base"> value ::= (sign S?)? (number | identifier | "(" S? expression S? ")") term ::= value (S? [*|/%] S? term)? expression ::= term (S? [-+] S? expression)? assignment ::= identifier S? "=" S? expression /* assignment statement */ </xd:BNFGrammar> <xd:declaration> type assignment expr.rule("assignment"); </xd:declaration> <root> assignment; </root> </xd:def>
Input data
<root> x = - abc + 3.14159 * - ( 2.3 - 3e-2 ) / 2 * 10e5 </root>
You can edit
X-definition
or
Input
window