Actually, it seems like the curly braces are wrong, change them to parentheses. And... use regular expressions:

lowercase ::= [a-z]
uppercase ::= [A-Z]
digit ::= [0-9]

If you need curly braces for some reason, you'll have to put them inside quotes: "{" "}", but the grammar interpreter needs parentheses.


On 1/6/2013 10:27 PM, Piaget Modeler wrote:

I'm having a tiny problem crafting an EBNF.

I'm getting the following error from the railroad diagram generator ( http://railroad.my28msec.com/rr/ui ) :

*lexical analysis failed while expecting [NCName, Context, StringLiteral, CharCode, '/*ws:explicit*/', '/*ws:definition*/', S, Comment, EOF, '$', '&', '(', ')', '*', '+', '-', '.', '/', '<<', '<?', '<?ENCORE?>', '<?TOKENS?>', '>>', '?', '[', '|'] *
*
*
*at line 26, column 17: ...*
*
*
*{ letter | digit | " " }* ']' symbol ::= letter { letter | di...*


for the current iteration of the PREMISE  EBNF


*term ::= number | moment | string  | symbol | scheme | collection*
*
*
*number ::= float_positive | float_negative*
*
*
*float_positive ::= '#' [0-9]+ '.' [0-9]* *
*
*
*float_negative ::= '#-' [0-9]+ '.' [0-9]* *
*
*
*moment ::= '@' [0-9]+ *
*
*
*letter ::= uppercase | lowercase *
*
*
*uppercase ::= "A" | "B" | "C" | "D" | "E" | "F" | "G"*
*       | "H" | "I" | "J" | "K" | "L" | "M" | "N"*
*       | "O" | "P" | "Q" | "R" | "S" | "T" | "U"*
*       | "V" | "W" | "X" | "Y" | "Z"*
*
*
*lowercase ::= "a" | "b" | "c" | "d" | "e" | "f" | "g"*
*       | "h" | "i" | "j" | "k" | "l" | "m" | "n"*
*       | "o" | "p" | "q" | "r" | "s" | "t" | "u"*
*       | "v" | "w" | "x" | "y" | "z"*
*
*
*digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"*
*
*
*
*
*string ::= '$[' { letter | digit | " " }* ']'*
*
*
*symbol ::= letter { letter | digit }**
*
*
*scheme ::=  positional | slotted *
*
*
*positional ::=  symbol '(' term { ',' term }* ')' *
*
*
*slotted ::=  symbol '(' slot ':' term { ',' slot ':' term }* ')' *
*
*
*slot ::= symbol*
*
*
*collection ::=  sequence | concurrence | choice | cycle*
*
*
*sequence ::= '[' term* ']' *
*
*
*concurrence ::=  '(' term* ')' *
*
*
*choice ::= '{' term* '}' *
*
*
*cycle ::=  '<' term* '>' *


Your thoughts?

~PM


*AGI* | Archives <https://www.listbox.com/member/archive/303/=now> <https://www.listbox.com/member/archive/rss/303/10215994-5ed4e9d1> | Modify <https://www.listbox.com/member/?&;> Your Subscription [Powered by Listbox] <http://www.listbox.com>



____________________________________________________________


____________________________________________________________
NetZero now offers 4G mobile broadband. Sign up now.
http://www.netzero.net/?refcd=NZINTISP0512T4GOUT1



-------------------------------------------
AGI
Archives: https://www.listbox.com/member/archive/303/=now
RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657
Powered by Listbox: http://www.listbox.com

Reply via email to