help-bison
[Top][All Lists]
Advanced

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

Re: Bison and C++


From: Hans Aberg
Subject: Re: Bison and C++
Date: Mon, 13 Aug 2001 21:17:41 +0200

At 09:45 -0500 2001/08/13, David Durham wrote:
>...STL stack might NOT be a good idea if
>the bison algorithm has to look forward and backward in the stack; I dunno
>if it allows that...

The standard LR(1) state machine does not look deeper into the stack, but
the DR  does (I take it from the description given in the Bison lists).
Then just use say std::vector instead. The std::stack is just an adaptor
class.

Or it should be easy to merely require the use of an abstract class A,
which the user specifies. For example, the LR(1) algorithm would require A
to have A::push_back(), A::pop_back(), etc., and some other parser
algorithm may require extra class functions.

  Hans Aberg





reply via email to

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