[cfe-dev] decl/expr ambiguity

Hartmut Kaiser hartmut.kaiser at gmail.com
Mon Aug 25 10:54:39 PDT 2008


Chris,

> On Aug 24, 2008, at 6:48 PM, Hartmut Kaiser wrote:
> > I'm not sure if this has been discussed before (I didn't follow the
> > whole
> > discussion), so please bear with me if this is repetitive.
> >
> > A completely different approach would be to build a parser either
> > for a
> > (non-ambiguous) superset of C++ or building a (GLR like) parser
> > generating
> > not a single parse tree, but a parse forest covering the ambiguous
> > parts,
> > and fixing the non-C++ parts/ambiguities in the resulting parse
> > tree(s)
> > afterwards.
> 
> Hi Hartmut,
> 
> As you guessed, we have explicitly chosen to not use GLR approaches
> due to efficiency concerns.  

Sure.

> Parsing a superset of the language might
> be possible, but would probably make the common code significantly
> more complex: it would have to handle the nastiness of decls and exprs
> in one shared parser.

I don't follow here. I thought the decls/expr ambiguities are something C++
specific so will have to be handled for C++ and by the C++ specific parts of
the parser only. That means any understood superset of C++ will affect the
C++ specific parser only. No common code with C/ObjC/etc., AFAICS. Could you
elaborate, please?

Regards Hartmut





More information about the cfe-dev mailing list