grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Grammatica-users] Trying to disambiguate a grammar


From: Craig Ugoretz
Subject: [Grammatica-users] Trying to disambiguate a grammar
Date: Sat, 17 Feb 2007 20:21:29 -0600

Hello,
 
     I am new to grammatica (and parsers in general) and I have a grammar that I am trying to disambiguate.  Can anyone lend any advice?  Hopefully, this should get me on the right track with the rest of my work...  I apologize for the notation - it is EBNF, but nonstandard (and non-grammatica).
 
<int> ::= ['~'] <nzdigit> { <digit> }
         |  ['~'] O { <octdigit> }+
         |  ['~'] ('0x' | '0X') { <hexdigit> }+
         |  ['~'] ('0b' | '0B') { <bindigit> }+
<float> ::= ['~'] { <digit> }+ '.' { <digit> } { ('e' | 'E') ['~'] { <digit> }+
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<nzdigit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<octdigit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
<hexdigit> ::= <digit> | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
<bindigit> ::= 0 | 1
 
Can proper tokenization alone with regular expressions lend itself to disambiguating the grammar?  This was a tactic that I tried, but was not familar enough with regular expressions to make progress.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]