[antlr-interest] Re: Making the C grammar in cgram.tgz

Terence Parr parrt at jguru.com
Mon Mar 10 10:08:55 PST 2003


On Monday, March 10, 2003, at 08:23  AM, mzukowski at yci.com wrote:

> Heh, I got a kick out of being called a Java / antlr newbie :)  Zen 
> Mind,
> Beginners Mind....

Wow...if you're a newbie, am i a furbie?  Maybe a teletubby. ;)

Ter

> -----Original Message-----
> From: edcjones [mailto:edcjones at yahoo.com]
> Sent: Sunday, March 09, 2003 7:02 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Re: Making the C grammar in cgram.tgz
>
>
> I have now discovered what the problem is.
>
> 1. It is better to use full path names in a CLASSPATH. My
> ".bash_profile" now says:
>
>      CLASSPATH=/usr/local/src/antlr-2.7.2
>      CLASSPATH=$CLASSPATH:/home/.../cgram/grammars
>      CLASSPATH=$CLASSPATH:/home/.../cgram/examples:.
>      export CLASSPATH
>
> 2. In the .java files in cgram/grammars, comment out "import CToken;"
> and "import LineObject;". One cannot shorten a one-token name.
>
> Here is how this Python user and Java / antlr newbie got confused:
> "import" means different things in Java and Python. In Python, "import
> sys" makes the contents of module "sys" available for use. In Java,
> "import antlr.SemanticException;" allows the use of the name
> "SemanticException" instead of "antlr.SemanticException".
>
> --- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
>> This doesn't make sense to me.  It's like it's confused between
> having both
>> . and ../grammars be the same directory.  Did you try it without
> ../grammars
>> in your classpath?
>>
>> Sorry for the late reply, I was in the middle of the Pacific as of
> late,
>> just starting to slog through the hundreds of antlr messages I
> missed....
>>
>> Monty
>
>> --- In antlr-interest at yahoogroups.com, "edcjones <edcjones at y...>"
>> <edcjones at y...> wrote:
>>> I have installed Blackdown Java Version 1.4.1-beta (based on Sun's
>>> 1.4.1-pre-rc-b17) and antlr-2.7.2 on my Gentoo Linux PC.
>>>
>>> In the antlr resources, there is a grammar for C in a file
>>> "cgram.tgz". I have set the classpath to
>>>
>>>     /usr/local/src/antlr-2.7.2:../grammars:../examples:.
>>>
>>> I am having trouble getting cgram to compile. I cd to "grammars"
> and
>>> do "make". I get the error message:
>>>
>>>     javac StdCParser.java
>>>     ../grammars/TNode.java:9: '.' expected
>>>     import CToken;
>>>              ^
>>>     1 error
>>>     make: *** [StdCParser.class] Error 1
>
>
>
>
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
>
>
>
>
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
>
>
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco


 

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



More information about the antlr-interest mailing list