[antlr-interest] Directory organization

Alan Condit acondit at ipns.com
Tue May 11 13:02:32 PDT 2010


Jim,

I have never built anything before with Java, so when you say "set the classpath to include the path of your template" I guess that I am trying to find out where to do that. The antlr-3.2 jar is inside the antlrworks package. I have built a lot of unix tools in the terminal environment and set environment variables but I have never had to set a path variable in the OS X graphics environment.

It is part of a multi-source project built under xcode. The xcode build rules expect (require) that a file end with '.m' to compile as an Objective-C file. Since I am calling Objective-C methods in the parser, I have to compile it as an Objective-C source, hence it needs to be a '.m' file. There isn't a 'makefile' in the conventional sense. Also I have c-files that have to be compiled as c-files so I can't just change the build rules willy-nilly. If I can avoid learning yet another language 'Java' to solve my problem, that would be my preference.

Alan
---

Alan Condit
1085 Tierra Ct.
Woodburn, OR 97071

Email -- acondit at ipns.com
Home-Office (503) 982-0906

On May 11, 2010, at 12:00 PM, antlr-interest-request at antlr.org wrote:
> Message: 16
> Date: Tue, 11 May 2010 10:25:02 -0700
> From: "Jim Idle" <jimi at temporal-wave.com>
> Subject: Re: [antlr-interest] Directory organization
> To: "antlr-interest at antlr.org" <antlr-interest at antlr.org>
> Message-ID: <f6467cad83debe41a3e4937b99132fdd at temporal-wave.com>
> Content-Type: text/plain;	charset="us-ascii"
> 
> Modify CTarget.java (if you need to in any way) and the templates, then install Maven. Find the pom.xml file in the main directory and read the BUILD.TXT file that is there.
> 
> You can also set the classpath to include the path of your template before anything else and it should load your template rather than the one in the jar (or at least it used to ;), but if you want to change the output file names, then it is easier to rebuild your own jar and use that.
> 
> I thought objective C could use any suffix though just like gcc (but you have to tell it that it is a C file). That might be easier than changing the output templates. Also, when using as part of a build, you could just add the rename to the Makefile.
> 
> Jim
> 
> 
> 
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Alan Condit
>> Sent: Tuesday, May 11, 2010 9:14 AM
>> To: antlr-interest at antlr.org
>> Subject: [antlr-interest] Directory organization
>> 
>> I am running a Mac with OS X 10.6.
>> 
>> I have built a grammar under Antlrworks and have it compiling in my
>> project with Objective-C. I am currently using "language=C".  It is a
>> real pain in the butt to have to go delete the parser and lexer '.m'
>> files and rename the '.c' files to '.m' every time I do code generation
>> under Antlrworks.
>> 
>> I downloaded the tarball for Antlr-3.2 and unpacked it in my "source"
>> directory. In looking at the documentation on code generation targets,
>> the directories from the source tarball don't seem to come close to the
>> directories discussed on the wiki documentation pages.
>> 
>> I have the last two books by Terrance Parr also but I am not finding
>> any good info on getting started on modifying template files and using
>> them from within Antlrworks.
>> 
>> I have found the C templates and where to modify them to generate .m
>> files that I need instead of .c files they now generate. Now I just
>> need to figure out how to get Antlrworks/Antlr to use them instead of
>> the ones in the jar.
>> 
>> Help please!
>> 
>> Thanks,
>> Alan
>> ---
>> 
>> Alan Condit
>> 1085 Tierra Ct.
>> Woodburn, OR 97071
>> 
>> Email -- acondit at ipns.com
>> Home-Office (503) 982-0906



More information about the antlr-interest mailing list