help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison deterministic LALR parser for C++ (kind of complex langauge) w


From: A D
Subject: Re: Bison deterministic LALR parser for C++ (kind of complex langauge) without 'lexar hack' support
Date: Fri, 17 Aug 2012 23:40:52 +0530

Thanks Hans, but I am not really looking for a C++ grammar.

I need to write a parser for some other object oriented language, which is
as complex as C++/Java.

And to complicate the matter further, this langauge has special constructs
that doesn't allow me to use the symbol table for distinguishing between
type and non-type identifier references. In other words, I will have to
return just one lexical token (say IDENTIFIER) from the lexer for both type
references as well as non-type variable references.
Given these restrictions, I was wondering if writing a yacc/bison based
LALR(1) parser is really an (good) option for me.

Arijit
On Fri, Aug 17, 2012 at 7:22 PM, Hans Aberg <address@hidden> wrote:

>  On 17 Aug 2012, at 07:47, A D wrote:
>
> > I need to write a parser for a programming langauge which is as complex
> as
> > C++, and to even complicate the matter, there are constructs in this
> > langauge that doesn't allow me to use type/identifier dis-ambiguating
> lexer
> > hack. In other words, I will have to return just one lexical token (say
> > IDENTIFIER) from the lexer for both type references as well as non-type
> > variable references.
> >
> > Given these restrictions, I was wondering if it would be a wise decision
> > (or if it is even possoble) to use yacc/bison for my parser (given that I
> > may not have the flexibility to use GLR for performance reasons)…?
>
> You might check with the Usenet newsgroup comp.compilers.
>
> At least an earlier revision of C++ is Yaccable:
>   http://www.parashift.com/c++-faq-lite/yaccable-grammar.html
>
> Hans
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]