Re: Expressions in ET ...

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Bernd Schoeller wrote:
> Hello,
> 
> I am currently having a look at expressions generated by the Eiffel
> parsing tools (creating a processor for inferring the type for a given
> expression). For now I am stuck with a number of open cases.
> 
> Could somebody (Eric?) give an example of expressions that are of the
> following type:
> 
> ET_BRACKET_SYMBOL
> ET_PREFIX_FREE_NAME
> ET_PREFIX_NAME
> ET_ALIAS_FREE_NAME
> ET_ALIAS_NAME

I guess that all these are descendants of ET_EXPRESSION because
they are descendants fo ET_CALL_NAME which itself inherits from
ET_EXPRESSION. It would probably be better to make each descendant
of ET_CALL_NAME inherit (or not) from ET_EXPRESSION. I don't
remember why I didn't do it that way. Perhaps laziness or lack
of vision.

To my defense it should be noted that at some point it was invisioned
to allow code like this:

    a.infix "+" (b)

as an alternative for:

    a + b

Therefore the following:

    prefix "-"

would have been an expression, unless we would have required the usage
of Current:

    Current.prefix "-"

What is more questionable is that ET_OPERATOR, being an heir of
ET_CALL_NAME, is also a descendant of ET_EXPRESSION.

> ET_INFIX_CAST_EXPRESSION

If I remember correctly, with ECMA if we have something like that:

    5 + 4.0

the target is implicitly converted to the type of the argument.
Something like that:

    {REAL_64} [5] + 4.0

The new (converted) target is represented in the AST by an object
of type ET_INFIX_CAST_EXPRESSION.

> Also, I would like to know why ET_STATIC_CALL_EXPRESSION inherits from
> ET_CHOICE_CONSTANT.

I think that ISE allows code of the form:

    inspect foo
    when {WEL_CONSTANTS}.Some_constant then
         ...

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



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/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.