Re: %union and shared pointers to AST nodes

2005-09-27 Thread Hans Aberg
On 27 Sep 2005, at 10:40, Evan Lavelle wrote: Frans Englich wrote: (From the top of my head it would be nice if one could combine different types for different types of "entities". Say, a union for tokens, and an YYSTYPE struct for non-terminals. This is not possible, as all parser semanti

Re: %union and shared pointers to AST nodes

2005-09-27 Thread Evan Lavelle
Frans Englich wrote: On Friday 16 September 2005 20:28, Evan Lavelle wrote: struct yystype { ... antlr::RefToken tok; antlr::RefASTast; }; #define YYSTYPE yystype Yupp, that is an attractive solution from a memory management perspective. However, I have trouble with connectin

Re: %union and shared pointers to AST nodes

2005-09-26 Thread Frans Englich
On Friday 16 September 2005 20:28, Evan Lavelle wrote: > struct yystype { > ... > antlr::RefToken tok; > antlr::RefASTast; > }; > > #define YYSTYPE yystype Yupp, that is an attractive solution from a memory management perspective. However, I have trouble with connecting flex to t

Re: %union and shared pointers to AST nodes

2005-09-16 Thread Evan Lavelle
struct yystype { ... antlr::RefToken tok; antlr::RefASTast; }; #define YYSTYPE yystype Evan ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: %union and shared pointers to AST nodes

2005-09-16 Thread Laurence Finston
On Fri, 16 Sep 2005, Frans Englich wrote: > From my actions I call factory functions which returns instances I assign to > the actions($$), in order to build an AST tree. I write in C++, and recently > converted all code to return/take shared pointers to objects, instead of raw > pointers. > > Whe

Re: %union and shared pointers to AST nodes

2005-09-16 Thread Hans Aberg
On 16 Sep 2005, at 19:14, Frans Englich wrote: I have a problem involving bison although a solution may not directly mean modifying the bison grammar. Nevertheless, someone might be able to spot a solution. From my actions I call factory functions which returns instances I assign to the a

%union and shared pointers to AST nodes

2005-09-16 Thread Frans Englich
Hi, I have a problem involving bison although a solution may not directly mean modifying the bison grammar. Nevertheless, someone might be able to spot a solution. From my actions I call factory functions which returns instances I assign to the actions($$), in order to build an AST tree. I wr