bug-bison
[Top][All Lists]
Advanced

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

Variants


From: Hans Aberg
Subject: Variants
Date: Sun, 31 May 2009 10:18:56 +0200

On 27 May 2009, at 20:52, Akim Demaille wrote:

You will be able to do that in Bison 2.6.  A preview is available at

http://www.lrde.epita.fr/~akim/download/bison-2.4.266-4ff3b.tar.bz2


You might add a reference count GC to your variants. The action syntax would be
  $$ = $k;
if one wants to hand over a reference. If one wants to have an independent copy, then add extra functions:
  $$ = $k.clone();
or
  $$ = $k; $$.detach();

Since you have a stack of fixed size objects, the implementation of such a GC might be simplified: the parser stack just has a state value and a pointer to the semantic value. The latter is implemented as a sequence of linked objects, with reference count. This could be made into a tracing GC, if not because of the destructors that must be called.

  Hans Aberg






reply via email to

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