Re: ECF parsing issues

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> Sun, 02 Aug 2009 17:51:18 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Sitsofe Wheeler wrote:
> I've been trying to use Gobo's ECF parser but I'm find the results a bit
> unpredictable and I'm wondering if this is to be expected.

Xace is surely more robust than ECF! ;-) More seriously:

> When using the 6.3 ISE compiler and its distribution of Gobo, I have
> code that is doing roughly the following:
> 
> create l_ecf_error_handler.make_standard
> create l_ecf_parser.make ( l_ecf_error_handler )
> create a_file.make ("test.ecf")
> a_file.open_read
> l_ecf_parser.parse_file ( a_file )
> a_system := l_ecf_parser.last_system
> a_system.activate_processors
> a_system.preparse_local

You should call 'a_system.preparse' here. Otherwise the classes from
EiffelBase will not be preparsed, and hence will not be known by
`a_system'.

In order to let Gobo report error messages, one thing that I want to
suggest is that you inherit from UT_SHARED_ISE_VERSIONS and you call:

   a_system.set_ise_version (ise_6_3_latest)
   a_system.error_handler.set_ise

Doing so, you would have gotten the following message:

[VHAY] class UC_SHARED_STRING_EQUALITY_TESTER: implicitly inherits from 
unknown class ANY.

> a_class := a_system.class_by_name ( "TEST" )
> a_class.process ( a_system.interface_checker )
> a_class.process ( a_system.implementation_checker )
> io.put_string ( a_class.out )

[...]

> One other thing I noticed were lots of
> Catcall detected in {PROCEDURE}.call for arg#1: expected TUPLE [ET_ECF_CLUSTER] but got TUPLE [ET_CLUSTER]
> messages just after startup when using the ISE compiler with debugging
> on

This is a bug in EiffelStudio. There is no CAT-call here.

> and it ran very slowly)

It's because you execute with all assertions enabled. If you
disable them it will run much faster.

> Is there a magic ECF -> XACE converter or is
> this just the way things are because there are multiple standards?

Contrary to EiffelStudio which had decided to have an internal
conversion from Ace to ECF, there is no conversion in Gobo. All
Ace, Xace and ECF files are interpreted natively.

> I guess a related question could be - is it possible to programmaticly
> tell Gobo where to parse all the typical libraries and just parse files
> without restarting?

There is some rudimentary incrementality in Gobo. After you made some
changes to your classes or added some classes to existing clusters,
you can call `a_system.preparse' again. The modifications should be
detected in an incremental manner. You will then need to call
`a_class.process (...)' again  in order to take these modifications
into account. Only the necessary parts of the processing will be
redone. Note though that the ECF file will not be parsed again.
So any modification in this file will not be taken into account.

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com


------------------------------------

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected]! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gobo-eiffel/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/