Boost logo

Boost :

From: joel de guzman (joel_at_[hidden])
Date: 2001-05-24 22:11:01


From: "Douglas Gregor" :

> > description has most or all of the source code; so, it may be a starting
> > point for this "compile" idea. However, it wasn't in-place. It
generated
> > c++ code for the compiler. To make this in-place would involve some
sort
> > of internal rep for c++ classes which could then be interpreted by some
> > "virtual compiler?" Or am I misunderstanding what you mean by
"in-place"?
>
> "In-place" as in dyanmically at run-time, but without requiring another
> compilation stuff. For instance, it would be possible with Spirit to have
the
> user input a set of EBNF rules and then immediately try to parse input,
> without resorting to dirty tricks.
>
> Doug
>
Hello,

If one looks closely, the hierarchical composition of objects in a
generated parser in Spirit closely resembles the grammar's AST.
If I add mechanisms that would open up the hierarchy for
inspection, one could use that 'AST' to generate more efficient
parsers. It seems to me that generating the hierarchy is no less
efficient (generated code wise) than generating an AST for the
grammar, which is what we want for a front end.

As an added benefit, this AST is runnable and is in
fact a parser in its own right.

Cheers,
Joel de Guzman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk