[antlr-interest] Antlr Easypal Last problem

Mohammed Ibrahim snouto at gmail.com
Sat Sep 8 15:41:28 PDT 2007


i solved this problem by using "nondeterminism"

i made each command must end with a semicolon and then used this syntax to grasp the whole input string message as the following

greedy_option: ( options{greedy=false;}:('\u0000'..'\uffff'))* '"' ';';

in the above string , the element will concatenate every character from the stream and don't expose it until the last double qoutes followed by semicolon is encountered then the antlr lexer exposes the full distinguished string , thanks everybody .
  ----- Original Message ----- 
  From: Martin Kohl 
  To: Mohammed Ibrahim 
  Cc: antlr-interest at antlr.org 
  Sent: Sunday, September 09, 2007 1:51 AM
  Subject: Re: [antlr-interest] Antlr Easypal Last problem


  Usuallz you require the user to escape the double quotes in a string (as in "Foo said,\"Bar!\""), if the string is delimited by double quotes. If this isnt possible change the delimiters.


  On 9/8/07, Mohammed Ibrahim <snouto at gmail.com> wrote:
    i have a problem here friends ,

    there is a command called

    trans_id : "String+integers+ascii codes"

    here the double qoutes exist in two places the first one in the command syntax itself  and the other time may be written inside the double qoutes from the user so i need antlr to recognize the first and last delima as of the command syntax itself and also recognize the double qoutes that may exist in the string entered itself , How can i do that ?


    Thanks.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070909/4ce3a392/attachment.html 


More information about the antlr-interest mailing list