|
From: | Wei Song |
Subject: | Re: header file guards conflict |
Date: | Mon, 21 May 2012 13:42:57 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
Thanks for the reply Akim. On 2012/5/21 10:34, Akim Demaille wrote:
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.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.
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
[Prev in Thread] | Current Thread | [Next in Thread] |