grammatica-users
[Top][All Lists]
Advanced

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

[Grammatica-users] Separating out tokens - need help


From: paskal sanil
Subject: [Grammatica-users] Separating out tokens - need help
Date: Thu, 7 Feb 2008 10:24:11 +0530

Hi,

I have the following grammar (Included only the relevant grammar):

Production
-------------
               PExpression      = PTerm [PRest];
               PRest  = "AND" PExpression | "OR" PExpression ;
               PTerm =  FORM_PARAM | ....

Formula
---------
                FORM_PARAM       = "Z" ":" "(" ZBooleanExpr ")"

           ZBooleanExpr     = IDENTIFIER Comparator YIELD_IDENTIFIER
             Comparator = LIKE | EQ | NE;
             YIELD_IDENTIFIER = "'" LIKE_TEXT "'" |  "'" ANY_TEXT "'" | ....

Regular Expression
-----------------------------

LIKE_TEXT   = <<[a-zA-Z0-9][a-zA-Z0-9%_/]*[a-zA-Z0-9]+>>

Problem is that when i give a String like

Str1  ->   Z:(Id1 LIKE '%abc%' ) OR Z:(Id1 LIKE '%xyz%')

It gives the error:

Expected: " ' "
Found : "') OR Z:(Id1 LIKE '"


However the above works fine if use a <Space> in the following String:
Str2 -> Z:(Id1 LIKE '%abc%'<space> ) OR Z:(Id1 LIKE '%xyz%')
or don't use '%'
Str3 -> Z:(Id1 LIKE 'abc' ) OR Z:(Id1 LIKE 'xyz')

How can i make the ")" to be recognized as a separate token?

Please suggest some work around in the "grammar" to make Str1 work.

Thanks in advance,
paskal sanil




reply via email to

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