help-bison
[Top][All Lists]
Advanced

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

Re: Shift reduce errors due to embedded actions


From: Hans Aberg
Subject: Re: Shift reduce errors due to embedded actions
Date: Fri, 12 Oct 2001 12:58:29 +0200

At 20:21 +0200 2001/10/11, Axel Kittenberger wrote:
>...as I was able to write the grammar only with rules with all only having
>one token on the left side this is per definition a context free grammar.

Right. I did nit think about this. But I do not know how to explicitly
rewrite a LR(n) grammar to a LR(1) (or LR(0) when sentences have are
terminated by an end symbol). -- Perhaps that reference contains some hints.

>... but this implies you cannot hava a type and a variable with the same
>name,

Right. Unless one introduces extra context sensitivity in the lexer.

For example, one can allow say C++ style
    class class { ... };
by letting the lexer, when it has read the first "class" disregard the
"class" keyword.

I think that humans benefit from such context sensitivity; the problem is
how to implement it in a computer.

  Hans Aberg





reply via email to

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