[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Selective Compilation
From: |
Hans Aberg |
Subject: |
Re: Selective Compilation |
Date: |
Tue, 8 Feb 2011 15:26:50 +0100 |
On 8 Feb 2011, at 13:24, Akim Demaille wrote:
>>> If I understand your question correctly, here is a way to have multiple
>>> scanners and parsers in the same program.
>>
>> No, he's asking about using a subset of an existing grammar in a new parser.
>>
>> Example: I have a language which includes a complex expression syntax. I
>> also have a separate preprocessor for the same language, which uses exactly
>> the same expression syntax. This means that I need to write two completely
>> separate flex/bison files, and maintain both of them, even though one of
>> them is a subset of the other one.
>>
>> This would be a nice feature - I think it's been asked for before on this
>> list.
>
> Yes, and that makes it an FAQ, see section 11.5 of the documentation.
There is also the variation where the code is reused in different parsers. Then
one may run it through a preprocessor extracting the files before compiling by
a command in the makefile.