[stringtemplate-interest] Re: [antlr-dev] ST output start/stop tags
Jim Idle
jimi at intersystems.com
Wed Jun 14 23:21:10 PDT 2006
On 6/14/06 6:44 PM, "Terence Parr" <parrt at cs.usfca.edu> wrote:
>
> On Jun 14, 2006, at 12:25 AM, Jim Idle wrote:
>
> Your Target.java file can ask if headerFile is there
>
>> Before just making something up though, how about you suggest
>> something and
>> unless I can find something wrong with it, I will just use it. So,
>> let's say
>> that the C codegen has an option to produce an additional .c and .h
>> file for
>> some option, such as foobar. What do you think?
>
> Seems ok to me...Currently Target superclass has:
>
> protected void genRecognizerFile(Tool tool,
> CodeGenerator generator,
> Grammar grammar,
> StringTemplate outputFileST)
> throws IOException
> {
> String fileName = generator.getRecognizerFileName();
> generator.write(outputFileST, fileName);
> }
>
> protected void genRecognizerHeaderFile(Tool tool,
> CodeGenerator generator,
> Grammar grammar,
> StringTemplate headerFileST)
> throws IOException
> {
> // no header file by default
> }
>
> Perhaps we should call that 2nd one: genAncillaryFiles() or something.
>
Might make more sense as I suppose it isn't always header files in every
target and so on, though it is of course not exactly top of the list of
things to do ;-)
Jim
More information about the stringtemplate-interest
mailing list