From: <otm...@us...> - 2007-12-18 23:17:37
|
Revision: 3839 http://jython.svn.sourceforge.net/jython/?rev=3839&view=rev Author: otmarhumbel Date: 2007-12-18 15:17:30 -0800 (Tue, 18 Dec 2007) Log Message: ----------- really throw recognition errors (this causes junit tests to fail if they should) Modified Paths: -------------- trunk/sandbox/ast/grammar/Python.g Modified: trunk/sandbox/ast/grammar/Python.g =================================================================== --- trunk/sandbox/ast/grammar/Python.g 2007-12-18 15:52:44 UTC (rev 3838) +++ trunk/sandbox/ast/grammar/Python.g 2007-12-18 23:17:30 UTC (rev 3839) @@ -187,8 +187,28 @@ System.out.println(message); } } + + /** + * Overridden to throw an exception on a mismatched token (see p. 252) + */ + protected void mismatch(IntStream input, int ttype, BitSet follow) throws RecognitionException { + throw new MismatchedTokenException(ttype, input); + } + + /** + * Overridden to throw an exception on a mismatched token (see p. 252) + */ + public void recoverFromMismatchedSet(IntStream input, RecognitionException e, BitSet follow) throws RecognitionException { + throw e; + } } +// really throw recognition errors (see p. 252) +@rulecatch { + catch (RecognitionException e) { + throw e; + } +} @lexer::header { package org.python.antlr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |