[antlr-interest] How to work with ANTLRNoCaseFilestream (case insensitivity) + ANTLWorks

Jim Idle jimi at temporal-wave.com
Sat Oct 11 18:28:02 PDT 2008


On Sat, 2008-10-11 at 23:34 +0200, brainstorm wrote:

> Hi ! First post on this mailing list :)
> 
> I'm working in a DSL (for educational purposes) and I don't know how
> to archieve token case insensitivity while working with antlrworks
> 1.2.1. I don't want to kludge the grammar with lower & uppercase token
> definitions like:
> 
> 'INT' | 'int' | 'InT' ...
> 
> I taken the the advice from "How do I get case insensitivity?"[1] wiki
> resource, but my problem is about integrating this solution to
> antlrworks without having to build a custom antlrworks or antlr-3.1.1
> jar myself.
> 
> The problem is that, when debugging, ANTLworks generates a
> __Test__.java file using:
> 
> CLLexer lex = new CLLexer(new ANTLRFileStream("input0"));



What I do is change the string template that generates the hook file and
have my own input class available.

However, you will find it is really pretty easy to build your parser
within netbeans/eclipse/intellij/etc and generate the parser with
-debug , then debug remote, which works perfectly.

Jim

> 
> As the default filestream for testcases... but I want antlrworks to
> use the extended NoCaseFilestream class... what is the cleanest method
> to do it ?
> 
> Thanks in advance !
> 
> [1] http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081011/4a234b41/attachment.html 


More information about the antlr-interest mailing list