[antlr-interest] MismatchedTokenException in java parsing

Terence Parr parrt at cs.usfca.edu
Sun Dec 28 08:10:40 PST 2003


Howdy...can you grab a later version of the java.g file?  I'm about to  
release 2.7.3 ANTLR which will have an updated java.g.  I see so far:

  * Version 1.21 (October 17, 2003)

Though I have some fixes to put in still.

http://www.antlr.org/grammar/java

Ter
On Saturday, December 27, 2003, at 01:56 PM, alexb577 wrote:

> Hi,
>
> I am a developer at www.argouml.org(opensource uml tool) and we use
> the java.g grammar for reverse engineering to uml. Sometimes we get
> these exceptions thrown and I hope that with the information I provide
> you can help identify the problem and what we can do to fix it.
>
> Below is the logged exception and filename it happened in, then a
> snippet from the java file itself and then a brief statement to say
> where the position of the error is.
>
> we use a modified java.g, which you can find here if it helps:
> http://argouml.tigris.org/source/browse/argouml/src_new/org/argouml/ 
> uml/reveng/java/java.g?rev=1.18&content-type=text/vnd.viewcvs-markup
>
> Also, the java files do compile.
>
> thanks in advance
> Alex
>
> --------------------------------
> ERROR: antlr.MismatchedTokenException Exception in file:
> /.../hibernate-2.1/src/net/sf/hibernate/type/TypeFactory.java
> TypeFactory.java (JavaImport.java:89)
>  WARN: exception encountered in reverese engineering
> line 43:3: expecting EOF, found 'basics' (Import.java:561)
>
> public final class TypeFactory {
> 	
> 	private static final Map BASIC_TYPES;
> 	
> 	static {
> 		HashMap basics = new HashMap();
> 		basics.put( boolean.class.getName(), Hibernate.BOOLEAN);
> 		basics.put( long.class.getName(), Hibernate.LONG);
>
> 43:3 is the start of the last line above.
>
> --------------------------------
> ERROR: antlr.MismatchedTokenException Exception in file:
> /.../org/argouml/util/LinkedHashMap.java LinkedHashMap.java
> (JavaImport.java:89)
>  WARN: exception encountered in reverese engineering
> line 345:17: expecting EOF, found 'keySet' (Import.java:561)
>
>             public void remove() {
>                 if (modCount != expectedModCount) throw new
> java.util.ConcurrentModificationException();
>                 if (!valid) throw new IllegalStateException();
>                 if (!ValuesList.super.remove(lastObject)) throw new
> java.util.ConcurrentModificationException();
>                 keySet.remove(index);
>                 entrySet.remove(index);
>                 ++modCount;
>                 ++expectedModCount;
>                 --index;
>                 valid = false;
>             }
>
> 345:17 is the position of the 'k' in 'keySet.remove(index);'
>
> --------------------------------
> ERROR: antlr.MismatchedTokenException Exception in file:
> /.../org/argouml/util/LinkedHashSet.java LinkedHashSet.java
> (JavaImport.java:89)
>  WARN: exception encountered in reverese engineering
> line 147:13: expecting EOF, found 'listIterator' (Import.java:561)
>
>         public void remove() {
>             if (!valid) throw new IllegalStateException();
>             LinkedHashSet.super.remove(lastObject);
>             listIterator.remove();
>             valid = false;
>         }
>
> 147:13 is the position of the 'L' in
> 'LinkedHashSet.super.remove(lastObject);'
>
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/antlr-interest/
>
> To unsubscribe from this group, send an email to:
>  antlr-interest-unsubscribe at yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing




 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

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




More information about the antlr-interest mailing list