[antlr-interest] Test rig template (Was: Setting input in the interpreter)

Thomas Nilsson thomas.nilsson at responsive.se
Mon Aug 23 13:47:22 PDT 2010


23 aug 2010 kl. 22.28 skrev A Z:

> ANTLRWorks creates __Test__.java in the outputs path. This creates an
> instance of your parser with a debug port so you cannot run it standalone
> lest it hangs waiting for the debugger. You can simply change the parser
> instance to fix this.
> 

I'm sorry, but I don't really understand this. Or, rather I understand that ANTLRWorks is creating a specialized wrapper around my parser so that it can talk to the debugger. But how does that help me creating and modifying the test rig (as per the dialoges in ANTLRWorks: "Edit the xxx.g Test rig for Java" and my need to instantiate a case-insensitive input stream).

Being a newbie I don't know what steps to take to "simply change the parser instance". Where do I find it? There seems to be very few java files generated at a location that I can find... Do I have to revert to running Antrl from the command line with magic switches? And then build manually? I can do that, but I jumped in at the ANTLRWorks level and thought I could go on working at that level...

Thomas Nilsson, CTO, Agile Mentor
Responsive Development Technologies AB
Web: http://www.responsive.se
Email: thomas.nilsson at responsive.se
Phone: +46 70 561 75 41
Blog: http://www.responsive.se/thomas

> 
> On Mon, Aug 23, 2010 at 3:42 AM, Thomas Nilsson <
> thomas.nilsson at responsive.se> wrote:
> 
>> So, there were no-one that could point me in the right direction about the
>> Test Rig? Is there a template? Does ANTLRWorks/IDE create one that I could
>> start from? If so where would I find it?
>> 
>> (Or maybe this is described in The Book? If so I'll be receiving it in a
>> couple of days...)
>> 
>> 
>> Thomas Nilsson, CTO, Agile Mentor
>> Responsive Development Technologies AB
>> Web: http://www.responsive.se
>> Email: thomas.nilsson at responsive.se
>> Phone: +46 70 561 75 41
>> Blog: http://www.responsive.se/thomas
>> 
>> 20 aug 2010 kl. 21.55 skrev Thomas Nilsson:
>> 
>>> 20 aug 2010 kl. 18.11 skrev Jim Idle:
>>> 
>>>> Did you notice the tab that allows you to change the test rig template?
>>>> 
>>> 
>>> Yes, I did, but it was not easy to find it again, now that I know that I
>> probably need it ;-)
>>> 
>>> I found one on the "Run"-menue and some setting in the Preferences (but
>> no tab). But I don't really know what to make of it. How do I use it? I
>> guess that the "Class" is to indicate a java class to load, and that the
>> classpath should be tweaked accordingly in the
>> Preferences->Compiler->Classpath. Would I lose any system classpaths that I
>> need to explicitly add if I customize it?
>>> 
>>> And finally, the class should be a complete implementation of the test
>> rig. Is there a template somewhere?
>>> 
>>> (All this is in ANTLRWorks 1.4, couldn't find anything similar in
>> ANTLR-IDE, Eclipse 3.6...)
>>> 
>>> Thomas Nilsson, CTO, Agile Mentor
>>> Responsive Development Technologies AB
>>> Web: http://www.responsive.se
>>> Email: thomas.nilsson at responsive.se
>>> Phone: +46 70 561 75 41
>>> Blog: http://www.responsive.se/thomas
>>> 
>>>> Jim
>>>> 
>>>>> -----Original Message-----
>>>>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>>>>> bounces at antlr.org] On Behalf Of Thomas Nilsson
>>>>> Sent: Thursday, August 19, 2010 11:17 PM
>>>>> To: antlr-interest at antlr.org
>>>>> Subject: [antlr-interest] Setting input in the interpreter
>>>>> 
>>>>> Is there a way to set the input stream in the interpreter, either
>>>> ANTLRWorks
>>>>> or ANTLR IDE?
>>>>> 
>>>>> My grammar is case insensitive,  and although there is an example on
>> the
>>>>> Wiki on how to do this for real, I was looking for a way to run my
>>>> numerous
>>>>> test cases in the interpreter before implementing anything else.
>>>>> 
>>>>> Thomas Nilsson, CTO, Agile Mentor
>>>>> Responsive Development Technologies AB
>>>>> Web: http://www.responsive.se
>>>>> Email: thomas.nilsson at responsive.se
>>>>> Phone: +46 70 561 75 41
>>>>> Blog: http://www.responsive.se/thomas
>>>>> 
>>>>> 
>>>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>>>> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
>>>>> email-address
>>>> 
>>>> 
>>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>> 
>>> 
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>> 
>> 
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list