eiffel parser (1.0) bug 
Author Message
 eiffel parser (1.0) bug

        I have found a bug in the 1.0 release of the eiffel parser  
available by anonymous ftp.  The following is reported as incorrect syntax  
when in fact it is perfectly legal.

class WINDOW
inherit
        MOVEABLE
end -- class WINDOW

The place where the parser is having trouble is with the end keyword that  
can follow the word MOVEABLE.  The following works:

class WINDOW
inherit
        MOVEABLE
        end
end -- class WINDOW

This also works:

class WINDOW
inherit
        MOVEABLE
invariant
        -- empty
end -- class WINDOW

Here is the exact output after running ep:

Analysing window.e.
  14,  1: Error       syntax error
  14,  1: Information expected tokens: ;
  14,  1: Repair      token inserted : end
0 scan error(s) occured!
1 parse error(s) occured!      
                 ^^^^^^^

Another minor point.  According to Webster's, occurred is spelled with two  
r's.

Hope this gets fixed in the next release.

Regards,
Wolfgang Ziller



Sat, 25 Jan 1997 08:51:53 GMT  
 eiffel parser (1.0) bug

Quote:

>    I have found a bug in the 1.0 release of the eiffel parser  
>available by anonymous ftp.  The following is reported as incorrect syntax  
>when in fact it is perfectly legal.

I too ran across this problem while stress testing my own parser.
This bug is a very ambiguous place in the grammar; it would be
difficult to disambiguate in a LL(1) grammar (as ep is).  I had a
rough time with it in my LR parser.

The problem is, if you see and 'end', you can't tell which construct
it belongs to, untill you see another 'end' or some other construct.

Warren
--

PGP public key availible via finger.  Use it.



Sun, 26 Jan 1997 00:27:05 GMT  
 eiffel parser (1.0) bug

           I have found a bug in the 1.0 release of the eiffel parser  
   available by anonymous ftp.  The following is reported as incorrect syntax  
   when in fact it is perfectly legal.

   Analysing window.e.
     14,  1: Error       syntax error
     14,  1: Information expected tokens: ;
     14,  1: Repair      token inserted : end
   0 scan error(s) occured!
   1 parse error(s) occured!    
                    ^^^^^^^
This will happen with ISE's compiler also.  I don't know about the
Tower one.  If you look closely at the syntax it is non-deterministic
in the area you mention.

If you put in an inheritance clause without any feature-modification
stuff and also without any feature clauses, the compiler cannot
determine when it has reached the end of the inheritance clause or
when it has reached the end of the class.

        class A
        inherit B
        end

Will not work.  You will have to put in at least one other clause
after the inherit clause for the parser to determine that it has
reached the end of the inherit clause.

        class A
        inherit B
        feature
                -- empty
        end

Will work.  Also an empty invariant clause will work (as in the
original post).  

Just a small syntax quirk.  I personally don't worry about it.  Just
put in an empty invariant or feature clause.  I don't believe the
parser can be fixed without changes in the syntax.  I like the syntax
just the way it is, even with that small problem.

Glenn Maughan.
--
Glenn Maughan ---------------------------------------------------------------
Object Technology Group, PhD Student | Ph:    +613 90-32660
Department of Software Development   | Fax:   +613 90-32745



Fri, 31 Jan 1997 19:36:17 GMT  
 eiffel parser (1.0) bug

Quote:

>Just a small syntax quirk.  I personally don't worry about it.  Just
>put in an empty invariant or feature clause.  I don't believe the
>parser can be fixed without changes in the syntax.  I like the syntax
>just the way it is, even with that small problem.

I'm surprised that ISE Eiffel displays this bug.  Fixing this
non-determinism takes a little work and makes the parser more
difficult to understand, but it is possible; you just have to flatten
a number of constructs in the language.  Took me about a week (and an
experienced parser writer could do it much faster, i'm sure...)

Warren
--

PGP public key availible via finger.  Use it.



Sat, 01 Feb 1997 01:08:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Request for ISE post of Eiffel lex/parser for Eiffel

2. S: Eiffel parser in Eiffel

3. XML 1.0 DTD parser for SPARK.

4. ANN: Yapps 1.0 (Parser generator)

5. ANNOUNCE: mkWidgets 1.3, mkHttpd 1.0, mkTulip 1.0, mkZiplib 1.0, mkGeneric 1.3

6. LORIA ANNOUNCES RELEASE 1.0 OF SMARTEIFFEL, THE GNU EIFFEL COMPILER

7. LORIA ANNOUNCES RELEASE 1.0 OF SMARTEIFFEL, THE GNU EIFFEL COMPILER

8. Eiffel parser or grammar

9. Eiffel-3 Parser Test

10. Wanted: Parser for Eiffel

11. Eiffel Parser for SourceNavigator

12. xml parser for eiffel?

 

 
Powered by phpBB® Forum Software