About Grammar License
 
Commercial & freeware products Try our software for free before purchase Buy now Company news channel Company informations
  Home » Products » TemlCode » TemlCode Grammar  

19.08.2011
SnapDraw is FREE

15.07.2011
101+ Analog Clocks for Android

29.03.2011
101+ Vector Clocks Available

24.02.2011
Announcing Vector Clock Pro

01.01.2011
New beautiful set of Free Vector Clocks

 

TemlCode Grammar

Here is a complete AEBNF grammar of TemlCode. Any compliant parser must be able to process following schema. By following this schema, one should be able to produce a full featued TemlCode parser (we did it this way).

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 "~)"

 


Tell Us What You Think

Your Name
Your Email
Your Message
We accept anonymous messages. However, if you wish to receive a response, please include your email and name.
  Generated from TemlCode based document. Graphics on this page is rendered with CrossGL SDK. Last page update: 19.8.2011