On Sat, 18 Dec 2010, SF Markus Elfring wrote:

> > However just allowing : < and > in identifier names I could do in a few 
> > minutes.  
> 
> Is your parser prepared to handle ambiguous programming language constructs?
> How does your software tool deal with context-sensitive interpretation of
> characters for the safe creation of tokens during lexical analysis?

The parser contains an ad hoc pass between lexing and parsing that can 
address some context-sensitivity issues.  This is described in the 
following paper:

Yoann Padioleau: Parsing C/C++ Code without Pre-processing. CC 2009: 109-125

In the preliminary solution I proposed to Michael, there is none of this.  
Anything contiguous sequence of letters and digits containing : ~ < and > 
will be considered to be an identifier.

A more clever solution would consider where : ~ < > can meaningfully 
appear, or consider these characters to be tokens and assemble them into 
identifiers during thephase between lexing and parsing or during the 
parsing process.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to