Re: Pre-parser phase

[email protected] (Gilles J. Seguin) Tue, 01 May 2007 13:53:10 -0400
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
On Tue, 2007-05-01 at 13:35 -0400, Gilles J. Seguin wrote:
> Hi stefan,
> 
> A thing that has never be mention or discuss,
> 
> we have a file
> we have preprocessing
> - perform file inclusion
> - and macro substitution
> result is sequence of tokens that is translation unit.
> 
> Question is,
> The Gnu gcc put identifier in symbol table
> during that preprocessing stage, right ?
> 
> We get them during parsing of the translation unit.
> Do you perceive any problems or reasons who will obliged us
> to do it that way.
> 
> One of them, result of concatenation operator(##) should return
> a valid token.
> And a valid token could be an identifier that at this point could
> be valid or not.
> 
> ex
> A ## :: should fail
> :: ## A should succeed
> A ## :: ## B ## :: ## C should succeed
> if previous A, B and C identifier have been declared
> and fail otherwise

Valid concatenation could fail later because:
- The A identifier does not refer to namespace or class,
  or the identifier B does not belong to namespace.
- Same has previous, and C should be attribute of B
  like declaration of C precede this encounter.

> major implication on the parser.
> 
> what do you think ?