grammatica-users
[Top][All Lists]
Advanced

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

[Grammatica-users] question about tokens


From: Wieger Wesselink
Subject: [Grammatica-users] question about tokens
Date: Thu, 18 Aug 2011 22:18:14 +0200

Hello,

I have the following grammar that parses the string "x2" successfully
as two different tokens:

----
%tokens%
OPERATOR         = "x"
NUMBER           = <<[0-9]*>>
WHITESPACE       = <<[ \t\n\r]+>> %ignore%

%productions%
Value            = OPERATOR NUMBER ;
---

When I add the token definition IDENTIFIER = <<[a-zA-Z][a-zA-Z0-9-_]*>>
,
the string "x2" results in a parse error, since it is parsed as a single
IDENTIFIER token. Is there something that I can do to prevent this?

Best regards,

Wieger

-- 
http://www.fastmail.fm - mmm... Fastmail...




reply via email to

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