This is the mail archive of the
mailing list for the GCC project.
Re: [gomp] parse OpenMP directives
Would it be fine to write a recursive descent parser used only for OpenMP
code, and then extend it to handle arbitrary translation units?
Your one sentence description is too short to be a
properly assessable design (besides which some analysis of benefits and
requirements, and of what the minimal incremental components of the change
are, would be needed).
Add "incrementally" before write, and that will reflect my "design" (I
was not trying to suggest a design).
* Better error recovery and more accurate diagnostic location.
This is not going to happen at once. See the C++ parser for examples.
* Could the C++ parser be adapted? (The principles of minimal incremental
changes mean that if the aim is to replace a parser then larger
replacements such as "merge C and C++ front ends" don't need considering
as alternatives, but a parser replacement could be considered as one
incremental change towards such a merge, depending on the design adopted.)
This way was estimated to be around 2-3 man years by Mark Mitchell,
though it may be considered The Only Right Way To Do It.
Of course some parts of the C++ parser may be reused, for example the
interface with cpplib or the binary expression parser.
* Parser actions and code in c-parse.in can move to separate files
separately from a parser replacement, and so should move separately.
Otherwise replacing a parser with minimal changes to other files is the
Yes. This may be merged in 4.1.