Re: YY_PERSER_SKELETON.syntax_error

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Thomas Beale wrote:
> in YY_PERSER_SKELETON, the definition of syntax_error is as follows:
> 
> syntax_error: BOOLEAN is
>             -- Has last parsing been unsuccesful?
>         do
>             Result := yy_parsing_status /= yyaccepted
>         end
> 
> However, this means that syntax_error returns True even if no parsing 
> has yet been done, since just after creation, yy_parsing_status = 0, not 
> yyAccepted (I just tested this, to be sure).

I'm not sure I understand your point. The comment talks
about the "last parsing". Therefore the value is undefined
if no parsing occurred. To be more precise, the value is
only relevant after a parsing occurred. Perhaps a precondition
is missing, but there are many similar cases in EiffelBase,
such as:

    read_character
        -- Read a new character.
        -- Make result available in `last_character'.

    last_character: CHARACTER
        -- Last character read by `read_character'

Or did I miss something?

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com
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.