Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-core-dev] Rational CDT Core Proposals

Alain wrote: 
> A few preliminary comments after a _very quick_ look(much
> more to come after
> digesting all that).
> 
> Parser:
> 
>  The C/C++ Preprocessor plays other roles, for example:
>  - concatenation ex:
>    * strcpy(buffer, "CDT " "Project");
>    * strcpy (buffer "CDT \
>      Project");
> 
>    Some compilers like gcc(unfortunately) allow multiline strings
>    with concatenation, my humble opinion .. let it fail.
> 
>    The parser may not be able to handle certain sematics, say
>    "CDT " "Project"  since it is the Preprocessor job to
> clean this out.
 
This type of behaviour will have to be a configuration option to the 
scanner, based upon some kind of compiler descriptor in the build model. 
I know for a fact right now I'm not handling the first case there properly
yet ... 

>  Also I assume that IMacroDescriptor will allow full ANSI C sematic  
> like pasting ..

I had to look that up in the spec to figure out that pasting == "##". :-)

Our implementation currently handles '##' just by treating it as a special
pre-processor token which is included in the MacroDescriptor object; when
the macro gets expanded, the Scanner recognizes the token and determines how
to handle it.  IMacroDescriptor probably could be refined a bit to make this
a bit more explicit as how these interactions occur.  

Another concern regarding token pasting is that the order of evaluation of 
multiple ## operators is unspecified in the ANSI spec.  it will be
interesting 
to see if different pre-processors behave in different ways, thus requiring 
us to add another configuration option on the Scanner. 

John


Back to the top