Gobo Eiffel parser: indexing and assertion expressions

3 messages Options
Embed this post
Permalink
Martin Piskernig

Gobo Eiffel parser: indexing and assertion expressions

Reply Threaded More More options
Print post
Permalink
Hi!

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...

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).

btw: Is there an easy way to convert an expression to a string
representation? I would need to output assertions...

Please help! Did I miss to call some additional parsing routine?

Kind regards,
Martin

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
gobo-eiffel-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop
Eric Bezault

Re: Gobo Eiffel parser: indexing and assertion expressions

Reply Threaded More More options
Print post
Permalink
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:[hidden email]
http://www.gobosoft.com

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
gobo-eiffel-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop
Martin Piskernig

Re: Gobo Eiffel parser: indexing and assertion expressions

Reply Threaded More More options
Print post
Permalink
On Sonntag, 11. Januar 2009, Eric Bezault wrote:
> When parsing, you need to use an AST factory of type
> ET_DECORATED_AST_FACTORY instead of ET_AST_FACTORY.

That works great! Thank you very much, also for the "note"
implementation!

Kind regards,
Martin

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
gobo-eiffel-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop