Re: Feature request for gobo yacc

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Organization Gobo
Message-ID <[email protected]>
Nicholas Allen wrote:
>>My biggest concern is to make sure that the generated code will not
>>be bigger or slower than now when there will be only one entry point
>>specified.
> 
> Yes that would be undesirable. But I am not sure why this would be the case 
> (though I am not familiar with the inner workings of geyacc). Surely if only 
> one entry point is defined then it would be exactly the same as it is now 
> only with certain variables renamed slightly differently. It would only be 
> bigger if there were two entry points because obviously there would be two 
> parse tables (and two of every variable that shouldn't be shared). So if only 
> one entry point then all that has happenned is a renaming of variables to 
> avoid conflicts? That's how I thought it would be implemented but like I say 
> I have little knowledge of how geyacc works...

Yes, that's what I had in mind as well. The problem it that there
is a lot of code implementing the actual parsing algorithm that
is inherited from the skeleton classes and use these variables.
I'm not ready to see geyacc duplicate this code in order to call
different variable names (currently the code is just inherited
and therefore is not known by the geyacc tool). So a solution
would be to do something like that:

   parse_expression (...) is
       do
           v := v_expression
           w := w_expression
           ...
           parse (...)
       end

where `v', `w', etc. are the variables used in the code for the
parsing algorithm. But some of these variables may be generated
as constants for example. So the Eiffel compiler can optimize
them within the code of the parsing algorithm. This would not
be possible any more because they would have to be variable
attributes (`v_expression' could be a constant, but not `v'
which is what the code of the algorithm actually see). Well,
maybe not... I could make them attributes only in the generated
code if there are more than one entry point, and make them
constants when the grammar specified makes that possible and
there is only one entre point.

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



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

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

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

<*> 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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.