[antlr-interest] "whitespaces" and "tab characters" -null in the output

s2jafer1 s2jafer1 at yahoo.com
Wed Nov 3 03:05:57 PST 2004




       In my coding i am giving a input for the token, "source" in 

the parser which should accept a string containing "whitespaces" 

and "tab characters" , if the string is entered within double quotes.


"source" token is defined  in the lexer class:

WS : (' ' | '\t')+;

source
    options { testLiterals = true; }
    : ('=') => '='! (WS!)? (' ' | '\n' | '\t')+
    | (~(' ' | '\n' | '\t'))+
    ;


value for "source" token is compared in the parser class :


patternMatch = "[a-zA-Z\\d#$\t\n\f\r_-]*";


i compare the input string with patternMatch.some times i am 
getting "null" in the output.


i want to know the lexer definition and parser definition for 
accepting token values ( strings ) which contains whitespaces and tab 
characters.


let me know if anybody knows the answer













 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list