Thanks for the reply Akim.
On 2012/5/21 10:34, Akim Demaille wrote:
Currently we use BISON_LOCATION_HH (it is open-coded). One
first idea would be to use the output file name, so if
for instance you passed "-o lang1/parser.cc", the header would
be BISON_LANG1_LOCATION_HH. Would that suffice in your case?
Maybe BISON_ is not needed actually.
Maybe we should also include the given name-prefix? So
this would typically be YY_LANG1_LOCATION_HH.
Using the output file name will handle the problem but I am more prefer
to including the given name-prefix in the header guard.
My file structure is already divided in such a way that every language
has its own sub-directory.
The bison .y files are stored in the sub-directories rather in the root,
therefore, there is no lang1 in the -o argument when running make.
To my understanding, the name-prefix is more independent to the file
structure.
Don't you have the exact same problem with your parser
header file? Currently it is PARSER_HEADER_H… Using
name-prefix + full output name (with directory) that
would be YY_LANG1_PARSER_HH.
Yes I do. I would like to see user-defined name-prefix in all header guards.
Best regards,
-Wei
_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison