Nonterminal
|
Production rule
|
Comment
|
( "{" & !"}"* & "}" )
|
Skipper
|
[ %32 | %9 | %10 | %13 | %10%13 | Comment ]*
|
Digit
|
"0".."9"
|
Letter
|
"A".."Z" | "a".."z"
|
Anything
|
%0..$10FFFF
|
Unsigned
|
Digit*<1..>
|
Integer
|
[ "+" | "-" ] & [ Digit*<1..> | [ "0" & ~"x" & ( ~"a".."f" | Digit )*<1..> ] ]
|
Real
|
[ "+" | "-" ] & Digit*<1..> & [ [ "." & Digit*<1..> ] & [ ~"e" & Digit*<1..> ] ]
|
Boolean
|
"*" | "!"
|
String
|
%34 & [ %34%34 | %32 | %33 | %35..$10FFFF ]* & %34
|
StringFF
|
%34 & [ %34%34 | %32 | %33 | %35..%255 ]* & %34
|
Hex
|
"$" & ( ~"a".."f" | Digit )*<1..8>
|
Dec
|
"%" & Digit*<1..10>
|
Sequence
|
( ( String | (Hex) | (Dec) )* + ["+"] )*<+>
|
Id
|
( ( "_" | Letter ) & [ "_" | Letter | Digit ]* )
|
Name
|
( "_" | Letter | Digit ) & [ "_" | Letter | Digit ]*
|
Label
|
( "@" & ( Name | StringFF )
& [ "." & ( Name | StringFF ) ]* & [ ":" & ( Name | StringFF ) ]*<0..1> )
|
Ref
|
( [Id] & [Label] )
|
Var
|
( "#" & Id )
|
Type
|
( [ [ "&" ] & Id & [ "[" + [Unsigned] + [ "," + Unsigned ]*<+> + "]" ] ]
| [ "&" & Id & "(" & Id & ")" ] )
|
Cast
|
( "&" & Id ) & ( "(" + Entries + ")" )
|
Deref
|
( "#" & Id & ( [ "[" + ( Unsigned | Deref + [ "," + Unsigned | Deref ]* ) + "]" ]
& [ "." & Id ]* ) )
|
Value
|
( Integer | Real | Boolean | Sequence | Id | Label | Ref | Var )
|
Entry
|
Value | Array | Record | Cast | Deref
|
Entries
|
Entry + [ "," + Entry ]*<+>
|
Array
|
"[" + Entries + "]"
|
Declare
|
[ Id + "=" ] + Entry + [ "," + [ Id + "=" ] + Entry ]*<+>
|
Record
|
"(" + [Declare] + ")"
|
Parameter
|
( Id | Var ) + [ ":" + Type ] + [ "=" + Entry ]
|
Parameters
|
Parameter + [ ";" + Parameter ]*<+>
|
Properties
|
"<" + Parameters + ">"
|
VarDecl
|
( Var & [ "(" & Id & ")" ] ) + [ ":" + Type ] + [ "=" + Entry ]
|
TypeDecl
|
( "&" & Id & [ "(" & Id & ")" ] ) + "=" + Type
|
RecDecl
|
( "&" & Id & [ "(" & Id & ")" ] ) + "="
+ "(" + Parameters + ")"
|
Grammar
|
SectBegin | SectEnd | SectClose | StructBegin | StructEnd | StructClose |
MetaDef | MetaBegin | MetaClose | MetaBreak | PureComment |
PropBegin | PropEnd | PropClose | Insertable | InsertCRLF
|
SectBegin
|
"~\" + ( Id & [Label] ) + [Properties] + "\"
|
SectEnd
|
"~\\"
|
SectClose
|
( "~\~" & Id & [Label] ) + "\"
|
StructBegin
|
"~[" + ( ( Id & [Label] ) | Var ) + [Properties] + "]"
|
StructEnd
|
"~]"
|
StructClose
|
( "~[~" & Id & [Label] ) + "]"
|
MetaDef
|
"~{" + ( VarDecl | TypeDecl | RecDecl )
+ [ ";" + ( VarDecl | TypeDecl | RecDecl ) ]*<+> + "}"
|
MetaBegin
|
"~{" + ( ( Id & [Label] ) | Var ) + [Properties] + "}"
|
MetaClose
|
( "~{~" & Id & [Label] ) + "}"
|
MetaBreak
|
"~}"
|
PureComment
|
"~{" & Comment & "}"
|
PropBegin
|
"~<" + Parameters + ">"
|
PropEnd
|
"~>"
|
PropClose
|
( "~<~" & ( Id | Var ) )
+ [ ";" + ( "~" & ( Id | Var ) ) ]*<+> + ">"
|
Insert
|
( ( ( Id & [Label] | Var ) + [Properties] )
| Cast | Deref | Sequence )
|
Insertable
|
"~(" + Insert + [ ";" + Insert ]*<+> + ")"
|
InsertCRLF
|
"~)"
|