grammatica-users
[Top][All Lists]
Advanced

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

Re: [Grammatica-users] Separating out tokens - need help


From: Leszek Doniec
Subject: Re: [Grammatica-users] Separating out tokens - need help
Date: Thu, 7 Feb 2008 13:50:00 +0100

Hi,
 
I am not sure if I am right, but I think that when you use string with % at first position it will not be parsed as LIKE_TEXT, since LIKE_TEXT starts with a letter or digit. So send us the definition of ANY_TEXT or change LIKE_TEXT definition.
 
Cheers,
Leszek

 
2008/2/7, paskal sanil <address@hidden>:
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


_______________________________________________
Grammatica-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/grammatica-users


reply via email to

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