[antlr-interest] Re: caseSensitive question?

ronald.petty at milliman.com ronald.petty at milliman.com
Fri Apr 9 10:55:28 PDT 2004


The current plan is to GPL it.  We feel there is a need from VB to 
language X.

So yes I do, espically since I am getting free help, of course I want to 
"payback" to the community.
And for you question about "it doesn't work", means I should have sent the 
parser :).  I am climbing the newbie hump with Antlr and still trying to 
learn how to describe things I see.  In this case it means the program 
terminated (back to a prompt).

Ron



"micheal_jor" <open.zone at virgin.net> 
04/09/2004 12:43 PM
Please respond to
antlr-interest at yahoogroups.com


To
antlr-interest at yahoogroups.com
cc

Subject
[antlr-interest] Re: caseSensitive question? 






--- In antlr-interest at yahoogroups.com, ronald.petty at m... wrote:
> When I try to match "Dim" this doesn't work, however if I try "dim" it 
> works.  Is there something besides caseSensitive to set?  Is my 
> charVocabulary or something interferring? 

You need to set caseSentiveLiterals too.

When you say "it doesn't work", what happens exactly?. It helps to
post the input (not too lengthy) and the output messages in addition
to the grammar.

Do you plan on contributing this grammar to ANTLR's grammars library
with a license that isn't more restrictive than BSD?

> options {
> }
> 
> class VB6Lexer extends Lexer;
> 
> options {
>         exportVocab=VB6;
>         charVocabulary='\3'..'\377'; //Latin, need to figure out
Japanese 
> charat
> er sets for UNICODE, you can do non continuous ranges

Why Japanese?. In any case, I don't think VB6 did UNICODE.

>         caseSensitive=false;
> 
> }
> 
> tokens {
>         DIM     = "dim";
>         FUNCTION        = "function";
>         SUB     = "sub";
> }
> 
> WS
>         :       ' '
>         |       '\t'
>         |       '\r' '\n'
>         |       '\n'
>         ;

You might want to separate NEWLINE from other WHITESPACE. You usually
need to call newline() at a minimum after snarfing a newline char so
that your tokens have the correct line number info.

> 
> SEMI    :       ','
>         ;
> 
> ID
>         options {
>                 testLiterals=true;
>                 paraphrase = "an identifier";
> 
>         }
>         :       ('a'..'z') ('a'..'z'|'0'..'9'|'_'|'.')*
>         ;
> 
> SL_COMMENT
>         :       "'" (~('\r'|'\n'))* (("\r\n")=>'\r''\n'|'\n')
>         ;
> 
>
**************************************************************************************
> This communication is intended solely for the addressee and is
> confidential. If you are not the intended recipient, any disclosure, 
> copying, distribution or any action taken or omitted to be taken in
> reliance on it, is prohibited and may be unlawful. Unless indicated
> to the contrary: it does not constitute professional advice or 
> opinions upon which reliance may be made by the addressee or any
> other party, and it should be considered to be a work in progress.
>
**************************************************************************************



 
Yahoo! Groups Links



 




**************************************************************************************
This communication is intended solely for the addressee and is
confidential. If you are not the intended recipient, any disclosure, 
copying, distribution or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. Unless indicated
to the contrary: it does not constitute professional advice or 
opinions upon which reliance may be made by the addressee or any
other party, and it should be considered to be a work in progress.
**************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20040409/c59471cb/attachment.html


More information about the antlr-interest mailing list