Martin Piskernig wrote:
> I have another question (I just started to use the Gobo Eiffel parser
> some days ago, please be patient with me...).
>
> Why is ET_CLASS.first_indexing and ET_FEATURE.first_indexing always
> Void? Did I forget to do some parsing? The classes and features
> themselves all show and can be processed nicely, only they seem to have
> absolutely no indexing...
When parsing, you need to use an AST factory of type
ET_DECORATED_AST_FACTORY instead of ET_AST_FACTORY.
> The same is true for assertion expressions, be it preconditions,
> postconditions or invariants: ET_ASSERTION.expression is always Void
> (on the other hand, i can use ET_TAGGED_ASSERTION.tag without
> problems).
Because of ambiguities in the syntax, it is possible that
an assertion of the type:
tag: expression
ends up in the AST as two assertions nodes: one the tag
and one for the expression.
> btw: Is there an easy way to convert an expression to a string
> representation? I would need to output assertions...
If you used ET_DECORATED_AST_FACTORY with `keep_all_breaks'
set to True, then you can use ET_AST_PRINTER to print the node
as it was in the text file. Otherwise, you can also use
ET_AST_PRETTY_PRINTER, or inherit from one of those to
customize your own printer.
--
Eric Bezault
mailto:er...@go...
http://www.gobosoft.com
|