help-bison
[Top][All Lists]
Advanced

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

Re: help, bison grammar conflicts


From: Hans Aberg
Subject: Re: help, bison grammar conflicts
Date: Sat, 11 Aug 2001 19:34:50 +0200

At 16:08 +0200 2001/08/11, Axel Kittenberger wrote:
>The problem is after the '(' token for the function or the field, I would
>need to look two tokens into the future to determine if this an expression so
>this is a function call, or if this is variable type so a it's a function
>import. Like if after the opening bracket '(' comes an identifier this can be
>either a variable name, or a type name, if the next token is an operator or a
>',' I would know it's a variable, but if the next token is again an
>Identifier I would know that it is a type with var-name like String someparm.
...
>Or is it only possible with other parser technics?

I think the standard way to solve this is to have a lookup table (use say
the C++ std::map template class) which the lexer looks into and checks what
token to return to the Bison generated parser.

  Hans Aberg





reply via email to

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