[e-cvs] cvs commit: e/src/jsrc/antlr/preprocessor Grammar.java GrammarFile.java Hierarchy.java Option.java Preprocessor.java PreprocessorLexer.java Rule.java Tool.java

markm@eros.cs.jhu.edu markm@eros.cs.jhu.edu
Thu, 29 Nov 2001 15:33:30 -0500


markm       01/11/29 15:33:30

  Modified:    src/jsrc/antlr ANTLRError.java ANTLRHashString.java
                        ANTLRLexer.java ANTLRParser.java
                        ANTLRTokdefLexer.java ANTLRTokdefParser.java
                        ANTLRTokdefParserTokenTypes.java ASTFactory.java
                        ASTIterator.java ASTNULLType.java Alternative.java
                        AlternativeBlock.java BaseAST.java ByteBuffer.java
                        CharBuffer.java CharQueue.java
                        CharRangeElement.java CharScanner.java
                        CodeGenerator.java CommonAST.java
                        CommonASTWithHiddenTokens.java
                        CommonHiddenStreamToken.java CommonToken.java
                        CppCodeGenerator.java DefaultToolErrorHandler.java
                        DefineGrammarSymbols.java
                        DiagnosticCodeGenerator.java DumpASTVisitor.java
                        FileCopyException.java FileLineFormatter.java
                        Grammar.java GrammarAnalyzer.java GrammarAtom.java
                        HTMLCodeGenerator.java ImportVocabTokenManager.java
                        InputBuffer.java JavaBlockFinishingInfo.java
                        JavaCodeGenerator.java LLkAnalyzer.java
                        LLkParser.java LexerGrammar.java
                        LexerSharedInputState.java Lookahead.java
                        MakeGrammar.java MismatchedTokenException.java
                        NameSpace.java Parser.java ParserGrammar.java
                        RuleBlock.java RuleRefElement.java RuleSymbol.java
                        SatherBlockFinishingInfo.java
                        SatherCharFormatter.java SatherCodeGenerator.java
                        SimpleTokenManager.java Token.java TokenBuffer.java
                        TokenManager.java TokenQueue.java
                        TokenRangeElement.java
                        TokenStreamHiddenTokenFilter.java
                        TokenStreamSelector.java Tool.java
                        ToolErrorHandler.java TreeParser.java
                        TreeWalkerGrammar.java WildcardElement.java
               src/jsrc/antlr/actions/cpp ActionLexer.java
               src/jsrc/antlr/actions/java ActionLexer.java
               src/jsrc/antlr/actions/sather ActionLexer.java
               src/jsrc/antlr/collections/impl ASTEnumerator.java
                        BitSet.java IndexedVector.java LLEnumeration.java
                        LList.java Vector.java VectorEnumeration.java
                        VectorEnumerator.java
               src/jsrc/antlr/debug DebuggingCharScanner.java
                        DebuggingInputBuffer.java InputBufferEvent.java
                        InputBufferEventSupport.java
                        LLkDebuggingParser.java ParserEventSupport.java
                        ParserListener.java ParserMatchEvent.java
                        ParserTokenEvent.java SemanticPredicateEvent.java
                        TraceEvent.java
               src/jsrc/antlr/debug/misc ASTFrame.java JTreeASTModel.java
                        JTreeASTPanel.java
               src/jsrc/antlr/preprocessor Grammar.java GrammarFile.java
                        Hierarchy.java Option.java Preprocessor.java
                        PreprocessorLexer.java Rule.java Tool.java
  Log:
  removed unnecessary imports

Revision  Changes    Path
1.4       +3 -3      e/src/jsrc/antlr/ANTLRError.java

Index: ANTLRError.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRError.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRError.java	2001/10/26 03:08:50	1.3
+++ ANTLRError.java	2001/11/29 20:33:25	1.4
@@ -4,18 +4,18 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ANTLRError.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ANTLRError.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 public class ANTLRError extends Error {
-    
+
     /**
      * ANTLRError constructor comment.
      */
     public ANTLRError() {
 	super();
     }
-    
+
     /**
      * ANTLRError constructor comment.
      * @param s java.lang.String



1.4       +3 -3      e/src/jsrc/antlr/ANTLRHashString.java

Index: ANTLRHashString.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRHashString.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRHashString.java	2001/10/26 03:08:50	1.3
+++ ANTLRHashString.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ANTLRHashString.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ANTLRHashString.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 // class implements a String-like object whose sole purpose is to be
@@ -40,14 +40,14 @@
 		if (!(o instanceof ANTLRHashString) && !(o instanceof String)) {
 			return false;
 		}
-		
+
 		ANTLRHashString s;
 		if ( o instanceof String ) {
 			s = new ANTLRHashString((String)o,lexer);
 		}
 		else {
 			s = (ANTLRHashString)o;
-		}	
+		}
 		int l = length();
 		if (s.length() != l) {
 			return false;



1.4       +110 -128  e/src/jsrc/antlr/ANTLRLexer.java

Index: ANTLRLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRLexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRLexer.java	2001/10/26 03:08:50	1.3
+++ ANTLRLexer.java	2001/11/29 20:33:25	1.4
@@ -2,29 +2,11 @@
 
 package antlr;
 
+import antlr.collections.impl.BitSet;
+
 import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
-import antlr.CharStreamException;
-import antlr.CharStreamIOException;
-import antlr.ANTLRException;
 import java.io.Reader;
 import java.util.Hashtable;
-import antlr.CharScanner;
-import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
-import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
-import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
-import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
 
 public class ANTLRLexer extends antlr.CharScanner implements ANTLRTokenTypes, TokenStream
  {
@@ -81,7 +63,7 @@
 			return 0;
 		}
 	}
-	
+
 	public static int tokenTypeForCharLiteral(String lit) {
 		if ( lit.length()>3 ) {  // does char contain escape?
 			return escapeCharValue(lit);
@@ -343,7 +325,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case ' ':
@@ -392,13 +374,13 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMENT;
 		int _saveIndex;
 		Token t=null;
-		
+
 		{
 		if ((LA(1)=='/') && (LA(2)=='/')) {
 			mSL_COMMENT(false);
@@ -413,7 +395,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		if ( inputState.guessing==0 ) {
 			if ( _ttype != DOC_COMMENT ) _ttype = Token.SKIP;
@@ -424,12 +406,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SL_COMMENT;
 		int _saveIndex;
-		
+
 		match("//");
 		{
 		_loop153:
@@ -442,7 +424,7 @@
 			else {
 				break _loop153;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -459,7 +441,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		if ( inputState.guessing==0 ) {
 			newline();
@@ -470,12 +452,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ML_COMMENT;
 		int _saveIndex;
-		
+
 		match("/*");
 		{
 		if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '~')))&&( LA(2)!='/' )) {
@@ -489,7 +471,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		{
 		_loop159:
@@ -523,7 +505,7 @@
 			else {
 				break _loop159;
 			}
-			
+
 		} while (true);
 		}
 		match("*/");
@@ -533,12 +515,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mOPEN_ELEMENT_OPTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = OPEN_ELEMENT_OPTION;
 		int _saveIndex;
-		
+
 		match('<');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -546,12 +528,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCLOSE_ELEMENT_OPTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CLOSE_ELEMENT_OPTION;
 		int _saveIndex;
-		
+
 		match('>');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -559,12 +541,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMA;
 		int _saveIndex;
-		
+
 		match(',');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -572,12 +554,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = QUESTION;
 		int _saveIndex;
-		
+
 		match('?');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -585,12 +567,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mTREE_BEGIN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TREE_BEGIN;
 		int _saveIndex;
-		
+
 		match("#(");
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -598,12 +580,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = LPAREN;
 		int _saveIndex;
-		
+
 		match('(');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -611,12 +593,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RPAREN;
 		int _saveIndex;
-		
+
 		match(')');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -624,12 +606,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COLON;
 		int _saveIndex;
-		
+
 		match(':');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -637,12 +619,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STAR;
 		int _saveIndex;
-		
+
 		match('*');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -650,12 +632,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = PLUS;
 		int _saveIndex;
-		
+
 		match('+');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -663,12 +645,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ASSIGN;
 		int _saveIndex;
-		
+
 		match('=');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -676,12 +658,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mIMPLIES(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = IMPLIES;
 		int _saveIndex;
-		
+
 		match("=>");
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -689,12 +671,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SEMI;
 		int _saveIndex;
-		
+
 		match(';');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -702,12 +684,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCARET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CARET;
 		int _saveIndex;
-		
+
 		match('^');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -715,12 +697,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mBANG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = BANG;
 		int _saveIndex;
-		
+
 		match('!');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -728,12 +710,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = OR;
 		int _saveIndex;
-		
+
 		match('|');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -741,12 +723,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mWILDCARD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WILDCARD;
 		int _saveIndex;
-		
+
 		match('.');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -754,12 +736,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mRANGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RANGE;
 		int _saveIndex;
-		
+
 		match("..");
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -767,12 +749,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mNOT_OP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = NOT_OP;
 		int _saveIndex;
-		
+
 		match('~');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -780,12 +762,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RCURLY;
 		int _saveIndex;
-		
+
 		match('}');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -793,12 +775,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CHAR_LITERAL;
 		int _saveIndex;
-		
+
 		match('\'');
 		{
 		switch ( LA(1)) {
@@ -855,12 +837,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ESC;
 		int _saveIndex;
-		
+
 		match('\\');
 		{
 		switch ( LA(1)) {
@@ -933,7 +915,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
@@ -941,7 +923,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -961,7 +943,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -986,12 +968,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STRING_LITERAL;
 		int _saveIndex;
-		
+
 		match('"');
 		{
 		_loop184:
@@ -1051,12 +1033,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mXDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = XDIGIT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '0':  case '1':  case '2':  case '3':
 		case '4':  case '5':  case '6':  case '7':
@@ -1088,12 +1070,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = DIGIT;
 		int _saveIndex;
-		
+
 		matchRange('0','9');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1101,12 +1083,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mVOCAB(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = VOCAB;
 		int _saveIndex;
-		
+
 		matchRange('\3','\176');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1114,12 +1096,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt199=0;
 		_loop199:
@@ -1130,7 +1112,7 @@
 			else {
 				if ( _cnt199>=1 ) { break _loop199; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt199++;
 		} while (true);
 		}
@@ -1140,12 +1122,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mARG_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ARG_ACTION;
 		int _saveIndex;
-		
+
 		mNESTED_ARG_ACTION(false);
 		if ( inputState.guessing==0 ) {
 			setText(Tool.stripFrontBack(getText(), "[", "]"));
@@ -1156,12 +1138,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mNESTED_ARG_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = NESTED_ARG_ACTION;
 		int _saveIndex;
-		
+
 		match('[');
 		{
 		_loop203:
@@ -1251,13 +1233,13 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ACTION;
 		int _saveIndex;
 		int actionLine=getLine();
-		
+
 		mNESTED_ACTION(false);
 		{
 		if ((LA(1)=='?')) {
@@ -1268,10 +1250,10 @@
 		}
 		else {
 		}
-		
+
 		}
 		if ( inputState.guessing==0 ) {
-			
+
 						if ( _ttype==ACTION ) {
 							setText(Tool.stripFrontBack(getText(), "{", "}"));
 						}
@@ -1281,7 +1263,7 @@
 						CommonToken t = new CommonToken(_ttype,new String(text.getBuffer(),_begin,text.length()-_begin));
 						t.setLine(actionLine);	// set action line to start
 						_token = t;
-					
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1289,12 +1271,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mNESTED_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = NESTED_ACTION;
 		int _saveIndex;
-		
+
 		match('{');
 		{
 		_loop209:
@@ -1325,7 +1307,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if ((LA(1)=='{') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
@@ -1346,7 +1328,7 @@
 			else {
 				break _loop209;
 			}
-			
+
 		} while (true);
 		}
 		match('}');
@@ -1356,12 +1338,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mTOKEN_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TOKEN_REF;
 		int _saveIndex;
-		
+
 		matchRange('A','Z');
 		{
 		_loop212:
@@ -1415,15 +1397,15 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mRULE_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RULE_REF;
 		int _saveIndex;
-		
+
 			int t=0;
-		
-		
+
+
 		t=mINTERNAL_RULE_REF(false);
 		if ( inputState.guessing==0 ) {
 			_ttype=t;
@@ -1440,7 +1422,7 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else if (true&&(t==LITERAL_tokens)) {
@@ -1454,12 +1436,12 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else {
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1467,16 +1449,16 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final int  mINTERNAL_RULE_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int t;
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INTERNAL_RULE_REF;
 		int _saveIndex;
-		
+
 			t = RULE_REF;
-		
-		
+
+
 		matchRange('a','z');
 		{
 		_loop222:
@@ -1533,12 +1515,12 @@
 		_returnToken = _token;
 		return t;
 	}
-	
+
 	protected final void mWS_LOOP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS_LOOP;
 		int _saveIndex;
-		
+
 		{
 		_loop219:
 		do {
@@ -1566,19 +1548,19 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mWS_OPT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS_OPT;
 		int _saveIndex;
-		
+
 		{
 		if ((_tokenSet_2.member(LA(1)))) {
 			mWS(false);
 		}
 		else {
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1586,12 +1568,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mNOT_USEFUL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = NOT_USEFUL;
 		int _saveIndex;
-		
+
 		boolean synPredMatched227 = false;
 		if (((LA(1)=='a') && (true))) {
 			int _m227 = mark();
@@ -1617,20 +1599,20 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
-	
+
+
 	private static final long _tokenSet_0_data_[] = { -9224L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { -549755813896L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
 	private static final long _tokenSet_2_data_[] = { 4294977024L, 0L, 0L };
 	public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
-	
+
 	}



1.4       +195 -216  e/src/jsrc/antlr/ANTLRParser.java

Index: ANTLRParser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRParser.java	2001/10/26 03:08:50	1.3
+++ ANTLRParser.java	2001/11/29 20:33:25	1.4
@@ -2,28 +2,7 @@
 
 package antlr;
 
-import antlr.TokenBuffer;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.ANTLRException;
-import antlr.LLkParser;
-import antlr.Token;
-import antlr.TokenStream;
-import antlr.RecognitionException;
-import antlr.NoViableAltException;
-import antlr.MismatchedTokenException;
-import antlr.SemanticException;
-import antlr.ParserSharedInputState;
 import antlr.collections.impl.BitSet;
-import antlr.collections.AST;
-import antlr.ASTPair;
-import antlr.collections.impl.ASTArray;
-
-import java.util.Enumeration;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
 
 public class ANTLRParser extends antlr.LLkParser
        implements ANTLRTokenTypes
@@ -36,7 +15,7 @@
 	protected int blockNesting= -1;
 
 	public ANTLRParser(
-		TokenBuffer tokenBuf, 
+		TokenBuffer tokenBuf,
 		ANTLRGrammarParseBehavior behavior_,
 		Tool tool_
 	) {
@@ -83,10 +62,10 @@
 }
 
 	public final void grammar() throws RecognitionException, TokenStreamException {
-		
+
 		Token  n = null;
 		Token  h = null;
-		
+
 		try {      // for error handling
 			{
 			_loop4:
@@ -120,7 +99,7 @@
 				else {
 					break _loop4;
 				}
-				
+
 			} while (true);
 			}
 			{
@@ -153,27 +132,27 @@
 				else {
 					break _loop7;
 				}
-				
+
 			} while (true);
 			}
 			match(Token.EOF_TYPE);
 		}
 		catch (RecognitionException ex) {
 			if (inputState.guessing==0) {
-				
+
 						reportError("rule grammar trapped: "+ex.toString());
 						consumeUntil(EOF);
-					
+
 			} else {
 				throw ex;
 			}
 		}
 	}
-	
+
 	public final void fileOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value;
-		
+
 		match(OPTIONS);
 		{
 		_loop18:
@@ -190,18 +169,18 @@
 			else {
 				break _loop18;
 			}
-			
+
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 	public final void classDef() throws RecognitionException, TokenStreamException {
-		
+
 		Token  a = null;
 		Token  d = null;
 		String doc=null;
-		
+
 		try {      // for error handling
 			{
 			switch ( LA(1)) {
@@ -324,7 +303,7 @@
 			}
 			catch (RecognitionException ex) {
 				if (inputState.guessing==0) {
-					
+
 							if ( ex instanceof NoViableAltException ) {
 								NoViableAltException e = (NoViableAltException)ex;
 								if ( e.token.getType()==DOC_COMMENT ) {
@@ -350,20 +329,20 @@
 									break;
 								}
 							}
-						
+
 				} else {
 					throw ex;
 				}
 			}
 		}
-		
+
 	public final  Token  id() throws RecognitionException, TokenStreamException {
 		 Token idTok ;
-		
+
 		Token  a = null;
 		Token  b = null;
 		idTok = null;
-		
+
 		switch ( LA(1)) {
 		case TOKEN_REF:
 		{
@@ -390,18 +369,18 @@
 		}
 		return idTok ;
 	}
-	
+
 	public final void lexerSpec(
 		String doc
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  lc = null;
 		Token  a = null;
-		
+
 			Token idTok;
 			String sup=null;
-		
-		
+
+
 		{
 		switch ( LA(1)) {
 		case LITERAL_lexclass:
@@ -526,17 +505,17 @@
 		}
 		}
 	}
-	
+
 	public final void treeParserSpec(
 		String doc
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  a = null;
-		
+
 			Token idTok;
 			String sup=null;
-		
-		
+
+
 		match(LITERAL_class);
 		idTok=id();
 		match(LITERAL_extends);
@@ -639,17 +618,17 @@
 		}
 		}
 	}
-	
+
 	public final void parserSpec(
 		String doc
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  a = null;
-		
+
 			Token idTok;
 			String sup=null;
-		
-		
+
+
 		match(LITERAL_class);
 		idTok=id();
 		{
@@ -680,10 +659,10 @@
 		case SEMI:
 		{
 			if ( inputState.guessing==0 ) {
-				
+
 							System.out.println("warning: line " +
 								idTok.getLine() + ": use 'class X extends Parser'");
-							
+
 			}
 			break;
 		}
@@ -774,10 +753,10 @@
 		}
 		}
 	}
-	
+
 	public final void rules() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 		{
 		int _cnt68=0;
 		_loop68:
@@ -788,20 +767,20 @@
 			else {
 				if ( _cnt68>=1 ) { break _loop68; } else {throw new NoViableAltException(LT(1), getFilename());}
 			}
-			
+
 			_cnt68++;
 		} while (true);
 		}
 	}
-	
+
 	public final  Token  optionValue() throws RecognitionException, TokenStreamException {
 		 Token retval ;
-		
+
 		Token  sl = null;
 		Token  cl = null;
 		Token  il = null;
 		retval = null;
-		
+
 		switch ( LA(1)) {
 		case TOKEN_REF:
 		case RULE_REF:
@@ -843,11 +822,11 @@
 		}
 		return retval ;
 	}
-	
+
 	public final void parserOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value;
-		
+
 		match(OPTIONS);
 		{
 		_loop21:
@@ -864,16 +843,16 @@
 			else {
 				break _loop21;
 			}
-			
+
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 	public final void treeParserOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value;
-		
+
 		match(OPTIONS);
 		{
 		_loop24:
@@ -890,16 +869,16 @@
 			else {
 				break _loop24;
 			}
-			
+
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 	public final void lexerOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value; BitSet b;
-		
+
 		match(OPTIONS);
 		{
 		_loop27:
@@ -937,15 +916,15 @@
 		}
 		match(RCURLY);
 	}
-	
+
 	public final  BitSet  charSet() throws RecognitionException, TokenStreamException {
 		 BitSet b ;
-		
-		
-			b = null; 
+
+
+			b = null;
 			BitSet tmpSet = null;
-		
-		
+
+
 		b=setBlockElement();
 		{
 		_loop34:
@@ -960,16 +939,16 @@
 			else {
 				break _loop34;
 			}
-			
+
 		} while (true);
 		}
 		return b ;
 	}
-	
+
 	public final void subruleOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value;
-		
+
 		match(OPTIONS);
 		{
 		_loop30:
@@ -986,23 +965,23 @@
 			else {
 				break _loop30;
 			}
-			
+
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 /** Match a.b.c.d qualified ids; WILDCARD here is overloaded as
  *  id separator; that is, I need a reference to the '.' token.
  */
 	public final Token  qualifiedID() throws RecognitionException, TokenStreamException {
 		Token qidTok=null;
-		
-		
+
+
 			StringBuffer buf = new StringBuffer(30);
 			Token a;
-		
-		
+
+
 		a=id();
 		if ( inputState.guessing==0 ) {
 			buf.append(a.getText());
@@ -1020,37 +999,37 @@
 			else {
 				break _loop144;
 			}
-			
+
 		} while (true);
 		}
 		if ( inputState.guessing==0 ) {
-			
+
 					 // can use either TOKEN_REF or RULE_REF; should
 					 // really create a QID or something instead.
 					 qidTok = new CommonToken(TOKEN_REF, buf.toString());
 					 qidTok.setLine(a.getLine());
-					
+
 		}
 		return qidTok;
 	}
-	
+
 	public final  BitSet  setBlockElement() throws RecognitionException, TokenStreamException {
 		 BitSet b ;
-		
+
 		Token  c1 = null;
 		Token  c2 = null;
-		
+
 			b = null;
-			int rangeMin = 0; 
-		
-		
+			int rangeMin = 0;
+
+
 		c1 = LT(1);
 		match(CHAR_LITERAL);
 		if ( inputState.guessing==0 ) {
-			
-					rangeMin = ANTLRLexer.tokenTypeForCharLiteral(c1.getText()); 
+
+					rangeMin = ANTLRLexer.tokenTypeForCharLiteral(c1.getText());
 					b = BitSet.of(rangeMin);
-				
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1060,15 +1039,15 @@
 			c2 = LT(1);
 			match(CHAR_LITERAL);
 			if ( inputState.guessing==0 ) {
-				
-							int rangeMax = ANTLRLexer.tokenTypeForCharLiteral(c2.getText()); 
+
+							int rangeMax = ANTLRLexer.tokenTypeForCharLiteral(c2.getText());
 							if (rangeMax < rangeMin) {
 								tool.error("Malformed range line "+c1.getLine());
 							}
 							for (int i = rangeMin+1; i <= rangeMax; i++) {
 								b.add(i);
 							}
-						
+
 			}
 			break;
 		}
@@ -1085,13 +1064,13 @@
 		}
 		return b ;
 	}
-	
+
 	public final void tokensSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token  t1 = null;
 		Token  s1 = null;
 		Token  s3 = null;
-		
+
 		match(TOKENS);
 		{
 		int _cnt43=0;
@@ -1186,21 +1165,21 @@
 			else {
 				if ( _cnt43>=1 ) { break _loop43; } else {throw new NoViableAltException(LT(1), getFilename());}
 			}
-			
+
 			_cnt43++;
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 	public final void tokensSpecOptions(
 		Token t
 	) throws RecognitionException, TokenStreamException {
-		
-		
+
+
 			Token o=null, v=null;
-		
-		
+
+
 		match(OPEN_ELEMENT_OPTION);
 		o=id();
 		match(ASSIGN);
@@ -1223,17 +1202,17 @@
 			else {
 				break _loop46;
 			}
-			
+
 		} while (true);
 		}
 		match(CLOSE_ELEMENT_OPTION);
 	}
-	
+
 	public final String  superClass() throws RecognitionException, TokenStreamException {
 		String sup;
-		
+
 		sup=null;
-		
+
 		match(LPAREN);
 		if ( inputState.guessing==0 ) {
 			sup = LT(1).getText();
@@ -1259,9 +1238,9 @@
 		match(RPAREN);
 		return sup;
 	}
-	
+
 	public final void rule() throws RecognitionException, TokenStreamException {
-		
+
 		Token  d = null;
 		Token  p1 = null;
 		Token  p2 = null;
@@ -1269,14 +1248,14 @@
 		Token  aa = null;
 		Token  rt = null;
 		Token  a = null;
-		
-			String access="public"; 
+
+			String access="public";
 			Token idTok;
 			String doc=null;
 			boolean ruleAutoGen = true;
 			blockNesting = -1;	// block increments, so -1 to make rule at level 0
-		
-		
+
+
 		{
 		switch ( LA(1)) {
 		case DOC_COMMENT:
@@ -1369,9 +1348,9 @@
 		}
 		}
 		if ( inputState.guessing==0 ) {
-			
+
 					behavior.defineRuleName(idTok, access, ruleAutoGen, doc);
-				
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1514,14 +1493,14 @@
 			behavior.endRule(idTok.getText());
 		}
 	}
-	
+
 	public final void throwsSpec() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 			String t=null;
 			Token a,b;
-		
-		
+
+
 		match(LITERAL_throws);
 		a=id();
 		if ( inputState.guessing==0 ) {
@@ -1540,18 +1519,18 @@
 			else {
 				break _loop84;
 			}
-			
+
 		} while (true);
 		}
 		if ( inputState.guessing==0 ) {
-			behavior.setUserExceptions(t);	
+			behavior.setUserExceptions(t);
 		}
 	}
-	
+
 	public final void ruleOptionsSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token idTok; Token value;
-		
+
 		match(OPTIONS);
 		{
 		_loop81:
@@ -1568,15 +1547,15 @@
 			else {
 				break _loop81;
 			}
-			
+
 		} while (true);
 		}
 		match(RCURLY);
 	}
-	
+
 	public final void block() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 		if ( inputState.guessing==0 ) {
 			blockNesting++;
 		}
@@ -1591,17 +1570,17 @@
 			else {
 				break _loop87;
 			}
-			
+
 		} while (true);
 		}
 		if ( inputState.guessing==0 ) {
 			blockNesting--;
 		}
 	}
-	
+
 	public final void exceptionGroup() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 		if ( inputState.guessing==0 ) {
 			behavior.beginExceptionGroup();
 		}
@@ -1615,7 +1594,7 @@
 			else {
 				if ( _cnt95>=1 ) { break _loop95; } else {throw new NoViableAltException(LT(1), getFilename());}
 			}
-			
+
 			_cnt95++;
 		} while (true);
 		}
@@ -1623,11 +1602,11 @@
 			behavior.endExceptionGroup();
 		}
 	}
-	
+
 	public final void alternative() throws RecognitionException, TokenStreamException {
-		
+
 		boolean altAutoGen = true;
-		
+
 		{
 		switch ( LA(1)) {
 		case BANG:
@@ -1673,7 +1652,7 @@
 			else {
 				break _loop91;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -1699,10 +1678,10 @@
 			behavior.endAlt();
 		}
 	}
-	
+
 	public final void element() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 		elementNoOptionSpec();
 		{
 		switch ( LA(1)) {
@@ -1735,10 +1714,10 @@
 		}
 		}
 	}
-	
+
 	public final void exceptionSpecNoLabel() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 		match(LITERAL_exception);
 		if ( inputState.guessing==0 ) {
 			behavior.beginExceptionSpec(null);
@@ -1752,19 +1731,19 @@
 			else {
 				break _loop102;
 			}
-			
+
 		} while (true);
 		}
 		if ( inputState.guessing==0 ) {
 			behavior.endExceptionSpec();
 		}
 	}
-	
+
 	public final void exceptionSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token  aa = null;
 		Token labelAction = null;
-		
+
 		match(LITERAL_exception);
 		{
 		switch ( LA(1)) {
@@ -1810,20 +1789,20 @@
 			else {
 				break _loop99;
 			}
-			
+
 		} while (true);
 		}
 		if ( inputState.guessing==0 ) {
 			behavior.endExceptionSpec();
 		}
 	}
-	
+
 	public final void exceptionHandler() throws RecognitionException, TokenStreamException {
-		
+
 		Token  a1 = null;
 		Token  a2 = null;
 		Token exType; Token exName;
-		
+
 		match(LITERAL_catch);
 		a1 = LT(1);
 		match(ARG_ACTION);
@@ -1833,9 +1812,9 @@
 			behavior.refExceptionHandler(a1, a2);
 		}
 	}
-	
+
 	public final void elementNoOptionSpec() throws RecognitionException, TokenStreamException {
-		
+
 		Token  rr = null;
 		Token  aa = null;
 		Token  tr = null;
@@ -1844,13 +1823,13 @@
 		Token  aa3 = null;
 		Token  a = null;
 		Token  p = null;
-		
-			Token label = null; 
-			Token assignId = null; 
-			Token args = null; 
+
+			Token label = null;
+			Token assignId = null;
+			Token args = null;
 			int autoGen = GrammarElement.AUTO_GEN_NONE;
-		
-		
+
+
 		switch ( LA(1)) {
 		case ACTION:
 		{
@@ -1892,7 +1871,7 @@
 				else {
 					throw new NoViableAltException(LT(1), getFilename());
 				}
-				
+
 				}
 				{
 				switch ( LA(1)) {
@@ -2040,7 +2019,7 @@
 				else {
 					throw new NoViableAltException(LT(1), getFilename());
 				}
-				
+
 				}
 				{
 				switch ( LA(1)) {
@@ -2170,13 +2149,13 @@
 		}
 		}
 	}
-	
+
 	public final void elementOptionSpec() throws RecognitionException, TokenStreamException {
-		
-		
+
+
 			Token o=null, v=null;
-		
-		
+
+
 		match(OPEN_ELEMENT_OPTION);
 		o=id();
 		match(ASSIGN);
@@ -2199,28 +2178,28 @@
 			else {
 				break _loop108;
 			}
-			
+
 		} while (true);
 		}
 		match(CLOSE_ELEMENT_OPTION);
 	}
-	
+
 	public final void range(
-		 Token label 
+		 Token label
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  crLeft = null;
 		Token  crRight = null;
 		Token  t = null;
 		Token  u = null;
 		Token  v = null;
 		Token  w = null;
-		
+
 			Token trLeft=null;
 			Token trRight=null;
 			int autoGen=GrammarElement.AUTO_GEN_NONE;
-		
-		
+
+
 		switch ( LA(1)) {
 		case CHAR_LITERAL:
 		{
@@ -2336,21 +2315,21 @@
 		}
 		}
 	}
-	
+
 	public final void terminal(
-		 Token label 
+		 Token label
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  cl = null;
 		Token  tr = null;
 		Token  aa = null;
 		Token  sl = null;
 		Token  wi = null;
-		
+
 			int autoGen=GrammarElement.AUTO_GEN_NONE;
 			Token args=null;
-		
-		
+
+
 		switch ( LA(1)) {
 		case CHAR_LITERAL:
 		{
@@ -2466,15 +2445,15 @@
 		}
 		}
 	}
-	
+
 	public final void notTerminal(
-		 Token label 
+		 Token label
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  cl = null;
 		Token  tr = null;
 		int autoGen=GrammarElement.AUTO_GEN_NONE;
-		
+
 		switch ( LA(1)) {
 		case CHAR_LITERAL:
 		{
@@ -2535,15 +2514,15 @@
 		}
 		}
 	}
-	
+
 	public final void ebnf(
-		 Token label, boolean not 
+		 Token label, boolean not
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  lp = null;
 		Token  aa = null;
 		Token  ab = null;
-		
+
 		lp = LT(1);
 		match(LPAREN);
 		if ( inputState.guessing==0 ) {
@@ -2588,7 +2567,7 @@
 		else {
 			throw new NoViableAltException(LT(1), getFilename());
 		}
-		
+
 		}
 		block();
 		match(RPAREN);
@@ -2719,11 +2698,11 @@
 			behavior.endSubRule();
 		}
 	}
-	
+
 	public final void tree() throws RecognitionException, TokenStreamException {
-		
+
 		Token  lp = null;
-		
+
 		lp = LT(1);
 		match(TREE_BEGIN);
 		if ( inputState.guessing==0 ) {
@@ -2743,7 +2722,7 @@
 			else {
 				if ( _cnt122>=1 ) { break _loop122; } else {throw new NoViableAltException(LT(1), getFilename());}
 			}
-			
+
 			_cnt122++;
 		} while (true);
 		}
@@ -2755,11 +2734,11 @@
 			behavior.endTree();
 		}
 	}
-	
+
 	public final void rootNode() throws RecognitionException, TokenStreamException {
-		
+
 		Token label = null;
-		
+
 		{
 		if ((LA(1)==TOKEN_REF||LA(1)==RULE_REF) && (LA(2)==COLON)) {
 			label=id();
@@ -2773,16 +2752,16 @@
 		else {
 			throw new NoViableAltException(LT(1), getFilename());
 		}
-		
+
 		}
 		terminal(label);
 	}
-	
+
 	public final  int  ast_type_spec() throws RecognitionException, TokenStreamException {
 		 int autoGen ;
-		
+
 		autoGen = GrammarElement.AUTO_GEN_NONE;
-		
+
 		{
 		switch ( LA(1)) {
 		case CARET:
@@ -2828,8 +2807,8 @@
 		}
 		return autoGen ;
 	}
-	
-	
+
+
 	public static final String[] _tokenNames = {
 		"<0>",
 		"EOF",
@@ -2898,7 +2877,7 @@
 		"WS_OPT",
 		"NOT_USEFUL"
 	};
-	
+
 	private static final long _tokenSet_0_data_[] = { 15317598464L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { 547893559424L, 0L };
@@ -2923,5 +2902,5 @@
 	public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
 	private static final long _tokenSet_11_data_[] = { 1719688145404096L, 0L };
 	public static final BitSet _tokenSet_11 = new BitSet(_tokenSet_11_data_);
-	
+
 	}



1.4       +27 -42    e/src/jsrc/antlr/ANTLRTokdefLexer.java

Index: ANTLRTokdefLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRTokdefLexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRTokdefLexer.java	2001/10/26 03:08:50	1.3
+++ ANTLRTokdefLexer.java	2001/11/29 20:33:25	1.4
@@ -2,38 +2,23 @@
 
 /*
  * ANTLR-generated file resulting from grammar tokdef.g
- * 
+ *
  * Terence Parr, MageLang Institute
  * ANTLR Version 2.7.0a2; 1989-1999
  */
- import java.io.InputStream;
+import antlr.collections.impl.BitSet;
+
+import java.io.InputStream;
 import java.io.Reader;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.CharStreamException;
-import antlr.CharStreamIOException;
 import java.util.Hashtable;
-import antlr.CharScanner;
-import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
-import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
-import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
-import antlr.collections.impl.BitSet;
 public class ANTLRTokdefLexer extends antlr.CharScanner implements ANTLRTokdefParserTokenTypes, TokenStream
  {
 	private static final long _tokenSet_0_data_[] = { -9224L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { -140737488355336L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
-	
-	
+
+
 public ANTLRTokdefLexer(InputBuffer ib) {
 	this(new LexerSharedInputState(ib));
 }
@@ -53,7 +38,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ASSIGN;
 		int _saveIndex;
-		
+
 		match('=');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -65,7 +50,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = DIGIT;
 		int _saveIndex;
-		
+
 		matchRange('0','9');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -77,7 +62,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ESC;
 		int _saveIndex;
-		
+
 		match('\\');
 		{
 		switch ( LA(1)) {
@@ -138,7 +123,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if (((LA(1) >= '\3' && LA(1) <= '~')) && (true)) {
@@ -146,7 +131,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -164,7 +149,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -193,7 +178,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ID;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case 'a':  case 'b':  case 'c':  case 'd':
@@ -279,7 +264,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt40=0;
 		_loop40:
@@ -290,7 +275,7 @@
 			else {
 				if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt40++;
 		} while (true);
 		}
@@ -304,7 +289,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = LPAREN;
 		int _saveIndex;
-		
+
 		match('(');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -316,7 +301,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ML_COMMENT;
 		int _saveIndex;
-		
+
 		match("/*");
 		{
 		_loop17:
@@ -386,7 +371,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RPAREN;
 		int _saveIndex;
-		
+
 		match(')');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -398,7 +383,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SL_COMMENT;
 		int _saveIndex;
-		
+
 		match("//");
 		{
 		_loop12:
@@ -411,7 +396,7 @@
 			else {
 				break _loop12;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -430,7 +415,7 @@
 			}
 			else {
 			}
-			
+
 			}
 			break;
 		}
@@ -451,7 +436,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STRING;
 		int _saveIndex;
-		
+
 		match('"');
 		{
 		_loop23:
@@ -515,7 +500,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = VOCAB;
 		int _saveIndex;
-		
+
 		matchRange('\3','\176');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -527,7 +512,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case ' ':
@@ -549,7 +534,7 @@
 			}
 			else {
 			}
-			
+
 			}
 			newline();
 			break;
@@ -577,7 +562,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = XDIGIT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '0':  case '1':  case '2':  case '3':
 		case '4':  case '5':  case '6':  case '7':
@@ -699,7 +684,7 @@
 			consume();
 		}
 	}
-		
+
 
 			catch (CharStreamException cse) {
 			if ( cse instanceof CharStreamIOException ) {



1.4       +12 -22    e/src/jsrc/antlr/ANTLRTokdefParser.java

Index: ANTLRTokdefParser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRTokdefParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRTokdefParser.java	2001/10/26 03:08:50	1.3
+++ ANTLRTokdefParser.java	2001/11/29 20:33:25	1.4
@@ -2,20 +2,10 @@
 
 /*
  * ANTLR-generated file resulting from grammar tokdef.g
- * 
+ *
  * Terence Parr, MageLang Institute
  * ANTLR Version 2.7.0a2; 1989-1999
  */
-import antlr.TokenStreamException;
-import antlr.TokenBuffer;
-import antlr.LLkParser;
-import antlr.Token;
-import antlr.TokenStream;
-import antlr.RecognitionException;
-import antlr.NoViableAltException;
-import antlr.MismatchedTokenException;
-import antlr.SemanticException;
-import antlr.ParserSharedInputState;
 import antlr.collections.impl.BitSet;
 public class ANTLRTokdefParser extends antlr.LLkParser
 	   implements ANTLRTokdefParserTokenTypes
@@ -40,13 +30,13 @@
 		"XDIGIT",
 		"VOCAB"
 	};
-	
+
 	private static final long _tokenSet_0_data_[] = { 2L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { 50L, 0L };
 	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
-	
-	
+
+
 public ANTLRTokdefParser(ParserSharedInputState state) {
   super(state,3);
   tokenNames = _tokenNames;
@@ -68,9 +58,9 @@
 	public final void file(
 		ImportVocabTokenManager tm
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  name = null;
-		
+
 		try {      // for error handling
 			name = LT(1);
 			match(ID);
@@ -83,7 +73,7 @@
 				else {
 					break _loop3;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -96,7 +86,7 @@
 	public final void line(
 		ImportVocabTokenManager tm
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  s1 = null;
 		Token  lab = null;
 		Token  s2 = null;
@@ -105,7 +95,7 @@
 		Token  id2 = null;
 		Token  i = null;
 		Token t=null; Token s=null;
-		
+
 		try {      // for error handling
 			{
 			if ((LA(1)==STRING)) {
@@ -139,12 +129,12 @@
 			else {
 				throw new NoViableAltException(LT(1), getFilename());
 			}
-			
+
 			}
 			match(ASSIGN);
 			i = LT(1);
 			match(INT);
-			
+
 					Integer value = Integer.valueOf(i.getText());
 					// if literal found, define as a string literal
 					if ( s!=null ) {
@@ -167,7 +157,7 @@
 							);
 						}
 					}
-					
+
 		}
 		catch (RecognitionException ex) {
 			reportError(ex);



1.4       +1 -1      e/src/jsrc/antlr/ANTLRTokdefParserTokenTypes.java

Index: ANTLRTokdefParserTokenTypes.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ANTLRTokdefParserTokenTypes.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRTokdefParserTokenTypes.java	2001/10/26 03:08:50	1.3
+++ ANTLRTokdefParserTokenTypes.java	2001/11/29 20:33:25	1.4
@@ -2,7 +2,7 @@
 
 /*
  * ANTLR-generated file resulting from grammar tokdef.g
- * 
+ *
  * Terence Parr, MageLang Institute
  * ANTLR Version 2.7.0a2; 1989-1999
  */



1.4       +10 -10    e/src/jsrc/antlr/ASTFactory.java

Index: ASTFactory.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ASTFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ASTFactory.java	2001/10/26 03:08:50	1.3
+++ ASTFactory.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ASTFactory.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ASTFactory.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.AST;
@@ -35,7 +35,7 @@
 	    if (currentAST.root == null) {
 				// Make new child the current root
 		currentAST.root = child;
-	    } 
+	    }
 	    else {
 		if (currentAST.child == null) {
 		    // Add new child to current root
@@ -68,31 +68,31 @@
 	}
 	return t;
     }
-    public AST create(int type) { 
+    public AST create(int type) {
 	AST t = create();
 	t.initialize(type,"");
-	return t;	
+	return t;
     }
-    public AST create(int type, String txt) { 
+    public AST create(int type, String txt) {
 	AST t = create();
 	t.initialize(type,txt);
-	return t;	
+	return t;
     }
 
     /** Create a new empty AST node; if the user did not specify
      *  an AST node type, then create a default one: CommonAST.
      */
-    public AST create(AST tr) { 
+    public AST create(AST tr) {
 	if ( tr==null ) return null;		// create(null) == null
 	AST t = create();
 	t.initialize(tr);
-	return t;	
+	return t;
     }
 
-    public AST create(Token tok) { 
+    public AST create(Token tok) {
 	AST t = create();
 	t.initialize(tok);
-	return t;	
+	return t;
     }
 
     /** Copy a single node.  clone() is not used because



1.4       +10 -10    e/src/jsrc/antlr/ASTIterator.java

Index: ASTIterator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ASTIterator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ASTIterator.java	2001/10/26 03:08:50	1.3
+++ ASTIterator.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ASTIterator.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ASTIterator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.AST;
@@ -26,12 +26,12 @@
 	if ( sub==null ) {
 	    return true;
 	}
-	
-	// if the tree is empty, return true if the subtree template is too. 	
+
+	// if the tree is empty, return true if the subtree template is too.
 	if ( t==null ) {
 	    if ( sub!=null ) return false;
 	    return true;
-	}	
+	}
 
 	// Otherwise, start walking sibling lists.  First mismatch, return false.
 	for (sibling=t;
@@ -43,7 +43,7 @@
 		// if roots match, do full match test on children.
 		if ( sibling.getFirstChild()!=null ) {
 		    if ( !isSubtree(sibling.getFirstChild(), sub.getFirstChild()) ) return false;
-		}	
+		}
 	    }
 	return true;
     }
@@ -53,11 +53,11 @@
     public AST next(AST template) {
 	AST t = null;
 	AST sibling = null;
-		
+
 	if ( cursor==null ) {	// do nothing if no tree to work on
 	    return null;
 	}
-		
+
 	// Start walking sibling list looking for subtree matches.
 	for ( ; cursor!=null; cursor=cursor.getNextSibling())
 	    {
@@ -67,10 +67,10 @@
 		    if ( cursor.getFirstChild()!=null ) {
 			if ( isSubtree(cursor.getFirstChild(), template.getFirstChild()) ) {
 			    return cursor;
-			}	
+			}
 		    }
-		}	
+		}
 	    }
-	return t;	
+	return t;
     }
 }



1.4       +1 -2      e/src/jsrc/antlr/ASTNULLType.java

Index: ASTNULLType.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ASTNULLType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ASTNULLType.java	2001/10/26 03:08:50	1.3
+++ ASTNULLType.java	2001/11/29 20:33:25	1.4
@@ -4,12 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ASTNULLType.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ASTNULLType.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.AST;
 import antlr.collections.ASTEnumeration;
-import antlr.Token;
 
 /** There is only one instance of this class **/
 public class ASTNULLType implements AST {



1.4       +4 -4      e/src/jsrc/antlr/Alternative.java

Index: Alternative.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Alternative.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Alternative.java	2001/10/26 03:08:50	1.3
+++ Alternative.java	2001/11/29 20:33:25	1.4
@@ -4,11 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Alternative.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: Alternative.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Hashtable;
 
+
 /** Intermediate data class holds information about an alternative */
 class Alternative {
 	// Tracking alternative linked list
@@ -53,9 +53,9 @@
 		}
 	}
 	public boolean atStart() { return head == null; }
-	public boolean getAutoGen() { 
+	public boolean getAutoGen() {
 		// Don't build an AST if there is a tree-rewrite-specifier
-		return doAutoGen && treeSpecifier == null; 
+		return doAutoGen && treeSpecifier == null;
 	}
 	public Token getTreeSpecifier() {
 		return treeSpecifier;



1.4       +9 -9      e/src/jsrc/antlr/AlternativeBlock.java

Index: AlternativeBlock.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/AlternativeBlock.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AlternativeBlock.java	2001/10/26 03:08:50	1.3
+++ AlternativeBlock.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: AlternativeBlock.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: AlternativeBlock.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.impl.Vector;
@@ -66,10 +66,10 @@
     public Vector getAlternatives() {
 	return alternatives;
     }
-    public boolean getAutoGen() { 
-	return doAutoGen; 
+    public boolean getAutoGen() {
+	return doAutoGen;
     }
-    public String getInitAction() { 
+    public String getInitAction() {
 	return initAction;
     }
     public String getLabel() {
@@ -103,7 +103,7 @@
 		    }
 		    else {
 			rs.references.removeElement(rr);
-		    }	
+		    }
 		}
 		else if ( elem instanceof AlternativeBlock ) {// recurse into subrules
 		    ((AlternativeBlock)elem).removeTrackingOfRuleRefs(g);
@@ -121,8 +121,8 @@
     public void setInitAction(String initAction_) {
 	initAction = initAction_;
     }
-    public void setLabel(String label_) { 
-	label = label_; 
+    public void setLabel(String label_) {
+	label = label_;
     }
 
     public void setOption(Token key, Token value) {
@@ -143,7 +143,7 @@
 	    } else {
 		grammar.tool.error("Value for generateAmbigWarnings must be true or false", grammar.getFilename(), key.getLine());
 	    }
-	} 
+	}
 	else if (key.getText().equals("greedy")) {
 	    if (value.getText().equals("true")) {
 		greedy = true;
@@ -154,7 +154,7 @@
 	    } else {
 		grammar.tool.error("Value for greedy must be true or false", grammar.getFilename(), key.getLine());
 	    }
-	} 
+	}
 	else {
 	    grammar.tool.error("Invalid subrule option: " + key.getText(), grammar.getFilename(), key.getLine());
 	}



1.4       +20 -19    e/src/jsrc/antlr/BaseAST.java

Index: BaseAST.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/BaseAST.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseAST.java	2001/10/26 03:08:50	1.3
+++ BaseAST.java	2001/11/29 20:33:25	1.4
@@ -4,15 +4,16 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: BaseAST.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: BaseAST.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.AST;
 import antlr.collections.ASTEnumeration;
 import antlr.collections.impl.ASTEnumerator;
 import antlr.collections.impl.Vector;
-import java.io.Serializable;
+
 import java.io.IOException;
+import java.io.Serializable;
 import java.io.Writer;
 
 /**
@@ -46,7 +47,7 @@
 
     private static boolean verboseStringConversion = false;
     private static String[] tokenNames = null;
-	
+
     /**Add a node to the end of the child list for this node */
     public void addChild(AST node) {
 	if ( node==null ) return;
@@ -64,7 +65,7 @@
 
     private void doWorkForFindAll(Vector v, AST target, boolean partialMatch) {
 	AST sibling;
-	
+
 	// Start walking sibling lists, looking for matches.
     siblingWalk:
 	for (sibling=this;
@@ -79,7 +80,7 @@
 		if ( sibling.getFirstChild()!=null ) {
 		    ((BaseAST)sibling.getFirstChild()).doWorkForFindAll(v, target, partialMatch);
 		}
-	    }		
+	    }
     }
 
     /** Is node t equal to this in terms of token type and text? */
@@ -134,7 +135,7 @@
 	if ( sub==null ) {
 	    return true;
 	}
-	
+
 	// Otherwise, start walking sibling lists.  First mismatch, return false.
 	for (sibling=this;
 	     sibling!=null&&sub!=null;
@@ -145,13 +146,13 @@
 		// if roots match, do partial list match test on children.
 		if ( sibling.getFirstChild()!=null ) {
 		    if ( !sibling.getFirstChild().equalsListPartial(sub.getFirstChild()) ) return false;
-		}	
+		}
 	    }
 	if ( sibling==null && sub!=null ) {
 	    // nothing left to match in this tree, but subtree has more
 	    return false;
 	}
-	// either both are null or sibling has more, but subtree doesn't	
+	// either both are null or sibling has more, but subtree doesn't
 	return true;
     }
 
@@ -169,25 +170,25 @@
 	else if (t.getFirstChild() != null) {
 	    return false;
 	}
-	return true;		
+	return true;
     }
 
     /** Is 't' a subtree of the tree rooted at 'this'?  The siblings
-     *  of 'this' are ignored. 
+     *  of 'this' are ignored.
      */
     public boolean equalsTreePartial(AST sub) {
 	// the empty tree is always a subset of any tree.
 	if ( sub==null ) {
 	    return true;
 	}
-	
+
 	// check roots first.
 	if ( !this.equals(sub) ) return false;
 	// if roots match, do full list partial match test on children.
 	if ( this.getFirstChild()!=null ) {
 	    if ( !this.getFirstChild().equalsListPartial(sub.getFirstChild()) ) return false;
 	}
-	return true;		
+	return true;
     }
 
     /** Walk the tree looking for all exact subtree matches.  Return
@@ -327,7 +328,7 @@
 		    c1 = text.charAt(i+1); c2 = text.charAt(i+2);
 		    c3 = text.charAt(i+3); c4 = text.charAt(i+4);
 		    c5 = text.charAt(i+5);
-				
+
 		    if ( c1 == 'a' && c2 == 'm' && c3 == 'p' && c4 == ';') {
 			n.append("&");
 			i += 5;
@@ -340,12 +341,12 @@
 			n.append(">");
 			i += 4;
 		    }
-		    else if ( c1 == 'q' && c2 == 'u' && c3 == 'o' && 
+		    else if ( c1 == 'q' && c2 == 'u' && c3 == 'o' &&
 			      c4 == 't' && c5 == ';') {
 			n.append("\"");
 			i += 6;
 		    }
-		    else if ( c1 == 'a' && c2 == 'p' && c3 == 'o' && 
+		    else if ( c1 == 'a' && c2 == 'p' && c3 == 'o' &&
 			      c4 == 's' && c5 == ';') {
 			n.append("'");
 			i += 6;
@@ -407,8 +408,8 @@
     public void xmlSerialize(Writer out) throws IOException
     {
 	// print out this node and all siblings
-	for (AST node = this; 
-	     node != null; 
+	for (AST node = this;
+	     node != null;
 	     node = node.getNextSibling())
 	{
 	    if (node.getFirstChild() == null) {
@@ -417,10 +418,10 @@
 	    }
 	    else {
 		((BaseAST)node).xmlSerializeRootOpen(out);
-		
+
 		// print children
 		((BaseAST)node.getFirstChild()).xmlSerialize(out);
-		
+
 		// print end tag
 		((BaseAST)node).xmlSerializeRootClose(out);
 	    }



1.4       +2 -2      e/src/jsrc/antlr/ByteBuffer.java

Index: ByteBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ByteBuffer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ByteBuffer.java	2001/10/26 03:08:50	1.3
+++ ByteBuffer.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ByteBuffer.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: ByteBuffer.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /**A Stream of characters fed to the lexer from a InputStream that can
@@ -20,8 +20,8 @@
  * @see antlr.CharQueue
  */
 // SAS: added this class to handle Binary input w/ FileInputStream
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
 
 public class ByteBuffer extends InputBuffer{
 



1.4       +2 -2      e/src/jsrc/antlr/CharBuffer.java

Index: CharBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CharBuffer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CharBuffer.java	2001/10/26 03:08:50	1.3
+++ CharBuffer.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CharBuffer.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CharBuffer.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /**A Stream of characters fed to the lexer from a InputStream that can
@@ -20,8 +20,8 @@
  * @see antlr.CharQueue
  */
 
-import java.io.Reader; // SAS: changed to properly read text files
 import java.io.IOException;
+import java.io.Reader;
 
 // SAS: Move most functionality into InputBuffer -- just the file-specific
 //      stuff is in here



1.4       +4 -4      e/src/jsrc/antlr/CharQueue.java

Index: CharQueue.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CharQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CharQueue.java	2001/10/26 03:08:50	1.3
+++ CharQueue.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CharQueue.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CharQueue.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /** A circular buffer object used by CharBuffer */
@@ -40,7 +40,7 @@
 	/** Fetch a token from the queue by index
 	 * @param idx The index of the token to fetch, where zero is the token at the front of the queue
 	 */
-	public final char elementAt(int idx) { 
+	public final char elementAt(int idx) {
 		return buffer[(offset + idx) & sizeLessOne];
 	}
 	/** Expand the token buffer by doubling its capacity */
@@ -48,7 +48,7 @@
 	{
 		char[] newBuffer = new char[buffer.length * 2];
 		// Copy the contents to the new buffer
-		// Note that this will store the first logical item in the 
+		// Note that this will store the first logical item in the
 		// first physical array element.
 		for (int i = 0; i < buffer.length; i++)
 		{
@@ -71,7 +71,7 @@
 		nbrEntries = 0;
 	}
 	/** Remove char from front of queue */
-	public final void removeFirst() { 
+	public final void removeFirst() {
 		offset = (offset+1) & sizeLessOne;
 		nbrEntries--;
 	}



1.4       +3 -3      e/src/jsrc/antlr/CharRangeElement.java

Index: CharRangeElement.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CharRangeElement.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CharRangeElement.java	2001/10/26 03:08:50	1.3
+++ CharRangeElement.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CharRangeElement.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CharRangeElement.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 class CharRangeElement extends AlternativeElement {
@@ -37,8 +37,8 @@
 	public Lookahead look(int k) {
 		return grammar.theLLkAnalyzer.look(k, this);
 	}
-	public void setLabel(String label_) { 
-		label = label_; 
+	public void setLabel(String label_) {
+		label = label_;
 	}
 	public String toString() {
 		if ( label!=null ) return " "+label+":"+beginText+".."+endText;



1.4       +3 -3      e/src/jsrc/antlr/CharScanner.java

Index: CharScanner.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CharScanner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CharScanner.java	2001/10/26 03:08:50	1.3
+++ CharScanner.java	2001/11/29 20:33:25	1.4
@@ -4,12 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CharScanner.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CharScanner.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Hashtable;
 import antlr.collections.impl.BitSet;
-import java.io.IOException;
+
+import java.util.Hashtable;
 public abstract class CharScanner implements TokenStream {
     static final char NO_CHAR = 0;
     public static final char EOF_CHAR = (char) - 1;



1.4       +23 -23    e/src/jsrc/antlr/CodeGenerator.java

Index: CodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CodeGenerator.java	2001/10/26 03:08:50	1.3
+++ CodeGenerator.java	2001/11/29 20:33:25	1.4
@@ -4,15 +4,15 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CodeGenerator.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CodeGenerator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.io.PrintWriter; // SAS: for proper text i/o
-import java.io.IOException;
-import java.io.FileWriter;  // SAS: for proper text i/o
-import antlr.collections.impl.Vector;
 import antlr.collections.impl.BitSet;
+import antlr.collections.impl.Vector;
 
+import java.io.IOException;
+import java.io.PrintWriter;
+
 /**A generic ANTLR code generator.  All code generators
  * Derive from this class.
  *
@@ -88,7 +88,7 @@
      * This is modified by the grammar option "codeGenBitsetTestThreshold"
      */
     protected int bitsetTestThreshold = DEFAULT_BITSET_TEST_THRESHOLD;
-	
+
     private static boolean OLD_ACTION_TRANSLATOR = true;
 
     public static String TokenTypesFileSuffix = "TokenTypes";
@@ -126,7 +126,7 @@
 
 	// Skip leading newlines, tabs and spaces
 	int end = s.length()-1;
-	while ( end > start && Character.isSpaceChar(s.charAt(end)) ) 
+	while ( end > start && Character.isSpaceChar(s.charAt(end)) )
 	    {
 		end--;
 	    }
@@ -148,12 +148,12 @@
 			}
 			newline=true;
 			break;
-		    default: 
-			currentOutput.print(c); 
+		    default:
+			currentOutput.print(c);
 			break;
 		    }
 		if ( newline ) {
-		    currentOutput.println(); 
+		    currentOutput.println();
 		    printTabs();
 				// Absorb leading whitespace
 		    while (i <= end && Character.isSpaceChar(s.charAt(i)) ) {
@@ -390,7 +390,7 @@
 		    StringLiteralSymbol sl = (StringLiteralSymbol)tm.getTokenSymbol(s);
 		    if ( sl!=null && sl.label != null ) {
 			print(sl.label+"=");
-		    }	
+		    }
 		    println(s + "=" + i);
 		}
 		else {
@@ -404,9 +404,9 @@
 			if ( ts.getParaphrase()!=null ) {
 			    print("("+ts.getParaphrase()+")");
 			}
-		    }	
+		    }
 		    println("=" + i);
-		}		
+		}
 	    }
 	}
 
@@ -461,7 +461,7 @@
      * if the bitset is already in the list, ignore the request.
      * Always adds the bitset to the end of the list, so the
      * caller can rely on the position of bitsets in the list.
-     * The returned position can be used to format the bitset 
+     * The returned position can be used to format the bitset
      * name, since it is invariant.
      * @param p Bit set to mark for code generation
      * @param forParser true if the bitset is used for the parser, false for the lexer
@@ -486,7 +486,7 @@
 
     /** Output tab indent followed by a String, to the currentOutput stream.
      * Ignored if string is null.
-     * @param s The string to output.  
+     * @param s The string to output.
      */
     protected void print(String s) {
 	if (s != null) {
@@ -500,7 +500,7 @@
      * Ignored if string is null.
      * @param s The action string to output
      */
-    protected void printAction(String s) { 
+    protected void printAction(String s) {
 	if (s != null) {
 	    printTabs();
 	    _printAction(s);
@@ -518,7 +518,7 @@
 	}
     }
 
-    /** Output the current tab indentation.  This outputs the number of tabs 
+    /** Output the current tab indentation.  This outputs the number of tabs
      * indicated by the "tabs" variable to the currentOutput stream.
      */
     protected void printTabs() {
@@ -530,9 +530,9 @@
     /** Lexically process tree-specifiers in the action.
      *  This will replace #id and #(...) with the appropriate
      *  function calls and/or variables.
-     * 
+     *
      *  This is the default Java action translator, but I have made
-     *  it work for C++ also.  
+     *  it work for C++ also.
      */
     protected String processActionForTreeSpecifiers(String actionStr, int line, RuleBlock currentRule, ActionTransInfo tInfo) {
 	if ( actionStr==null || actionStr.length()==0 ) return null;
@@ -578,7 +578,7 @@
 	// with an initialization.  Strip off the initialization part.
 	if (d.indexOf('=') >= 0) d = d.substring(0, d.indexOf('=')).trim();
 	return d;
-    } 
+    }
 
     /** Set all fields back like one just created */
     private void reset() {
@@ -600,7 +600,7 @@
 	analyzer = analyzer_;
     }
 
-    public void setBehavior(DefineGrammarSymbols behavior_) { 
+    public void setBehavior(DefineGrammarSymbols behavior_) {
 	behavior = behavior_;
     }
 
@@ -621,7 +621,7 @@
 			   );
 	    }
 	}
-		
+
 	// Lookup bitset-test threshold in the grammar generic options
 	if (grammar.hasOption("codeGenBitsetTestThreshold")) {
 	    try {
@@ -635,7 +635,7 @@
 			   );
 	    }
 	}
-		
+
 	// Lookup debug code-gen in the grammar generic options
 	if (grammar.hasOption("codeGenDebug")) {
 	    Token t = grammar.getOption("codeGenDebug");



1.4       +5 -5      e/src/jsrc/antlr/CommonAST.java

Index: CommonAST.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CommonAST.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonAST.java	2001/10/26 03:08:50	1.3
+++ CommonAST.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CommonAST.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CommonAST.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 import antlr.collections.AST;
@@ -43,11 +43,11 @@
 		setType(tok.getType());
 	}
 	/** Set the token text for this node */
-	public void setText(String text_) { 
-		text = text_; 
+	public void setText(String text_) {
+		text = text_;
 	}
 	/** Set the token type for this node */
-	public void setType(int ttype_) { 
-		ttype = ttype_; 
+	public void setType(int ttype_) {
+		ttype = ttype_;
 	}
 }



1.4       +3 -3      e/src/jsrc/antlr/CommonASTWithHiddenTokens.java

Index: CommonASTWithHiddenTokens.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CommonASTWithHiddenTokens.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonASTWithHiddenTokens.java	2001/10/26 03:08:50	1.3
+++ CommonASTWithHiddenTokens.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CommonASTWithHiddenTokens.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CommonASTWithHiddenTokens.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /** A CommonAST whose initialization copies hidden token
@@ -12,9 +12,9 @@
  */
 public class CommonASTWithHiddenTokens extends CommonAST {
     protected CommonHiddenStreamToken hiddenBefore, hiddenAfter; // references to hidden tokens
-    
+
     public CommonASTWithHiddenTokens() {
-	super();            
+	super();
     }
 
     public CommonASTWithHiddenTokens(Token tok) {



1.4       +2 -2      e/src/jsrc/antlr/CommonHiddenStreamToken.java

Index: CommonHiddenStreamToken.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CommonHiddenStreamToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonHiddenStreamToken.java	2001/10/26 03:08:50	1.3
+++ CommonHiddenStreamToken.java	2001/11/29 20:33:25	1.4
@@ -4,13 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CommonHiddenStreamToken.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CommonHiddenStreamToken.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 public class CommonHiddenStreamToken extends CommonToken {
     protected CommonHiddenStreamToken hiddenBefore;
     protected CommonHiddenStreamToken hiddenAfter;
-    
+
     public CommonHiddenStreamToken() {
 	super();
     }



1.4       +2 -2      e/src/jsrc/antlr/CommonToken.java

Index: CommonToken.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CommonToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonToken.java	2001/10/26 03:08:50	1.3
+++ CommonToken.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CommonToken.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CommonToken.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 public class CommonToken extends Token {
@@ -12,7 +12,7 @@
     protected int line;
     protected String text = null;
     protected int col;
-    
+
     public CommonToken() {}
 
     public CommonToken(int t, String txt) {



1.4       +4 -5      e/src/jsrc/antlr/CppCodeGenerator.java

Index: CppCodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/CppCodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CppCodeGenerator.java	2001/10/26 03:08:50	1.3
+++ CppCodeGenerator.java	2001/11/29 20:33:25	1.4
@@ -4,19 +4,18 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: CppCodeGenerator.java,v 1.3 2001/10/26 03:08:50 markm Exp $
+ * $Id: CppCodeGenerator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 // C++ code generator by Pete Wells: pete@yamuna.demon.co.uk
 // #line generation contributed by: Ric Klaren <klaren@cs.utwente.nl>
 
-import java.util.Enumeration;
-import java.util.Hashtable;
 import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
-import java.io.PrintWriter; //SAS: changed for proper text file io
+
 import java.io.IOException;
-import java.io.FileWriter;
+import java.util.Enumeration;
+import java.util.Hashtable;
 
 /**Generate MyParser.cpp, MyParser.hpp, MyLexer.cpp, MyLexer.hpp and MyParserTokenTypes.hpp */
 public class CppCodeGenerator extends CodeGenerator {



1.4       +4 -4      e/src/jsrc/antlr/DefaultToolErrorHandler.java

Index: DefaultToolErrorHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/DefaultToolErrorHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultToolErrorHandler.java	2001/10/26 03:08:51	1.3
+++ DefaultToolErrorHandler.java	2001/11/29 20:33:25	1.4
@@ -4,11 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: DefaultToolErrorHandler.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: DefaultToolErrorHandler.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import antlr.collections.impl.BitSet;
 
+
 class DefaultToolErrorHandler implements ToolErrorHandler {
     CharFormatter javaCharFormatter = new JavaCharFormatter();
 
@@ -31,7 +31,7 @@
 		    System.out.print("<end-of-token>");
 		    if ( bits.length()>0 ) {
 			System.out.print(",");
-		    }	
+		    }
 		}
 		System.out.println(bits);
 	    }
@@ -69,7 +69,7 @@
 	    System.out.println(ri+" and "+rj+" upon");
 	    dumpSets(grammar, lexicalAnalysis, depth, sets, fileline);
 	    return;
-	}	
+	}
 	System.out.println(
 			   //   "warning: line " + blk.getLine() + ": " +
 			   fileline+"warning: "+



1.4       +3 -2      e/src/jsrc/antlr/DefineGrammarSymbols.java

Index: DefineGrammarSymbols.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/DefineGrammarSymbols.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefineGrammarSymbols.java	2001/10/26 03:08:51	1.3
+++ DefineGrammarSymbols.java	2001/11/29 20:33:25	1.4
@@ -4,11 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: DefineGrammarSymbols.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: DefineGrammarSymbols.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Hashtable;
 import antlr.collections.impl.BitSet;
+
+import java.util.Hashtable;
 
 /**DefineGrammarSymbols is a behavior for the ANTLRParser that adds all
  * the token and rule symbols to the grammar symbol table.



1.4       +16 -18    e/src/jsrc/antlr/DiagnosticCodeGenerator.java

Index: DiagnosticCodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/DiagnosticCodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DiagnosticCodeGenerator.java	2001/10/26 03:08:51	1.3
+++ DiagnosticCodeGenerator.java	2001/11/29 20:33:25	1.4
@@ -4,15 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: DiagnosticCodeGenerator.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: DiagnosticCodeGenerator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Enumeration;
-import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
-import java.io.PrintWriter; //SAS: changed for proper text file io
+
 import java.io.IOException;
-import java.io.FileWriter;
+import java.util.Enumeration;
 
 /**Generate MyParser.txt, MyLexer.txt and MyParserTokenTypes.txt */
 public class DiagnosticCodeGenerator extends CodeGenerator {
@@ -48,7 +46,7 @@
 
 				// To get right overloading behavior across hetrogeneous grammars
 				g.generate();
-	
+
 				if (tool.hasError) {
 					System.out.println("Exiting due to errors.");
 					System.exit(1);
@@ -135,7 +133,7 @@
 		System.out.println("Generating " + grammar.getClassName() + TokenTypesFileExt);
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName() + TokenTypesFileExt);
 		//SAS: changed for proper text file io
-		
+
 		tabs=0;
 		doingLexRules = true;
 
@@ -196,7 +194,7 @@
 		println("");
 		println("*** User-defined Lexer rules:");
 		tabs++;
-		
+
 		ids = grammar.rules.elements();
 		while ( ids.hasMoreElements() ) {
 			RuleSymbol rs = (RuleSymbol)ids.nextElement();
@@ -236,12 +234,12 @@
 		System.out.println("Generating " + grammar.getClassName() + TokenTypesFileExt);
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName()+TokenTypesFileExt);
 		//SAS: changed for proper text file io
-		
+
 		tabs = 0;
 
 		// Generate the header common to all output files.
 		genHeader();
-		
+
 		// Output the user-defined parser premamble
 		println("");
 		println("*** Parser Preamble Action.");
@@ -383,12 +381,12 @@
 		System.out.println("Generating " + grammar.getClassName() + TokenTypesFileExt);
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName()+TokenTypesFileExt);
 		//SAS: changed for proper text file io
-		
+
 		tabs = 0;
 
 		// Generate the header common to all output files.
 		genHeader();
-		
+
 		// Output the user-defined parser premamble
 		println("");
 		println("*** Tree-walker Preamble Action.");
@@ -470,7 +468,7 @@
 		{
 			elem.generate();
 		}
-		if (alt.getTreeSpecifier() != null) 
+		if (alt.getTreeSpecifier() != null)
 		{
 			println("AST will be built as: " + alt.getTreeSpecifier().getText());
 		}
@@ -582,7 +580,7 @@
 		printSet(grammar.maxk, 1, follow);
 	}
 	/** Generate a header that is common to all TXT files */
-	protected void genHeader() 
+	protected void genHeader()
 	{
 		println("ANTLR-generated file resulting from grammar " + tool.grammarFile);
 		println("Diagnostic output");
@@ -630,7 +628,7 @@
 			if (alt.lookaheadDepth == GrammarAnalyzer.NONDETERMINISTIC) {
 				depth = grammar.maxk;
 				break;
-			} 
+			}
 			else if (depth < alt.lookaheadDepth) {
 				depth = alt.lookaheadDepth;
 			}
@@ -719,7 +717,7 @@
 		}
 
 		// Gen arguments
-		if (rblk.argAction != null) 
+		if (rblk.argAction != null)
 		{
 			println("Arguments: " + rblk.argAction);
 		}
@@ -732,7 +730,7 @@
 		if (!ok) {
 			println("Error: This rule is non-deterministic");
 		}
-	
+
 		// Dump the alternates of the rule
 		genCommonBlock(rblk);
 
@@ -790,7 +788,7 @@
 		currentOutput = antlr.Tool.openOutputFile(tm.getName() + TokenTypesFileSuffix+TokenTypesFileExt);
 		//SAS: changed for proper text file io
 		tabs = 0;
-	
+
 		// Generate the header common to all diagnostic files
 		genHeader();
 



1.4       +1 -2      e/src/jsrc/antlr/DumpASTVisitor.java

Index: DumpASTVisitor.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/DumpASTVisitor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DumpASTVisitor.java	2001/10/26 03:08:51	1.3
+++ DumpASTVisitor.java	2001/11/29 20:33:25	1.4
@@ -4,10 +4,9 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: DumpASTVisitor.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: DumpASTVisitor.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.io.*;
 import antlr.collections.AST;
 
 /** Simple class to dump the contents of an AST to the output */



1.4       +3 -3      e/src/jsrc/antlr/FileCopyException.java

Index: FileCopyException.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/FileCopyException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FileCopyException.java	2001/10/26 03:08:51	1.3
+++ FileCopyException.java	2001/11/29 20:33:25	1.4
@@ -4,9 +4,9 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: FileCopyException.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: FileCopyException.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-class FileCopyException extends java.io.IOException { 
-    public FileCopyException(String msg) { super(msg); }  
+class FileCopyException extends java.io.IOException {
+    public FileCopyException(String msg) { super(msg); }
 }



1.4       +5 -5      e/src/jsrc/antlr/FileLineFormatter.java

Index: FileLineFormatter.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/FileLineFormatter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FileLineFormatter.java	2001/10/26 03:08:51	1.3
+++ FileLineFormatter.java	2001/11/29 20:33:25	1.4
@@ -4,20 +4,20 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: FileLineFormatter.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: FileLineFormatter.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 public abstract class FileLineFormatter {
-    
+
     private static FileLineFormatter formatter = new DefaultFileLineFormatter();
-    
+
     public static FileLineFormatter getFormatter() {
 	return formatter;
     }
-    
+
     public static void setFormatter(FileLineFormatter f) {
 	formatter = f;
     }
-    
+
     public abstract String getFormatString(String fileName, int line);
 }



1.4       +7 -7      e/src/jsrc/antlr/Grammar.java

Index: Grammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Grammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Grammar.java	2001/10/26 03:08:51	1.3
+++ Grammar.java	2001/11/29 20:33:25	1.4
@@ -4,15 +4,15 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Grammar.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: Grammar.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.io.IOException;
-import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
 
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
 /**A Grammar holds a set of rules (which are stored
  * in a symbol table).  Most of the time a grammar
  * needs a code generator and an LLkAnalyzer too.
@@ -95,7 +95,7 @@
 	return fileName;
     }
 
-    /** Get an integer option.  Given the name of the option find its 
+    /** Get an integer option.  Given the name of the option find its
      * associated integer value.  If the associated value is not an integer or
      * is not in the table, then throw an exception of type NumberFormatException.
      * @param key The name of the option
@@ -245,7 +245,7 @@
 	}
 	return false;
     }
-    
+
     public void setTokenManager(TokenManager tokenManager_) {
 	tokenManager = tokenManager_;
     }



1.4       +2 -2      e/src/jsrc/antlr/GrammarAnalyzer.java

Index: GrammarAnalyzer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/GrammarAnalyzer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GrammarAnalyzer.java	2001/10/26 03:08:51	1.3
+++ GrammarAnalyzer.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: GrammarAnalyzer.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: GrammarAnalyzer.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /**A GrammarAnalyzer computes lookahead from Grammar (which contains
@@ -25,7 +25,7 @@
  * versus "does this specific k-sequence match?".
  */
 public interface GrammarAnalyzer {
-	/**The epsilon token type is an imaginary type used 
+	/**The epsilon token type is an imaginary type used
 	 * during analysis.  It indicates an incomplete look() computation.
 	 * Must be kept consistent with Token constants to be between
 	 * MIN_USER_TYPE and INVALID_TYPE.



1.4       +3 -3      e/src/jsrc/antlr/GrammarAtom.java

Index: GrammarAtom.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/GrammarAtom.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GrammarAtom.java	2001/10/26 03:08:51	1.3
+++ GrammarAtom.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: GrammarAtom.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: GrammarAtom.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 /**A GrammarAtom is either a token ref, a character ref, or string.
@@ -37,8 +37,8 @@
 		return tokenType;
 	}
 
-	public void setLabel(String label_) { 
-		label = label_; 
+	public void setLabel(String label_) {
+		label = label_;
 	}
 
 	public String getASTNodeType() {



1.4       +24 -26    e/src/jsrc/antlr/HTMLCodeGenerator.java

Index: HTMLCodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/HTMLCodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HTMLCodeGenerator.java	2001/10/26 03:08:51	1.3
+++ HTMLCodeGenerator.java	2001/11/29 20:33:25	1.4
@@ -4,15 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: HTMLCodeGenerator.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: HTMLCodeGenerator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Enumeration;
-import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
-import java.io.PrintWriter; //SAS: changed for proper text file io
+
 import java.io.IOException;
-import java.io.FileWriter;
+import java.util.Enumeration;
 
 /**Generate P.html, a cross-linked representation of P with or without actions */
 public class HTMLCodeGenerator extends CodeGenerator {
@@ -52,7 +50,7 @@
 
 				// To get right overloading behavior across hetrogeneous grammars
 				g.generate();
-	
+
 				if (tool.hasError) {
 					System.out.println("Exiting due to errors.");
 					System.exit(1);
@@ -120,7 +118,7 @@
 		System.out.println("Generating " + grammar.getClassName() + TokenTypesFileExt);
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName() + TokenTypesFileExt);
 		//SAS: changed for proper text file io
-		
+
 		tabs=0;
 		doingLexRules = true;
 
@@ -131,7 +129,7 @@
 		// Output the user-defined lexer premamble
 		println(grammar.preambleAction.getText());
 		*/
-		
+
 		// Generate lexer class definition
 		println("");
 
@@ -139,7 +137,7 @@
 		if ( grammar.comment!=null ) {
 			_println(grammar.comment);
 		}
-		
+
 		println("class " + grammar.getClassName() + " extends " + grammar.getSuperClass() + " {");
 
 		// Generate user-defined parser class members
@@ -169,14 +167,14 @@
 		tabs--;
 		println("*** End of string literals used by the parser");
 		*/
-		
+
 		// Generate nextToken() rule.
 		// nextToken() is a synthetic lexer rule that is the implicit OR of all
 		// user-defined lexer rules.
 		genNextToken();
 
 		// Generate code for each rule in the lexer
-		
+
 		Enumeration ids = grammar.rules.elements();
 		while ( ids.hasMoreElements() ) {
 			RuleSymbol rs = (RuleSymbol)ids.nextElement();
@@ -202,12 +200,12 @@
 		// Open the output stream for the parser and set the currentOutput
 		System.out.println("Generating " + grammar.getClassName() + ".html");
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName()+".html");
-		
+
 		tabs = 0;
 
 		// Generate the header common to all output files.
 		genHeader();
-		
+
 		/*
 		_print("{");
 		printAction(grammar.preambleAction.getText());
@@ -216,12 +214,12 @@
 
 		// Generate parser class definition
 		println("");
-		
+
 		// print javadoc comment if any
 		if ( grammar.comment!=null ) {
 			_println(grammar.comment);
 		}
-		
+
 		println("class " + grammar.getClassName() + " extends " + grammar.getSuperClass());
 
 		/*
@@ -247,7 +245,7 @@
 		println("");
 
 		genTail();
-		
+
 		// Close the parser output stream
 		currentOutput.close();
 		currentOutput = null;
@@ -323,12 +321,12 @@
 		System.out.println("Generating " + grammar.getClassName() + ".txt");
 		currentOutput = antlr.Tool.openOutputFile(grammar.getClassName()+".txt");
 		//SAS: changed for proper text file io
-		
+
 		tabs = 0;
 
 		// Generate the header common to all output files.
 		genHeader();
-		
+
 		// Output the user-defined parser premamble
 		println("");
 		println("*** Tree-walker Preamble Action.");
@@ -340,12 +338,12 @@
 
 		// Generate tree-walker class definition
 		println("");
-		
+
 		// print javadoc comment if any
 		if ( grammar.comment!=null ) {
 			_println(grammar.comment);
 		}
-		
+
 		println("class " + grammar.getClassName() + " extends " + grammar.getSuperClass() + "{");
 
 		// Generate user-defined tree-walker class members
@@ -447,7 +445,7 @@
 		}
 
 		// Dump the alternative, starting with predicates
-		
+
 		boolean save = firstElementInAlt;
 		firstElementInAlt = true;
 		tabs++;	// in case we do a newline in alt, increase the tab indent
@@ -512,7 +510,7 @@
 	}
 }
 	/** Generate a header that is common to all TXT files */
-	protected void genHeader() 
+	protected void genHeader()
 	{
 		println("<HTML>");
 		println("<HEAD>");
@@ -566,7 +564,7 @@
 			if (alt.lookaheadDepth == GrammarAnalyzer.NONDETERMINISTIC) {
 				depth = grammar.maxk;
 				break;
-			} 
+			}
 			else if (depth < alt.lookaheadDepth) {
 				depth = alt.lookaheadDepth;
 			}
@@ -631,7 +629,7 @@
 		_print("<a name="+s.getId()+">");
 		_print(s.getId());
 		_print("</a>");
-		
+
 		// Get rule return type and arguments
 		RuleBlock rblk = s.getBlock();
 
@@ -640,7 +638,7 @@
 			_print("["+rblk.returnAction+"]");
 		}
 		// Gen arguments
-		if (rblk.argAction != null) 
+		if (rblk.argAction != null)
 		{
 			_print(" returns [" + rblk.argAction+"]");
 		}
@@ -679,7 +677,7 @@
 		currentOutput = antlr.Tool.openOutputFile(tm.getName() + TokenTypesFileSuffix+TokenTypesFileExt);
 		//SAS: changed for proper text file io
 		tabs = 0;
-	
+
 		// Generate the header common to all diagnostic files
 		genHeader();
 



1.4       +6 -7      e/src/jsrc/antlr/ImportVocabTokenManager.java

Index: ImportVocabTokenManager.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ImportVocabTokenManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ImportVocabTokenManager.java	2001/10/26 03:08:51	1.3
+++ ImportVocabTokenManager.java	2001/11/29 20:33:25	1.4
@@ -4,13 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ImportVocabTokenManager.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: ImportVocabTokenManager.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.io.*;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import antlr.collections.impl.Vector;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
 
 /** Static implementation of the TokenManager, used for importVocab option  */
 class ImportVocabTokenManager extends SimpleTokenManager implements Cloneable {
@@ -76,7 +75,7 @@
 		}
 		else {
 			ts = new TokenSymbol(s);
-		}	
+		}
 		ts.setTokenType(ttype);
 		super.define(ts);
 		maxToken = (ttype+1)>maxToken ? (ttype+1) : maxToken;	// record maximum token type
@@ -87,6 +86,6 @@
 	}
 	/** Get the next unused token type. */
 	public int nextTokenType() {
-		return super.nextTokenType();	
+		return super.nextTokenType();
 	}
 }



1.4       +2 -2      e/src/jsrc/antlr/InputBuffer.java

Index: InputBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/InputBuffer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InputBuffer.java	2001/10/26 03:08:51	1.3
+++ InputBuffer.java	2001/11/29 20:33:25	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: InputBuffer.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: InputBuffer.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 // SAS: Added this class to genericise the input buffers for scanners
@@ -13,7 +13,7 @@
 //      subclass will define the input stream
 //      There are two subclasses to this: CharBuffer and ByteBuffer
 
-import java.io.IOException;
+
 
 /**A Stream of characters fed to the lexer from a InputStream that can
  * be rewound via mark()/rewind() methods.



1.4       +2 -2      e/src/jsrc/antlr/JavaBlockFinishingInfo.java

Index: JavaBlockFinishingInfo.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/JavaBlockFinishingInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JavaBlockFinishingInfo.java	2001/10/26 03:08:51	1.3
+++ JavaBlockFinishingInfo.java	2001/11/29 20:33:25	1.4
@@ -4,14 +4,14 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: JavaBlockFinishingInfo.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: JavaBlockFinishingInfo.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
 class JavaBlockFinishingInfo {
 	String postscript;		// what to generate to terminate block
 	boolean generatedSwitch;// did block finish with "default:" of switch?
 	boolean generatedAnIf;
-	
+
 	/** When generating an if or switch, end-of-token lookahead sets
 	 *  will become the else or default clause, don't generate an
 	 *  error clause in this case.



1.4       +123 -124  e/src/jsrc/antlr/JavaCodeGenerator.java

Index: JavaCodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/JavaCodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JavaCodeGenerator.java	2001/10/26 03:08:51	1.3
+++ JavaCodeGenerator.java	2001/11/29 20:33:25	1.4
@@ -4,22 +4,21 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: JavaCodeGenerator.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: JavaCodeGenerator.java,v 1.4 2001/11/29 20:33:25 markm Exp $
  */
 
-import java.util.Enumeration;
-import java.util.Hashtable;
 import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
-import java.io.PrintWriter; //SAS: changed for proper text file io
+
 import java.io.IOException;
-import java.io.FileWriter;
+import java.util.Enumeration;
+import java.util.Hashtable;
 
 /**Generate MyParser.java, MyLexer.java and MyParserTokenTypes.java */
 public class JavaCodeGenerator extends CodeGenerator {
     // non-zero if inside syntactic predicate generation
     protected int syntacticPredLevel = 0;
-	
+
     // Are we generating ASTs (for parsers and tree parsers) right now?
     protected boolean genAST = false;
 
@@ -138,7 +137,7 @@
 
 	    ActionTransInfo tInfo = new ActionTransInfo();
 	    String actionStr = processActionForTreeSpecifiers(action.actionText, action.getLine(), currentRule, tInfo);
-			
+
 	    if ( tInfo.refRuleRoot!=null ) {
 				// Somebody referenced "#rule", make sure translated var is valid
 				// assignment to #rule is left as a ref also, meaning that assignments
@@ -146,21 +145,21 @@
 				// generated (unnecessarily).
 		println(tInfo.refRuleRoot + " = ("+labeledElementASTType+")currentAST.root;");
 	    }
-			
+
 	    // dump the translated action
 	    printAction(actionStr);
-			
+
 	    if ( tInfo.assignToRoot ) {
 				// Somebody did a "#rule=", reset internal currentAST.root
 		println("currentAST.root = "+tInfo.refRuleRoot+";");
 				// reset the child pointer too to be last sibling in sibling list
 		println("currentAST.child = "+tInfo.refRuleRoot+"!=null &&"+tInfo.refRuleRoot+".getFirstChild()!=null ?");
 		tabs++;
-		println(tInfo.refRuleRoot+".getFirstChild() : "+tInfo.refRuleRoot+";");				
+		println(tInfo.refRuleRoot+".getFirstChild() : "+tInfo.refRuleRoot+";");
 		tabs--;
 		println("currentAST.advanceChildToEnd();");
 	    }
-			
+
 	    if ( grammar.hasSyntacticPredicate ) {
 		tabs--;
 		println("}");
@@ -182,7 +181,7 @@
 	}
 
 	boolean ok = grammar.theLLkAnalyzer.deterministic(blk);
-		
+
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, true);
 	genBlockFinish(howToFinish, throwNoViable);
 
@@ -204,11 +203,11 @@
 	 */
     public void gen(CharLiteralElement atom) {
 	if ( DEBUG_CODE_GENERATOR ) System.out.println("genChar("+atom+")");
-		
+
 	if ( atom.getLabel()!=null ) {
 	    println(atom.getLabel() + " = " + lt1Value + ";");
 	}
-		
+
 	boolean oldsaveText = saveText;
 	saveText = saveText && atom.getAutoGenType()==GrammarElement.AUTO_GEN_NONE;
 	genMatch(atom);
@@ -228,7 +227,7 @@
 	// If debugging, create a new sempred vector for this grammar
 	if (g.debuggingOutput)
 	    semPreds = new Vector();
-			
+
 	setGrammar(g);
 	if (!(grammar instanceof LexerGrammar)) {
 	    tool.panic("Internal error generating lexer");
@@ -284,13 +283,13 @@
 	}
 	else {
 	    sup = "antlr." + grammar.getSuperClass();
-	}	
+	}
 
 	// print javadoc comment if any
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
+
 	print("public class " + grammar.getClassName() + " extends "+sup);
 	println(" implements " + grammar.tokenManager.getName() + TokenTypesFileSuffix+", TokenStream");
 	Token tsuffix = (Token)grammar.options.get("classHeaderSuffix");
@@ -350,7 +349,7 @@
 	    println("  ruleNames  = _ruleNames;");
 	    println("  semPredNames = _semPredNames;");
 	    println("  setupDebugging();");
-	}	
+	}
 
 	// Generate the initialization of a hashtable
 	// containing the string literals used in the lexer
@@ -369,7 +368,7 @@
 	    }
 	}
 	tabs--;
-		
+
 	Enumeration ids;
 	// Generate the setting of various generated options.
 	println("caseSensitiveLiterals = " + g.caseSensitiveLiterals + ";");
@@ -388,7 +387,7 @@
 		    println("  \""+((RuleSymbol)sym).getId()+"\",");
 	    }
 	    println("};");
-	}		
+	}
 
 	// Generate nextToken() rule.
 	// nextToken() is a synthetic lexer rule that is the implicit OR of all
@@ -416,7 +415,7 @@
 
 	println("");
 	println("}");
-		
+
 	// Close the lexer output stream
 	currentOutput.close();
 	currentOutput = null;
@@ -446,7 +445,7 @@
 	println(label+":");
 	println("do {");
 	tabs++;
-		
+
 	// Tell AST generation to build subrule result
 	String saveCurrentASTResult = currentASTResult;
 	if (blk.getLabel() != null) {
@@ -494,10 +493,10 @@
 	    println("// nongreedy exit test");
 	    println("if ( "+cnt+">=1 && "+predictExit+") break "+label+";");
 	}
-	
+
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, false);
 	genBlockFinish(
-		       howToFinish, 
+		       howToFinish,
 		       "if ( "+cnt+">=1 ) { break "+label+"; } else {" + throwNoViable + "}"
 		       );
 
@@ -534,7 +533,7 @@
 	genHeader();
 	// Do not use printAction because we assume tabs==0
 	println(behavior.getHeaderAction(""));
-		
+
 	// Generate header for the parser
 	println("import antlr.TokenBuffer;");
 	println("import antlr.TokenStreamException;");
@@ -552,7 +551,7 @@
 	println("import antlr.collections.AST;");
 	println("import antlr.ASTPair;");
 	println("import antlr.collections.impl.ASTArray;");
-		
+
 	// Output the user-defined parser preamble
 	println(grammar.preambleAction.getText());
 
@@ -567,7 +566,7 @@
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
+
 	println("public class " + grammar.getClassName() + " extends "+sup);
 	println("       implements " + grammar.tokenManager.getName() + TokenTypesFileSuffix);
 
@@ -593,7 +592,7 @@
 	    }
 	    println("};");
 	}
-		
+
 	// Generate user-defined parser class members
 	print(
 	      processActionForTreeSpecifiers(grammar.classMemberAction.getText(), 0, currentRule, null)
@@ -610,7 +609,7 @@
 	    println("  ruleNames  = _ruleNames;");
 	    println("  semPredNames = _semPredNames;");
 	    println("  setupDebugging(tokenBuf);");
-	}	
+	}
 	println("}");
 	println("");
 
@@ -699,17 +698,17 @@
 	// AST value for labeled rule refs in tree walker.
 	// This is not AST construction;  it is just the input tree node value.
 	if ( grammar instanceof TreeWalkerGrammar &&
-	     rr.getLabel() != null && 
+	     rr.getLabel() != null &&
 	     syntacticPredLevel == 0 )
 	    {
 		println(rr.getLabel() + " = _t==ASTNULL ? null : "+lt1Value+";");
 	    }
-		
+
 	// if in lexer and ! on rule ref or alt or rule, save buffer index to kill later
 	if ( grammar instanceof LexerGrammar && (!saveText||rr.getAutoGenType()==GrammarElement.AUTO_GEN_BANG) ) {
 	    println("_saveIndex=text.length();");
 	}
-		
+
 	// Process return value assignment if any
 	printTabs();
 	if (rr.idAssign != null)
@@ -741,12 +740,12 @@
 	    boolean doNoGuessTest = (
 				     grammar.hasSyntacticPredicate &&
 				     (
-				      grammar.buildAST && rr.getLabel() != null || 
+				      grammar.buildAST && rr.getLabel() != null ||
 				      (genAST && rr.getAutoGenType() == GrammarElement.AUTO_GEN_NONE)
 				      )
 				     );
 	    if (doNoGuessTest) {
-		println("if (inputState.guessing==0) {"); 
+		println("if (inputState.guessing==0) {");
 		tabs++;
 	    }
 
@@ -771,11 +770,11 @@
 	    // if a lexer and labeled, Token label defined at rule level, just set it here
 	    if ( grammar instanceof LexerGrammar && rr.getLabel() != null ) {
 		println(rr.getLabel()+"=_returnToken;");
-	    }	
+	    }
 
 	    if (doNoGuessTest) {
 		tabs--;
-		println("}"); 
+		println("}");
 	    }
 	}
 	genErrorCatchForElement(rr);
@@ -800,7 +799,7 @@
 
 	// matching
 	genMatch(atom);
-		
+
 	saveText = oldsaveText;
 
 	// tack on tree cursor motion if doing a tree walker
@@ -845,7 +844,7 @@
 	// matching
 	genMatch(atom);
 	genErrorCatchForElement(atom);
-		
+
 	// tack on tree cursor motion if doing a tree walker
 	if (grammar instanceof TreeWalkerGrammar) {
 	    println("_t = _t.getNextSibling();");
@@ -874,8 +873,8 @@
 	// match root
 	genMatch(t.root);
 	// move to list of children
-	println("_t = _t.getFirstChild();"); 
-		
+	println("_t = _t.getFirstChild();");
+
 	// walk list of children, generating code for each
 	for (int i=0; i<t.getAlternatives().size(); i++) {
 	    Alternative a = t.getAlternativeAt(i);
@@ -915,7 +914,7 @@
 	genHeader();
 	// Do not use printAction because we assume tabs==0
 	println(behavior.getHeaderAction(""));
-		
+
 	// Generate header for the parser
 	println("import antlr." + grammar.getSuperClass() + ";");
 	println("import antlr.Token;");
@@ -928,7 +927,7 @@
 	println("import antlr.collections.impl.BitSet;");
 	println("import antlr.ASTPair;");
 	println("import antlr.collections.impl.ASTArray;");
-	
+
 	// Output the user-defined parser premamble
 	println(grammar.preambleAction.getText());
 
@@ -939,14 +938,14 @@
 	}
 	else {
 	    sup = "antlr." + grammar.getSuperClass();
-	}	
+	}
 	println("");
 
 	// print javadoc comment if any
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
+
 	println("public class " + grammar.getClassName() + " extends "+sup);
 	println("       implements " + grammar.tokenManager.getName() + TokenTypesFileSuffix);
 	Token tsuffix = (Token)grammar.options.get("classHeaderSuffix");
@@ -1028,7 +1027,7 @@
 	else {
 	    println("matchNot(" + getValueString(Token.EOF_TYPE) + ");");
 	}
-		
+
 	// tack on tree cursor motion if doing a tree walker
 	if (grammar instanceof TreeWalkerGrammar) {
 	    println("_t = _t.getNextSibling();");
@@ -1097,10 +1096,10 @@
 	    println("// nongreedy exit test");
 	    println("if ("+predictExit+") break "+label+";");
 	}
-	
+
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, false);
 	genBlockFinish(howToFinish, "break " + label + ";");
-		
+
 	tabs--;
 	println("} while (true);");
 	println("}");
@@ -1142,7 +1141,7 @@
 				// Set the AST return value for the rule
 		RuleBlock rblk = (RuleBlock)blk;
 		println(rblk.getRuleName() + "_AST = ("+labeledElementASTType+")currentAST.root;");
-	    } 
+	    }
 	    else if (blk.getLabel() != null) {
 				// ### future: also set AST value for labeled subrules.
 				// println(blk.getLabel() + "_AST = ("+labeledElementASTType+")currentAST.root;");
@@ -1185,13 +1184,13 @@
 				// initialization data
 		println(
 			"private static final long " + getBitsetName(i) + "_data_" + "[] = { " +
-			p.toStringOfWords() + 
+			p.toStringOfWords() +
 			" };"
 			);
 				// BitSet object
 		println(
 			"public static final BitSet " + getBitsetName(i) + " = new BitSet(" +
-			getBitsetName(i) + "_data_" + 
+			getBitsetName(i) + "_data_" +
 			");"
 			);
 	    }
@@ -1251,7 +1250,7 @@
 			) {
 
 			if (
-			    !(a instanceof RuleRefElement) && 
+			    !(a instanceof RuleRefElement) &&
 			    ((AlternativeBlock)a).not &&
 			    analyzer.subruleCanBeInverted(((AlternativeBlock)a), grammar instanceof LexerGrammar)
 			    ) {
@@ -1272,7 +1271,7 @@
 			    }
 			    if ( grammar instanceof LexerGrammar ) {
 				println("Token "+a.getLabel()+"=null;");
-			    }	
+			    }
 			    if (grammar instanceof TreeWalkerGrammar) {
 				// always generate rule-ref variables
 				// for tree walker
@@ -1334,7 +1333,7 @@
 	    _print("case " + getValueString(elems[i]) + ":");
 
 	    if (j==wrap) {
-		_println(""); 
+		_println("");
 		startOfLine = true;
 		j=1;
 	    }
@@ -1359,7 +1358,7 @@
      * noTestForSingle If true, then it does not generate a test
      * for a single alternative.
      */
-    public JavaBlockFinishingInfo genCommonBlock(AlternativeBlock blk, 
+    public JavaBlockFinishingInfo genCommonBlock(AlternativeBlock blk,
 						 boolean noTestForSingle)
     {
 	int nIF=0;
@@ -1371,7 +1370,7 @@
 	// Save the AST generation state, and set it to that of the block
 	boolean savegenAST = genAST;
 	genAST = genAST && blk.getAutoGen();
-		
+
 	boolean oldsaveTest = saveText;
 	saveText = saveText && blk.getAutoGen();
 
@@ -1413,7 +1412,7 @@
 		{
 		    tool.warning(
 				 "Syntactic predicate superfluous for single alternative",
-				 grammar.getFilename(), 
+				 grammar.getFilename(),
 				 blk.getAlternativeAt(0).synPred.getLine()
 				 );
 		}
@@ -1433,7 +1432,7 @@
 	// because we don't explicitly have a test for them
 	// as an alt in the loop.
 	//
-	// Also, we now count how many unicode lookahead sets 
+	// Also, we now count how many unicode lookahead sets
 	// there are--they must be moved to DEFAULT or ELSE
 	// clause.
 	int nLL1 = 0;
@@ -1561,7 +1560,7 @@
 		    }
 		    else {
 			println("else {");
-		    }			
+		    }
 		    finishingInfo.needAnErrorClause = false;
 		}
 		else { // check for sem and syn preds
@@ -1617,7 +1616,7 @@
 			    println("if " + e + " {");
 			}
 		    }
-					
+
 		}
 
 		nIF++;
@@ -1634,7 +1633,7 @@
 
 	// Restore the AST generation state
 	genAST = savegenAST;
-		
+
 	// restore save text state
 	saveText=oldsaveTest;
 
@@ -1645,14 +1644,14 @@
 	    finishingInfo.generatedSwitch = true;
 	    finishingInfo.generatedAnIf = nIF>0;
 	    //return new JavaBlockFinishingInfo(ps+"}",true,nIF>0); // close up switch statement
-			
+
 	}
 	else {
 	    finishingInfo.postscript = ps;
 	    finishingInfo.generatedSwitch = false;
 	    finishingInfo.generatedAnIf = nIF>0;
 	    // return new JavaBlockFinishingInfo(ps, false,nIF>0);
-	}	
+	}
 	return finishingInfo;
     }
 
@@ -1730,7 +1729,7 @@
 
 	    // Enclose actions with !guessing
 	    if (doNoGuessTest) {
-		println("if (inputState.guessing==0) {"); 
+		println("if (inputState.guessing==0) {");
 		tabs++;
 	    }
 
@@ -1775,8 +1774,8 @@
 	}
     }
 
-    /** Close the try block and generate catch phrases 
-	 * if the element has a labeled handler in the rule 
+    /** Close the try block and generate catch phrases
+	 * if the element has a labeled handler in the rule
 	 */
     private void genErrorCatchForElement(AlternativeElement el) {
 	if (el.getLabel() == null) return;
@@ -1809,20 +1808,20 @@
 		    println("if (inputState.guessing==0) {");
 		    tabs++;
 		}
-			
+
 				// When not guessing, execute user handler action
 		printAction(
 			    processActionForTreeSpecifiers(handler.action.getText(), 0, currentRule, null)
 			    );
-				
+
 		if (grammar.hasSyntacticPredicate) {
 		    tabs--;
 		    println("} else {");
 		    tabs++;
 		    // When guessing, rethrow exception
 		    println(
-			    "throw " + 
-			    extractIdOfAction(handler.exceptionTypeAndName) + 
+			    "throw " +
+			    extractIdOfAction(handler.exceptionTypeAndName) +
 			    ";"
 			    );
 		    tabs--;
@@ -1897,20 +1896,20 @@
 	if (grammar instanceof TreeWalkerGrammar) {
 	    astArgs="_t,";
 	}
-		
+
 	// if in lexer and ! on element, save buffer index to kill later
 	if ( grammar instanceof LexerGrammar && (!saveText||atom.getAutoGenType()==GrammarElement.AUTO_GEN_BANG) ) {
 	    println("_saveIndex=text.length();");
 	}
-		
+
 	print(atom.not ? "matchNot(" : "match(");
 	_print(astArgs);
-		
+
 	// print out what to match
 	if (atom.atomText.equals("EOF")) {
 	    // horrible hack to handle EOF case
 	    _print("Token.EOF_TYPE");
-	} 
+	}
 	else {
 	    _print(atom.atomText);
 	}
@@ -1982,7 +1981,7 @@
 	if ( ((LexerGrammar)grammar).filterMode ) {
 	    filterRule = ((LexerGrammar)grammar).filterRule;
 	}
-		
+
 	println("");
 	println("public Token nextToken() throws TokenStreamException {");
 	tabs++;
@@ -2016,7 +2015,7 @@
 
 	println("try {   // for char stream error handling");
 	tabs++;
-		
+
 	// Generate try around whole thing to trap scanner errors
 	println("try {   // for lexical error handling");
 	tabs++;
@@ -2060,7 +2059,7 @@
 	if ( ((LexerGrammar)grammar).filterMode && filterRule!=null ) {
 	    println("commit();");
 	}
-		
+
 	// Generate literals test if desired
 	// make sure _ttype is set first; note _returnToken must be
 	// non-null as the rule was required to create it.
@@ -2073,7 +2072,7 @@
 	// return token created by rule reference in switch
 	println("_returnToken.setType(_ttype);");
 	println("return _returnToken;");
-		
+
 	// Close try block
 	tabs--;
 	println("}");
@@ -2163,7 +2162,7 @@
 	// Save the AST generation state, and set it to that of the rule
 	boolean savegenAST = genAST;
 	genAST = genAST && rblk.getAutoGen();
-		
+
 	// boolean oldsaveTest = saveText;
 	saveText = rblk.getAutoGen();
 
@@ -2171,7 +2170,7 @@
 	if ( s.comment!=null ) {
 	    _println(s.comment);
 	}
-		
+
 	// Gen method access and final qualifier
 	print(s.access + " final ");
 
@@ -2195,7 +2194,7 @@
 	}
 
 	// Gen arguments
-	if (rblk.argAction != null) 
+	if (rblk.argAction != null)
 	    {
 				// Has specified arguments
 		_println("");
@@ -2232,10 +2231,10 @@
 	// Convert return action to variable declaration
 	if (rblk.returnAction != null)
 	    println(rblk.returnAction + ";");
-		
+
 	// print out definitions needed by rules for various grammar types
 	println(commonLocalVars);
-		
+
 	if (grammar.traceRules) {
 	    if ( grammar instanceof TreeWalkerGrammar ) {
 		println("traceIn(\""+ s.getId() +"\",_t);");
@@ -2267,14 +2266,14 @@
 		println("fireEnterRule(" + ruleNum + ",0);");
 	    else if (grammar instanceof LexerGrammar)
 		println("fireEnterRule(" + ruleNum + ",_ttype);");
-   		    
 
+
 	// Generate trace code if desired
 	if ( grammar.debuggingOutput || grammar.traceRules) {
 	    println("try { // debugging");
 	    tabs++;
 	}
-		
+
 	// Initialize AST variables
 	if (grammar instanceof TreeWalkerGrammar) {
 	    // "Input" value for rule
@@ -2310,7 +2309,7 @@
 		genSemPred(pred, currentRule.line);
 	    if (alt.synPred != null) {
 		tool.warning(
-			     "Syntactic predicate ignored for single alternative", 
+			     "Syntactic predicate ignored for single alternative",
 			     grammar.getFilename(), alt.synPred.getLine()
 			     );
 	    }
@@ -2319,7 +2318,7 @@
 	else {
 	    // Multiple alternatives -- generate complex form
 	    boolean ok = grammar.theLLkAnalyzer.deterministic(rblk);
-		
+
 	    JavaBlockFinishingInfo howToFinish = genCommonBlock(rblk, false);
 	    genBlockFinish(howToFinish, throwNoViable);
 	}
@@ -2394,16 +2393,16 @@
 	    println("	_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));");
 	    println("}");
 	    println("_returnToken = _token;");
-	}	
+	}
 
 	// Gen the return statement if there is one (lexer has hard-wired return action)
 	if (rblk.returnAction != null) {
 	    println("return " + extractIdOfAction(rblk.returnAction, rblk.getLine()) + ";");
 	}
-		
+
 	if ( grammar.debuggingOutput || grammar.traceRules) {
 	    tabs--;
-	    println("} finally { // debugging");		
+	    println("} finally { // debugging");
 	    tabs++;
 
 	    // If debugging, generate calls to mark exit of rule
@@ -2412,7 +2411,7 @@
 		    println("fireExitRule(" + ruleNum + ",0);");
 		else if (grammar instanceof LexerGrammar)
 		    println("fireExitRule(" + ruleNum + ",_ttype);");
-   		    
+
 	    if (grammar.traceRules) {
 		if ( grammar instanceof TreeWalkerGrammar ) {
 		    println("traceOut(\""+ s.getId() +"\",_t);");
@@ -2429,17 +2428,17 @@
 	tabs--;
 	println("}");
 	println("");
-		
+
 	// Restore the AST generation state
 	genAST = savegenAST;
-		
+
 	// restore char save state
 	// saveText = oldsaveTest;
     }
-    private void GenRuleInvocation(RuleRefElement rr) {	
+    private void GenRuleInvocation(RuleRefElement rr) {
 	// dump rule name
 	_print(rr.targetRule + "(");
-			
+
 		// lexers must tell rule if it should set _returnToken
 	if ( grammar instanceof LexerGrammar ) {
 	    // if labeled, could access Token, so tell rule to create
@@ -2448,18 +2447,18 @@
 	    }
 	    else {
 		_print("false");
-	    }		
+	    }
 	    if (commonExtraArgs.length() != 0 || rr.args!=null ) {
 		_print(",");
 	    }
-	}	
+	}
 
 	// Extra arguments common to all rules for this grammar
 	_print(commonExtraArgs);
 	if (commonExtraArgs.length() != 0 && rr.args!=null ) {
 	    _print(",");
 	}
-		
+
 	// Process arguments to method, if any
 	RuleSymbol rs = (RuleSymbol)grammar.getSymbol(rr.targetRule);
 	if (rr.args != null)
@@ -2485,7 +2484,7 @@
 		}
 	    }
 	_println(");");
-		
+
 		// move down to the first child while parsing
 	if ( grammar instanceof TreeWalkerGrammar ) {
 	    println("_t = _retTree;");
@@ -2497,7 +2496,7 @@
 	pred = processActionForTreeSpecifiers(pred, line, currentRule, tInfo);
 	// ignore translation info...we don't need to do anything with it.
 	String escapedPred = charFormatter.escapeString(pred);
-	
+
 	// if debugging, wrap the semantic predicate evaluation in a method
 	// that can tell SemanticPredicateListeners the result
 	if (grammar.debuggingOutput && ((grammar instanceof ParserGrammar) || (grammar instanceof LexerGrammar)))
@@ -2514,7 +2513,7 @@
 	println("private String _semPredNames[] = {");
 	while(e.hasMoreElements())
 	    println("\""+e.nextElement()+"\",");
-	println("};");			
+	println("};");
     }
     protected void genSynPred(SynPredBlock blk, String lookaheadExpr) {
 	if ( DEBUG_CODE_GENERATOR ) System.out.println("gen=>("+blk+")");
@@ -2541,7 +2540,7 @@
 	if (grammar.debuggingOutput && ((grammar instanceof ParserGrammar) ||
 					(grammar instanceof LexerGrammar))) {
 	    println("fireSyntacticPredicateStarted();");
-	}	
+	}
 
 	syntacticPredLevel++;
 	println("try {");
@@ -2574,11 +2573,11 @@
 	    println("  fireSyntacticPredicateSucceeded();");
 	    println("else");
 	    println("  fireSyntacticPredicateFailed();");
-	}	
+	}
 
 	syntacticPredLevel--;
 	tabs--;
-		
+
 	// Close lookahead test
 	println("}");
 
@@ -2615,7 +2614,7 @@
 		    if ( ts!=null && ts.getParaphrase()!=null ) {
 			s = antlr.Tool.stripFrontBack(ts.getParaphrase(), "\"", "\"");
 		    }
-		}	
+		}
 		print(charFormatter.literalString(s));
 		if (i != v.size()-1) {
 		    _print(",");
@@ -2645,15 +2644,15 @@
 	// because they are all constants.
 	println("public interface " + tm.getName() + TokenTypesFileSuffix+" {");
 	tabs++;
+
 
-		
 	// Generate a definition for each token type
 	Vector v = tm.getVocabulary();
-		
+
 	// Do special tokens manually
 	println("int EOF = " + Token.EOF_TYPE + ";");
 	println("int NULL_TREE_LOOKAHEAD = " + Token.NULL_TREE_LOOKAHEAD + ";");
-		
+
 	for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
 	    String s = (String)v.elementAt(i);
 	    if (s != null) {
@@ -2666,7 +2665,7 @@
 		    else if ( sl.label != null ) {
 			println("int " + sl.label + " = " + i + ";");
 		    }
-		    else {	
+		    else {
 			String mangledName = mangleLiteral(s);
 			if (mangledName != null) {
 			    // We were able to create a meaningful mangled token name
@@ -2677,7 +2676,7 @@
 			else {
 			    println("// " + s + " = " + i);
 			}
-		    }	
+		    }
 		}
 		else if ( !s.startsWith("<") ) {
 		    println("int " + s + " = " + i + ";");
@@ -2757,7 +2756,7 @@
 	    }
 	}
 	e.append(")");
-	
+
 	return e.toString();
     }
 
@@ -2778,8 +2777,8 @@
 	    // that can see end of token.  E.g., A : {pred}? ('a')? ;
 	    return "true";
 	}
+
 
-				
 	/*
 	  boolean first = true;
 	  for (int i=1; i<=depth && i<=maxDepth; i++) {
@@ -2788,7 +2787,7 @@
 	  e.append(") && (");
 	  }
 	  first = false;
-			
+
 	  // Syn preds can yield <end-of-syn-pred> (epsilon) lookahead.
 	  // There is no way to predict what that token would be.  Just
 	  // allow anything instead.
@@ -2797,7 +2796,7 @@
 	  }
 	  else {
 	  e.append(getLookaheadTestTerm(i, p));
-	  }	
+	  }
 	  }
 
 	  e.append(")");
@@ -2830,7 +2829,7 @@
 	if ( degree == 0 ) {
 	    return "true";
 	}
-		
+
 	if (degree >= bitsetTestThreshold) {
 	    int bitsetIdx = markBitsetForGen(p);
 	    return getBitsetName(bitsetIdx) + ".member(" + ts + ")";
@@ -2862,8 +2861,8 @@
 	}
 	int begin = elems[0];
 	int end = elems[elems.length-1];
-	return 
-	    "(" + lookaheadString(k) + " >= " + getValueString(begin) + " && " + 
+	return
+	    "(" + lookaheadString(k) + " >= " + getValueString(begin) + " && " +
 	    lookaheadString(k) + " <= " + getValueString(end) + ")";
     }
 
@@ -2923,7 +2922,7 @@
     private String lookaheadString(int k) {
 	if (grammar instanceof TreeWalkerGrammar) {
 	    return "_t.getType()";
-	} 
+	}
 	return "LA(" + k + ")";
     }
 
@@ -2944,7 +2943,7 @@
 	}
 	if ( antlr.Tool.upperCaseMangledLiterals ) {
 	    mangled = mangled.toUpperCase();
-	}	
+	}
 	return mangled;
     }
 
@@ -2990,7 +2989,7 @@
 				// There is more than one element with this id
 		return null;
 	    } else if (s.equals(currentRule.getRuleName())) {
-				// a recursive call to the enclosing rule is 
+				// a recursive call to the enclosing rule is
 				// ambiguous with the rule itself.
 		return null;
 	    } else {
@@ -3005,8 +3004,8 @@
 	    if ( transInfo!=null ) {
 		if ( !in_var ) {
 		    transInfo.refRuleRoot = r;
-		}	
-	    }	
+		}
+	    }
 	    return r;
 	} else {
 	    // id does not map to anything -- return itself.
@@ -3062,7 +3061,7 @@
 		    if ( suffix != null ) {
 			labeledElementASTType = suffix;
 		    }
-		}		
+		}
 	    }
 	    labeledElementType = "Token ";
 	    labeledElementInit = "null";
@@ -3094,11 +3093,11 @@
 			labeledElementASTType = suffix;
 			labeledElementType = suffix;
 		    }
-		}		
+		}
 	    }
 	    if ( !g.hasOption("ASTLabelType") ) {
 		g.setOption("ASTLabelType", new Token(ANTLRTokenTypes.STRING_LITERAL,"AST"));
-	    }	
+	    }
 	    labeledElementInit = "null";
 	    commonExtraArgs = "_t";
 	    commonExtraParams = "AST _t";



1.4       +27 -27    e/src/jsrc/antlr/LLkAnalyzer.java

Index: LLkAnalyzer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/LLkAnalyzer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LLkAnalyzer.java	2001/10/26 03:08:51	1.3
+++ LLkAnalyzer.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LLkAnalyzer.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: LLkAnalyzer.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.BitSet;
@@ -93,7 +93,7 @@
 				if ( DEBUG_ANALYZER ) System.out.println("comparing "+i+" against alt "+j);
 				currentBlock.analysisAlt = j;	// which alt are we analyzing?
 				k = 1;	// always attempt minimum lookahead possible.
-				
+
 				// check to see if there is a lookahead depth that distinguishes
 				// between alternatives i and j.
 				Lookahead[] r = new Lookahead[grammar.maxk+1];
@@ -162,7 +162,7 @@
 						// removeCompetingPredictionSetsFromWildcard(aj.cache, aj.head, grammar.maxk);
 						wildcardAlt = aj;
 					}
-					
+
 					/* If the user specified warnWhenFollowAmbig=false, then we
 					 * can turn off this warning IFF one of the alts is empty;
 					 * that is, it points immediately at the end block.
@@ -189,8 +189,8 @@
 								!(ai.head instanceof BlockEndElement))) ) {
 						// System.out.println("greedy set to true; one alt empty");
 					}
-					
-						
+
+
 					/* We have no choice, but to report a nondetermism */
 					else {
 						tool.errorHandler.warnAltAmbiguity(
@@ -269,11 +269,11 @@
 		if ( DEBUG_ANALYZER ) System.out.println("deterministicImpliedPath");
 		for (int i=0; i<nalts; i++) {		// check follow against all alts
 			Alternative alt = blk.getAlternativeAt(i);
-			
+
 			if ( alt.head instanceof BlockEndElement ) {
 				tool.warning("empty alternative makes no sense in (...)* or (...)+", grammar.getFilename(), blk.getLine());
 			}
-			
+
 			k = 1;							// assume eac alt is LL(1) with exit branch
 			// check to see if there is a lookahead depth that distinguishes
 			// between alternative i and the exit branch.
@@ -355,7 +355,7 @@
 															   r,		// set of linear ambiguities
 															   i		// ambiguous alternative
 															   );
-					}		
+					}
 				}
 			else {
 				alt.lookaheadDepth = Math.max(alt.lookaheadDepth,k);
@@ -392,7 +392,7 @@
 			if ( DEBUG_ANALYZER ) {
 				System.out.println("cache entry FOLLOW("+k+") for "+rule+": "+end.cache[k].toString(",", charFormatter, grammar));
 			}
-			// if the cache is a complete computation then simply return entry 
+			// if the cache is a complete computation then simply return entry
 			if ( end.cache[k].cycle==null ) {
 				return (Lookahead)end.cache[k].clone();
 			}
@@ -459,7 +459,7 @@
 				// to be seen.
 				// p.fset.add(EPSILON_TYPE);
 				p.setEpsilon();
-			}	
+			}
 			else {
 				p.fset.add(Token.EOF_TYPE);
 			}
@@ -578,7 +578,7 @@
 		if (end.block instanceof TreeElement) {
 			p.combineWith(Lookahead.of(Token.NULL_TREE_LOOKAHEAD));
 		}
-		
+
 		/* Syntactic predicates such as ( (A)? )=> have no follow per se.
 		 * We cannot accurately say what would be matched following a
 		 * syntactic predicate (you MIGHT be ok if you said it was whatever
@@ -588,14 +588,14 @@
 		 */
 		else if ( end.block instanceof SynPredBlock ) {
 			p.setEpsilon();
-		}	
+		}
 
 		// compute what can follow the block
 		else {
 			Lookahead q = end.block.next.look(k);
 			p.combineWith(q);
 		}
-		
+
 		return p;
 	}
 
@@ -620,7 +620,7 @@
 	 */
 	public Lookahead look(int k, CharLiteralElement atom) {
 		if ( DEBUG_ANALYZER ) System.out.println("lookCharLiteral("+k+","+atom+")");
-		// Skip until analysis hits k==1 
+		// Skip until analysis hits k==1
 		if ( k>1 ) {
 			return atom.next.look(k-1);
 		}
@@ -648,7 +648,7 @@
 
 	public Lookahead look(int k, CharRangeElement r) {
 		if ( DEBUG_ANALYZER ) System.out.println("lookCharRange("+k+","+r+")");
-		// Skip until analysis hits k==1 
+		// Skip until analysis hits k==1
 		if ( k>1 ) {
 			return r.next.look(k-1);
 		}
@@ -661,12 +661,12 @@
 
 	public Lookahead look(int k, GrammarAtom atom) {
 		if ( DEBUG_ANALYZER ) System.out.println("look("+k+","+atom+"["+atom.getType()+"])");
-		
+
 		if ( lexicalAnalysis ) {
 			// MakeGrammar should have created a rule reference instead
 			tool.panic("token reference found in lexer");
 		}
-		// Skip until analysis hits k==1 
+		// Skip until analysis hits k==1
 		if ( k>1 ) {
 			return atom.next.look(k-1);
 		}
@@ -774,7 +774,7 @@
 		if ( DEBUG_ANALYZER ) System.out.println("back from rule ref to "+rr.targetRule);
 		// restore state of end block
 		end.noFOLLOW = saveEnd;
-		
+
 		// check for infinite recursion.  If a cycle is returned: trouble!
 		if ( p.cycle!=null ) {
 			tool.error("infinite recursion to rule "+p.cycle+" from rule "+
@@ -786,11 +786,11 @@
 			if ( DEBUG_ANALYZER )
 				System.out.println("rule ref to "+
 								   rr.targetRule+" has eps, depth: "+p.epsilonDepth);
-	
+
 			// remove epsilon
 			p.resetEpsilon();
 			// fset.clear(EPSILON_TYPE);
-			
+
 			// for each lookahead depth that saw epsilon
 			int[] depths = p.epsilonDepth.toArray();
 			p.epsilonDepth = null;		// clear all epsilon stuff
@@ -819,7 +819,7 @@
 			}
 		}
 		else {
-			// Skip until analysis hits k==1 
+			// Skip until analysis hits k==1
 			if ( k>1 ) {
 				return atom.next.look(k-1);
 			}
@@ -846,7 +846,7 @@
 
 	public Lookahead look(int k, TokenRangeElement r) {
 		if ( DEBUG_ANALYZER ) System.out.println("lookTokenRange("+k+","+r+")");
-		// Skip until analysis hits k==1 
+		// Skip until analysis hits k==1
 		if ( k>1 ) {
 			return r.next.look(k-1);
 		}
@@ -879,8 +879,8 @@
 
 	public Lookahead look(int k, WildcardElement wc) {
 		if ( DEBUG_ANALYZER ) System.out.println("look(" + k + "," + wc + ")");
-		
-		// Skip until analysis hits k==1 
+
+		// Skip until analysis hits k==1
 		if ( k>1 ) {
 			return wc.next.look(k-1);
 		}
@@ -928,7 +928,7 @@
 		if ( DEBUG_ANALYZER ) System.out.println("lookRuleName("+k+","+rule+")");
 		RuleSymbol rs = (RuleSymbol)grammar.getSymbol(rule);
 		RuleBlock rb = rs.getBlock();
-		
+
 		if ( rb.lock[k] ) {
 			if ( DEBUG_ANALYZER )
 				System.out.println("infinite recursion to rule "+rb.getRuleName());
@@ -972,14 +972,14 @@
 	}
 
 	/** Remove the prediction sets from preceding alternatives
-	 * and follow set, but *only* if this element is the first element 
+	 * and follow set, but *only* if this element is the first element
 	 * of the alternative.  The class members currenBlock and
 	 * currentBlock.analysisAlt must be set correctly.
 	 * @param b The prediction bitset to be modified
 	 * @el The element of interest
 	 */
 	private void removeCompetingPredictionSets(BitSet b, AlternativeElement el) {
-		// Only do this if the element is the first element of the alt, 
+		// Only do this if the element is the first element of the alt,
 		// because we are making an implicit assumption that k==1.
 		GrammarElement head = currentBlock.getAlternativeAt(currentBlock.analysisAlt).head;
 		// if element is #(. blah) then check to see if el is root



1.4       +2 -2      e/src/jsrc/antlr/LLkParser.java

Index: LLkParser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/LLkParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LLkParser.java	2001/10/26 03:08:51	1.3
+++ LLkParser.java	2001/11/29 20:33:26	1.4
@@ -4,10 +4,10 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LLkParser.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: LLkParser.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.io.IOException;
+
 
 /**An LL(k) parser.
  *



1.4       +3 -5      e/src/jsrc/antlr/LexerGrammar.java

Index: LexerGrammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/LexerGrammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LexerGrammar.java	2001/10/26 03:08:51	1.3
+++ LexerGrammar.java	2001/11/29 20:33:26	1.4
@@ -4,14 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LexerGrammar.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: LexerGrammar.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.io.IOException;
 import antlr.collections.impl.BitSet;
-import antlr.collections.impl.Vector;
+
+import java.io.IOException;
 
 /** Lexer-specific grammar subclass */
 class LexerGrammar extends Grammar {



1.4       +2 -2      e/src/jsrc/antlr/LexerSharedInputState.java

Index: LexerSharedInputState.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/LexerSharedInputState.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LexerSharedInputState.java	2001/10/26 03:08:51	1.3
+++ LexerSharedInputState.java	2001/11/29 20:33:26	1.4
@@ -4,11 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LexerSharedInputState.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: LexerSharedInputState.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.io.Reader;
 import java.io.InputStream;
+import java.io.Reader;
 
 /** This object contains the data associated with an
  *  input stream of characters.  Multiple lexers



1.4       +4 -4      e/src/jsrc/antlr/Lookahead.java

Index: Lookahead.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Lookahead.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Lookahead.java	2001/10/26 03:08:51	1.3
+++ Lookahead.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Lookahead.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: Lookahead.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.BitSet;
@@ -59,7 +59,7 @@
  * Here, LOOK(3,ref-to(b)) returns epsilon, but the depths are
  * {1, 2}; i.e., 3-(3-1) and 3-(3-2).  Those are the lookahead depths
  * past the rule ref needed for the local follow.
- * 
+ *
  * <p>
  * This is null unless an epsilon is created.
  *
@@ -109,11 +109,11 @@
 		if ( cycle==null ) {	// track at least one cycle
 			cycle = q.cycle;
 		}
-		
+
 		if ( q.containsEpsilon() ) {
 			hasEpsilon = true;
 		}
-			
+
 		// combine epsilon depths
 		if ( epsilonDepth!=null ) {
 			if ( q.epsilonDepth!=null ) {



1.4       +14 -14    e/src/jsrc/antlr/MakeGrammar.java

Index: MakeGrammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/MakeGrammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MakeGrammar.java	2001/10/26 03:08:51	1.3
+++ MakeGrammar.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: MakeGrammar.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: MakeGrammar.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.Stack;
@@ -13,7 +13,7 @@
 
 public class MakeGrammar extends DefineGrammarSymbols {
 
-	protected Stack blocks = new LList(); // track subrules--Stack<BlockContext>	
+	protected Stack blocks = new LList(); // track subrules--Stack<BlockContext>
 	protected RuleRefElement lastRuleRef;
 
 	protected RuleEndElement ruleEnd;   // used if not nested
@@ -144,7 +144,7 @@
 				}
 			}
 		}
-		
+
 		rb.setAutoGen(true);		// keep text of elements
 		rb.prepareForAnalysis();
 		//System.out.println(rb);
@@ -155,36 +155,36 @@
 	private AlternativeBlock createOptionalRuleRef(String rule, int line) {
 		// Make the subrule
 		AlternativeBlock blk = new AlternativeBlock(grammar, line, false);
-		
+
 		// Make sure rule is defined
  		String mrule = CodeGenerator.lexerRuleName(rule); // can only be a lexer rule!
 		if ( !grammar.isDefined(mrule) ) {
 			grammar.define(new RuleSymbol(mrule));
 		}
-		
+
 		// Make the rule ref element
  		Token t = new CommonToken(ANTLRTokenTypes.TOKEN_REF, rule);
  		t.setLine(line);
  		RuleRefElement rref =
 			new RuleRefElement(grammar, t, GrammarElement.AUTO_GEN_NONE);
-		
+
 		rref.enclosingRuleName = ruleBlock.ruleName;
-		
+
 		// Make the end of block element
 		BlockEndElement end = new BlockEndElement(grammar);
 		end.block = blk;		// end block points back to start of blk
-		
+
 		// Make an alternative, putting the rule ref into it
 		Alternative alt = new Alternative(rref);
 		alt.addElement(end); // last element in alt points to end of block
 
 		// Add the alternative to this block
 		blk.addAlternative(alt);
-		
+
 		// create an empty (optional) alt and add to blk
 		Alternative optAlt = new Alternative();
 		optAlt.addElement(end);	// points immediately to end of block
-		
+
 		blk.addAlternative(optAlt);
 
 		blk.prepareForAnalysis();
@@ -197,8 +197,8 @@
 							   String docComment)
 		throws SemanticException
 	{
-		//		if ( Character.isUpperCase(r.getText().charAt(0)) ) { 
- 		if ( r.type == ANTLRTokenTypes.TOKEN_REF ) { 
+		//		if ( Character.isUpperCase(r.getText().charAt(0)) ) {
+ 		if ( r.type == ANTLRTokenTypes.TOKEN_REF ) {
 			if (!(grammar instanceof LexerGrammar)) {
 				tool.error("Lexical rule "+r.getText()+
 						   " defined outside of lexer",
@@ -324,7 +324,7 @@
 				);
 			}
 		}
-		
+
 		// add the subrule as element if not a syn pred
 		if ( block instanceof SynPredBlock ) {
 			// record a reference to the recently-recognized syn pred in the
@@ -416,7 +416,7 @@
 
 		// Generate a warning for non-lowercase ASCII when case-insensitive
 		if (
-			!((LexerGrammar)grammar).caseSensitive && cl.getType() < 128 && 
+			!((LexerGrammar)grammar).caseSensitive && cl.getType() < 128 &&
 			Character.toLowerCase((char)cl.getType()) != (char)cl.getType()
 		) {
 			tool.warning("Character literal must be lowercase when caseSensitive=false", grammar.getFilename(), lit.getLine());



1.4       +4 -4      e/src/jsrc/antlr/MismatchedTokenException.java

Index: MismatchedTokenException.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/MismatchedTokenException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MismatchedTokenException.java	2001/10/26 03:08:51	1.3
+++ MismatchedTokenException.java	2001/11/29 20:33:26	1.4
@@ -4,14 +4,14 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: MismatchedTokenException.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: MismatchedTokenException.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import antlr.collections.impl.BitSet;
 import antlr.collections.AST;
+import antlr.collections.impl.BitSet;
 
 public class MismatchedTokenException extends RecognitionException {
-    // Token names array for formatting 
+    // Token names array for formatting
     String[] tokenNames;
     // The token that was encountered
     public Token token;
@@ -179,7 +179,7 @@
 	}
 	else if (tokenType < 0 || tokenType >= tokenNames.length) {
 	    return "<" + String.valueOf(tokenType) + ">";
-	} 
+	}
 	else {
 	    return tokenNames[tokenType];
 	}



1.4       +3 -3      e/src/jsrc/antlr/NameSpace.java

Index: NameSpace.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/NameSpace.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NameSpace.java	2001/10/26 03:08:51	1.3
+++ NameSpace.java	2001/11/29 20:33:26	1.4
@@ -10,13 +10,13 @@
  *
  * @author David Wagner (JPL/Caltech) 8-12-00
  *
- * $Id: NameSpace.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: NameSpace.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Vector;
-import java.util.Enumeration;
 import java.io.PrintWriter;
+import java.util.Enumeration;
 import java.util.StringTokenizer;
+import java.util.Vector;
 
 public class NameSpace
 {



1.4       +2 -40     e/src/jsrc/antlr/Parser.java

Index: Parser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Parser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Parser.java	2001/10/26 03:08:51	1.3
+++ Parser.java	2001/11/29 20:33:26	1.4
@@ -4,49 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Parser.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: Parser.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import antlr.collections.impl.BitSet;
 import antlr.collections.AST;
-import antlr.collections.impl.ASTArray;
-
-/**A generic ANTLR parser (LL(k) for k>=1) containing a bunch of
- * utility routines useful at any lookahead depth.  We distinguish between
- * the LL(1) and LL(k) parsers because of efficiency.  This may not be
- * necessary in the near future.
- *
- * Each parser object contains the state of the parse including a lookahead
- * cache (the form of which is determined by the subclass), whether or
- * not the parser is in guess mode, where tokens come from, etc...
- *
- * <p>
- * During <b>guess</b> mode, the current lookahead token(s) and token type(s)
- * cache must be saved because the token stream may not have been informed
- * to save the token (via <tt>mark</tt>) before the <tt>try</tt> block.
- * Guessing is started by:
- * <ol>
- * <li>saving the lookahead cache.
- * <li>marking the current position in the TokenBuffer.
- * <li>increasing the guessing level.
- * </ol>
- *
- * After guessing, the parser state is restored by:
- * <ol>
- * <li>restoring the lookahead cache.
- * <li>rewinding the TokenBuffer.
- * <li>decreasing the guessing level.
- * </ol>
- *
- * @see antlr.Token
- * @see antlr.TokenBuffer
- * @see antlr.Tokenizer
- * @see antlr.LL1Parser
- * @see antlr.LLkParser
- */
-
-import java.io.IOException;
-
+import antlr.collections.impl.BitSet;
 import antlr.debug.MessageListener;
 import antlr.debug.ParserListener;
 import antlr.debug.ParserMatchListener;



1.4       +3 -7      e/src/jsrc/antlr/ParserGrammar.java

Index: ParserGrammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ParserGrammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ParserGrammar.java	2001/10/26 03:08:51	1.3
+++ ParserGrammar.java	2001/11/29 20:33:26	1.4
@@ -4,14 +4,10 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ParserGrammar.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: ParserGrammar.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Hashtable;
-import java.util.Enumeration;
 import java.io.IOException;
-import antlr.collections.impl.BitSet;
-import antlr.collections.impl.Vector;
 
 
 /** Parser-specific grammar subclass */
@@ -30,7 +26,7 @@
 		// if debugging, choose the debugging version of the parser
 		if (debuggingOutput)
 			return "debug.LLkDebuggingParser";
-		return "LLkParser"; 
+		return "LLkParser";
 	}
 	/**Process command line arguments.
 	 * -trace			have all rules call traceIn/traceOut
@@ -80,7 +76,7 @@
 		if (key.equals("ASTLabelType")) {
 			super.setOption(key, value);
 			return true;
-		}	
+		}
 		if (super.setOption(key, value)) {
 			return true;
 		}



1.4       +8 -7      e/src/jsrc/antlr/RuleBlock.java

Index: RuleBlock.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/RuleBlock.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RuleBlock.java	2001/10/26 03:08:51	1.3
+++ RuleBlock.java	2001/11/29 20:33:26	1.4
@@ -4,10 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: RuleBlock.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: RuleBlock.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.Vector;
+
 import java.util.Hashtable;
 
 /**A list of alternatives and info contained in
@@ -65,7 +66,7 @@
 	    else {
 		grammar.tool.error("Rule '" + ruleName + "' already has an exception handler");
 	    }
-	} 
+	}
 	else {
 	    exceptionSpecs.put( (ex.label==null ? "" : ex.label.getText()), ex);
 	}
@@ -79,7 +80,7 @@
     public void generate() {
 	grammar.generator.gen(this);
     }
-    public boolean getDefaultErrorHandler() { 
+    public boolean getDefaultErrorHandler() {
 	return defaultErrorHandler;
     }
     public RuleEndElement getEndElement() {
@@ -105,7 +106,7 @@
 	lock = new boolean[grammar.maxk+1];
     }
     // rule option values
-    public void setDefaultErrorHandler(boolean value) { 
+    public void setDefaultErrorHandler(boolean value) {
 	defaultErrorHandler = value;
     }
     public void setEndElement(RuleEndElement re) {
@@ -120,7 +121,7 @@
 	    } else {
 		grammar.tool.error("Value for defaultErrorHandler must be true or false", grammar.getFilename(), key.getLine());
 	    }
-	} 
+	}
 	else if (key.getText().equals("testLiterals")) {
 	    if (!(grammar instanceof LexerGrammar)) {
 		grammar.tool.error("testLiterals option only valid for lexer rules", grammar.getFilename(), key.getLine());
@@ -142,7 +143,7 @@
 	    else {
 		ignoreRule = value.getText();
 	    }
-	} 
+	}
 	else if (key.getText().equals("paraphrase")) {
 	    if (!(grammar instanceof LexerGrammar)) {
 		grammar.tool.error("paraphrase option only valid for lexer rules", grammar.getFilename(), key.getLine());
@@ -155,7 +156,7 @@
 		}
 		ts.setParaphrase(value.getText());
 	    }
-	} 
+	}
 	else if (key.equals("generateAmbigWarnings")) {
 	    if (value.getText().equals("true")) {
 		generateAmbigWarnings = true;



1.4       +5 -5      e/src/jsrc/antlr/RuleRefElement.java

Index: RuleRefElement.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/RuleRefElement.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RuleRefElement.java	2001/10/26 03:08:51	1.3
+++ RuleRefElement.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: RuleRefElement.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: RuleRefElement.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 class RuleRefElement extends AlternativeElement {
@@ -42,8 +42,8 @@
 	public String getIdAssign() {
 		return idAssign;
 	}
-	public String getLabel() { 
-		return label; 
+	public String getLabel() {
+		return label;
 	}
 	public Lookahead look(int k) {
 		return grammar.theLLkAnalyzer.look(k, this);
@@ -54,8 +54,8 @@
 	public void setIdAssign(String id) {
 		idAssign = id;
 	}
-	public void setLabel(String label_) { 
-		label = label_; 
+	public void setLabel(String label_) {
+		label = label_;
 	}
 	public String toString() {
 		if ( args!=null ) return " "+targetRule+args;



1.4       +2 -2      e/src/jsrc/antlr/RuleSymbol.java

Index: RuleSymbol.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/RuleSymbol.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RuleSymbol.java	2001/10/26 03:08:51	1.3
+++ RuleSymbol.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: RuleSymbol.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: RuleSymbol.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.Vector;
@@ -17,7 +17,7 @@
 			// but we will almost always analyze/gen code
     String access;	// access specifier for this rule
     String comment;	// A javadoc comment if any.
-    
+
     public RuleSymbol(String r) {
 	super(r);
 	references = new Vector();



1.4       +8 -8      e/src/jsrc/antlr/SatherBlockFinishingInfo.java

Index: SatherBlockFinishingInfo.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/SatherBlockFinishingInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SatherBlockFinishingInfo.java	2001/10/26 03:08:51	1.3
+++ SatherBlockFinishingInfo.java	2001/11/29 20:33:26	1.4
@@ -4,15 +4,15 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: SatherBlockFinishingInfo.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: SatherBlockFinishingInfo.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-class SatherBlockFinishingInfo 
+class SatherBlockFinishingInfo
 {
     String postscript;		// what to generate to terminate block
     boolean generatedSwitch;    // did block finish with "default:" of switch?
     boolean generatedAnIf;
-	
+
     /** When generating an if or switch, end-of-token lookahead sets
      *  will become the else or default clause, don't generate an
      *  error clause in this case.
@@ -20,17 +20,17 @@
     boolean needAnErrorClause;
 
 
-    public SatherBlockFinishingInfo() 
+    public SatherBlockFinishingInfo()
     {
 	postscript=null;
 	generatedSwitch=generatedSwitch = false;
 	needAnErrorClause = true;
     }
 
-    public SatherBlockFinishingInfo( String ps, 
-				     boolean genS, 
-				     boolean generatedAnIf, 
-				     boolean n ) 
+    public SatherBlockFinishingInfo( String ps,
+				     boolean genS,
+				     boolean generatedAnIf,
+				     boolean n )
     {
 	postscript = ps;
 	generatedSwitch = genS;



1.4       +3 -3      e/src/jsrc/antlr/SatherCharFormatter.java

Index: SatherCharFormatter.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/SatherCharFormatter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SatherCharFormatter.java	2001/10/26 03:08:51	1.3
+++ SatherCharFormatter.java	2001/11/29 20:33:26	1.4
@@ -4,12 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: SatherCharFormatter.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: SatherCharFormatter.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.BitSet;
 
-class SatherCharFormatter implements CharFormatter 
+class SatherCharFormatter implements CharFormatter
 {
 
     /** Given a character value, return a string representing the character
@@ -20,7 +20,7 @@
      * @param c   The character of interest.
      * @param forCharLiteral  true to escape for char literal, false for string literal
      */
-    public String escapeChar(int c, boolean forCharLiteral) 
+    public String escapeChar(int c, boolean forCharLiteral)
     {
 	switch (c) {
 	    //		case GrammarAnalyzer.EPSILON_TYPE : return "<end-of-token>";



1.4       +157 -158  e/src/jsrc/antlr/SatherCodeGenerator.java

Index: SatherCodeGenerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/SatherCodeGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SatherCodeGenerator.java	2001/10/26 03:08:51	1.3
+++ SatherCodeGenerator.java	2001/11/29 20:33:26	1.4
@@ -4,24 +4,23 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: SatherCodeGenerator.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: SatherCodeGenerator.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Enumeration;
-import java.util.Hashtable;
 import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
-import java.io.PrintWriter; //SAS: changed for proper text file io
+
 import java.io.IOException;
-import java.io.FileWriter;
+import java.util.Enumeration;
+import java.util.Hashtable;
 
 /**Generate MY_PARSER.sa, MY_LEXER.sa and MY_PARSER_TOKENTYPES.sa */
 
-public class SatherCodeGenerator extends CodeGenerator 
+public class SatherCodeGenerator extends CodeGenerator
 {
     // non-zero if inside syntactic predicate generation
     protected int syntacticPredLevel = 0;
-	
+
 	// Are we generating ASTs (for parsers and tree parsers) right now?
     protected boolean genAST = false;
 
@@ -132,7 +131,7 @@
 
 	    ActionTransInfo tInfo = new ActionTransInfo();
 	    String actionStr = processActionForTreeSpecifiers(action.actionText, action.getLine(), currentRule, tInfo);
-			
+
 	    if ( tInfo.refRuleRoot!=null ) {
 				// Somebody referenced "#rule", make sure translated var is valid
 				// assignment to #rule is left as a ref also, meaning that assignments
@@ -140,10 +139,10 @@
 				// generated (unnecessarily).
 		println(tInfo.refRuleRoot + " := current_ast.root;");
 	    }
-			
+
 	    // dump the translated action
 	    printAction(actionStr);
-			
+
 	    if ( tInfo.assignToRoot ) {
 				// Somebody did a "#rule=", reset internal currentAST.root
 		println("current_ast.root := "+ tInfo.refRuleRoot + ";");
@@ -160,7 +159,7 @@
 		println("end; -- if");
 		println("current_ast.advance_child_to_end;");
 	    }
-		
+
 	    if ( grammar.hasSyntacticPredicate ) {
 		tabs--;
 		println("end; -- if");
@@ -182,7 +181,7 @@
 	}
 
 	boolean ok = grammar.theLLkAnalyzer.deterministic(blk);
-		
+
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, true);
 	genBlockFinish(howToFinish, throwNoViable);
 	println("");
@@ -205,11 +204,11 @@
 	 */
     public void gen(CharLiteralElement atom) {
 	if ( DEBUG_CODE_GENERATOR ) System.out.println("genChar("+atom+")");
-		
+
 	if ( atom.getLabel()!=null ) {
 	    println(atom.getLabel() + " := " + lt1Value + ";");
 	}
-		
+
 	boolean oldsaveText = saveText;
 	saveText = saveText && atom.getAutoGenType()==GrammarElement.AUTO_GEN_NONE;
 	genMatch(atom);
@@ -229,7 +228,7 @@
 	// If debugging, create a new sempred vector for this grammar
 	if (g.debuggingOutput)
 	    semPreds = new Vector();
-			
+
 	setGrammar(g);
 	if (!(grammar instanceof LexerGrammar)) {
 	    tool.panic("Internal error generating lexer");
@@ -259,14 +258,14 @@
 	}
 	else {
 	    sup = "ANTLR_CHAR_SCANNER{TOKEN}";
-	}	
+	}
 
 	// print javadoc comment if any
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
-	println("class " + grammar.getClassName() + 
+
+	println("class " + grammar.getClassName() +
 		"{TOKEN} < $ANTLR_TOKEN_STREAM{TOKEN} , $ANTLR_FILE_CURSOR is " );
 	tabs++;
 	println("include " + sup + " create -> private char_scanner_create;");
@@ -339,7 +338,7 @@
 	//			println("rule_names  := sa_rule_names;");
 	//                      println("sem_pred_names := sa_sem_pred_names;");
 	//                      println("setup_debugging;");
-	//		}	
+	//		}
 
 	// Generate the initialization of a hashtable
 	// containing the string literals used in the lexer
@@ -378,7 +377,7 @@
 		    println("  \""+((RuleSymbol)sym).getId()+"\",");
 	    }
 	    println("|;");
-	}		
+	}
 
 	// Generate nextToken() rule.
 	// nextToken() is a synthetic lexer rule that is the implicit OR of all
@@ -407,7 +406,7 @@
 	println("");
 	tabs--;
 	println("end; -- class");
-		
+
 	// Close the lexer output stream
 	currentOutput.close();
 	currentOutput = null;
@@ -434,10 +433,10 @@
 	//  		else {
 	//  			label = "_loop" + blk.ID;
 	//  		}
-	//		println(label+":"); 
+	//		println(label+":");
 	println("loop");
 	tabs++;
-		
+
 	// Tell AST generation to build subrule result
 	String saveCurrentASTResult = currentASTResult;
 	if (blk.getLabel() != null) {
@@ -485,10 +484,10 @@
 	    println("-- nongreedy exit test");
 	    println("if ( " + cnt + " >= 1 and " + predictExit + " ) then break! end; -- if");
 	}
-	
+
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, false);
 	genBlockFinish(
-		       howToFinish, 
+		       howToFinish,
 		       "if ( " + cnt + " >= 1 ) then break! else " + throwNoViable + " end; -- if"
 		       );
 
@@ -525,7 +524,7 @@
 	genHeader();
 	// Do not use printAction because we assume tabs==0
 	println(behavior.getHeaderAction(""));
-		
+
 	// Output the user-defined parser preamble
 	println(grammar.preambleAction.getText());
 
@@ -540,15 +539,15 @@
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
+
 	println("class " + grammar.getClassName() + "{ TOKEN < $ANTLR_TOKEN, AST < $ANTLR_AST{AST} } is");
 	tabs++;
 	println("include " + sup + "{ TOKEN, " + labeledElementASTType + " } create -> super_create;" );
-	println("include " + grammar.tokenManager.getName() + "_" 
+	println("include " + grammar.tokenManager.getName() + "_"
 		+ TokenTypesFileSuffix.toUpperCase() + ";" );
 
 	println("");
-		
+
 	/*
 	  Token tsuffix = (Token)grammar.options.get("classHeaderSuffix");
 	  if ( tsuffix != null ) {
@@ -572,7 +571,7 @@
 	    }
 	    println("|;");
 	}
-		
+
 	// Generate user-defined parser class members
 	print(
 	      processActionForTreeSpecifiers(grammar.classMemberAction.getText(), 0, currentRule, null)
@@ -592,7 +591,7 @@
 	    println("res.rule_names  := sa_rule_names;");
 	    println("res.sem_pred_names := sa_sem_pred_names;");
 	    println("res.setup_debugging( token_buf );");
-	}	
+	}
 	println("return res;");
 	tabs--;
 	println("end; -- create");
@@ -697,7 +696,7 @@
 	// AST value for labeled rule refs in tree walker.
 	// This is not AST construction;  it is just the input tree node value.
 	if ( grammar instanceof TreeWalkerGrammar &&
-	     rr.getLabel() != null && 
+	     rr.getLabel() != null &&
 	     syntacticPredLevel == 0 )
 	    {
 		println("if ( SYS::is_eq( sa_t , " + labeledElementASTType + "::ASTNULL ) ) then");
@@ -708,12 +707,12 @@
 		println(rr.getLabel() + " := " + lt1Value + ";" );
 		println("end; -- if");
 	    }
-		
+
 	// if in lexer and ! on rule ref or alt or rule, save buffer index to kill later
 	if ( grammar instanceof LexerGrammar && (!saveText||rr.getAutoGenType()==GrammarElement.AUTO_GEN_BANG) ) {
 	    println("sa_save_index := text.length;");
 	}
-		
+
 	// Process return value assignment if any
 	printTabs();
 	if (rr.idAssign != null)
@@ -745,12 +744,12 @@
 	    boolean doNoGuessTest = (
 				     grammar.hasSyntacticPredicate &&
 				     (
-				      grammar.buildAST && rr.getLabel() != null || 
+				      grammar.buildAST && rr.getLabel() != null ||
 				      (genAST && rr.getAutoGenType() == GrammarElement.AUTO_GEN_NONE)
 				      )
 				     );
 	    if (doNoGuessTest) {
-		println("if ( input_state.guessing = 0 ) then"); 
+		println("if ( input_state.guessing = 0 ) then");
 		tabs++;
 	    }
 
@@ -774,11 +773,11 @@
 	    // if a lexer and labeled, Token label defined at rule level, just set it here
 	    if ( grammar instanceof LexerGrammar && rr.getLabel() != null ) {
 		println(rr.getLabel()+" := sa_return_token;");
-	    }	
+	    }
 
 	    if (doNoGuessTest) {
 		tabs--;
-		println("end;"); 
+		println("end;");
 	    }
 	}
 	genErrorCatchForElement(rr);
@@ -803,7 +802,7 @@
 
 	// matching
 	genMatch(atom);
-		
+
 	saveText = oldsaveText;
 
 	// tack on tree cursor motion if doing a tree walker
@@ -880,8 +879,8 @@
 	// match root
 	genMatch(t.root);
 	// move to list of children
-	println("sa_t := sa_t.first_child;"); 
-		
+	println("sa_t := sa_t.first_child;");
+
 	// walk list of children, generating code for each
 	for (int i=0; i<t.getAlternatives().size(); i++) {
 	    Alternative a = t.getAlternativeAt(i);
@@ -921,7 +920,7 @@
 	genHeader();
 	// Do not use printAction because we assume tabs==0
 	println(behavior.getHeaderAction(""));
-		
+
 	// Output the user-defined parser premamble
 	println(grammar.preambleAction.getText());
 
@@ -932,19 +931,19 @@
 	}
 	else {
 	    sup = "ANTLR_TREE_PARSER";
-	}	
+	}
 
 	// print javadoc comment if any
 	if ( grammar.comment!=null ) {
 	    _println(grammar.comment);
 	}
-		
+
 	println("class " + grammar.getClassName() + "{AST < $ANTLR_AST{AST} } is" );
 	println("");
 	tabs++;
 
 	println("include " + sup + "{" + labeledElementASTType + "} create -> tree_parser_create;" );
-	println("include " + grammar.tokenManager.getName() + "_" 
+	println("include " + grammar.tokenManager.getName() + "_"
 		+ TokenTypesFileSuffix.toUpperCase() + ";" );
 	println("");
 
@@ -1034,12 +1033,12 @@
 		// kill text atom put in buffer
 		println("text := text.substring( 0 , sa_save_index);");
 	    }
-	    
+
 	}
 	else {
 	    println("match_not(" + getValueString(Token.EOF_TYPE) + ");");
 	}
-		
+
 	// tack on tree cursor motion if doing a tree walker
 	if (grammar instanceof TreeWalkerGrammar) {
 	    println("sa_t := sa_t.next_sibling;");
@@ -1062,7 +1061,7 @@
 	//		println(label+":");
 	println("loop");
 	tabs++;
-	
+
 	// Tell AST generation to build subrule result
 	String saveCurrentASTResult = currentASTResult;
 	if (blk.getLabel() != null) {
@@ -1109,7 +1108,7 @@
 	}
 
 	JavaBlockFinishingInfo howToFinish = genCommonBlock(blk, false);
-	genBlockFinish(howToFinish, "break!;" ); 
+	genBlockFinish(howToFinish, "break!;" );
 
 	tabs--;
 	println("end; -- loop ");
@@ -1150,7 +1149,7 @@
 				// Set the AST return value for the rule
 		RuleBlock rblk = (RuleBlock)blk;
 		println(rblk.getRuleName() + "_ast := current_ast.root;");
-	    } 
+	    }
 	    else if (blk.getLabel() != null) {
 				// ### future: also set AST value for labeled subrules.
 				// println(blk.getLabel() + "_ast = ("+labeledElementASTType+")currentAST.root;");
@@ -1182,12 +1181,12 @@
 			      Vector bitsetList,
 			      int maxVocabulary
 			      ) {
-	    
+
 	SatherCharFormatter satherCharFormatter = new SatherCharFormatter();
 
 	println("");
 
-	// here, I differ from the Java code generator.  Lexer's bitsets are implemented as 
+	// here, I differ from the Java code generator.  Lexer's bitsets are implemented as
 	// Sather sets of CHAR's, Parser bitesets as Sather sets INT's
 
 	if ( grammar instanceof LexerGrammar ) {
@@ -1203,15 +1202,15 @@
 
 		// initialization data
 		println(
-			"const " + bitsetData + 
+			"const " + bitsetData +
 			" : ARRAY{BOOL} := " +
 			"| " +
-			boolList + 
+			boolList +
 			" |;"
 			);
 		println( "const " + bitsetName + " : CHAR_SET := bitset( " +
 			 bitsetData + " );" );
-			    
+
 	    }
 	}
 	else {
@@ -1226,15 +1225,15 @@
 
 		// initialization data
 		println(
-			"const " + bitsetData + 
+			"const " + bitsetData +
 			" : ARRAY{INT} := " +
 			"| " +
-			charList + 
+			charList +
 			" |;"
 			);
 		println( "const " + bitsetName + " : INT_SET := int_set( " +
 			 bitsetData + " );" );
-			    
+
 	    }
 	}
     }
@@ -1302,7 +1301,7 @@
 			) {
 
 			if (
-			    !(a instanceof RuleRefElement) && 
+			    !(a instanceof RuleRefElement) &&
 			    ((AlternativeBlock)a).not &&
 			    analyzer.subruleCanBeInverted(((AlternativeBlock)a), grammar instanceof LexerGrammar)
 			    ) {
@@ -1321,7 +1320,7 @@
 			    }
 			    if ( grammar instanceof LexerGrammar ) {
 				println( a.getLabel() + " : $ANTLR_TOKEN; " );
-			    }	
+			    }
 			    if (grammar instanceof TreeWalkerGrammar) {
 				// always generate rule-ref variables for tree walker
 				println(  a.getLabel() + " : " + labeledElementType + " := " + labeledElementInit + ";");
@@ -1372,7 +1371,7 @@
 		_print(", " + getValueString(elems[i]) );
 
 	    if (j==wrap) {
-		_println(""); 
+		_println("");
 		startOfLine = true;
 		j=1;
 	    }
@@ -1389,14 +1388,14 @@
 	 * that needs to be generated at the end of the block.  Other routines
 	 * may append else-clauses and such for error checking before the postfix
 	 * is generated.
-	 * If the grammar is a lexer, then generate alternatives in an order where 
-	 * alternatives requiring deeper lookahead are generated first, and 
+	 * If the grammar is a lexer, then generate alternatives in an order where
+	 * alternatives requiring deeper lookahead are generated first, and
 	 * EOF in the lookahead set reduces the depth of the lookahead.
 	 * @param blk The block to generate
 	 * @param noTestForSingle If true, then it does not generate a test for a single alternative.
 	 */
     public JavaBlockFinishingInfo genCommonBlock(
-						 AlternativeBlock blk, 
+						 AlternativeBlock blk,
 						 boolean noTestForSingle)
     {
 	int nIF=0;
@@ -1408,7 +1407,7 @@
 	// Save the AST generation state, and set it to that of the block
 	boolean savegenAST = genAST;
 	genAST = genAST && blk.getAutoGen();
-		
+
 	boolean oldsaveTest = saveText;
 	saveText = saveText && blk.getAutoGen();
 
@@ -1450,7 +1449,7 @@
 		{
 		    tool.warning(
 				 "Syntactic predicate superfluous for single alternative",
-				 grammar.getFilename(), 
+				 grammar.getFilename(),
 				 blk.getAlternativeAt(0).synPred.getLine()
 				 );
 		}
@@ -1470,7 +1469,7 @@
 	// because we don't explicitly have a test for them
 	// as an alt in the loop.
 	//
-	// Also, we now count how many unicode lookahead sets 
+	// Also, we now count how many unicode lookahead sets
 	// there are--they must be moved to DEFAULT or ELSE
 	// clause.
 
@@ -1544,14 +1543,14 @@
 	    if ( DEBUG_CODE_GENERATOR ) System.out.println("checking depth "+altDepth);
 	    for (int i=0; i<blk.alternatives.size(); i++) {
 		Alternative alt = blk.getAlternativeAt(i);
-		if ( DEBUG_CODE_GENERATOR ) 
+		if ( DEBUG_CODE_GENERATOR )
 		    System.out.println("genAlt: "+i);
 		// if we made a switch above, ignore what we already
 		// took care of.  Specifically, LL(1) alts with no
 		// preds that do not have end-of-token in their
 		// prediction set
 		if ( createdLL1Switch && suitableForCaseExpression(alt) ) {
-		    if ( DEBUG_CODE_GENERATOR ) 
+		    if ( DEBUG_CODE_GENERATOR )
 			System.out.println("ignoring alt because it was in the switch");
 		    continue;
 		}
@@ -1570,7 +1569,7 @@
 		    }
 		    while ( effectiveDepth >= 1 &&
 			   alt.cache[effectiveDepth].containsEpsilon()
-			    ) 
+			    )
 			{
 			    effectiveDepth--;
 			}
@@ -1615,7 +1614,7 @@
 		    else {
 			println("else ");
 			defaultBlock = false;  // else is for an if statement, not a case statement.
-		    }			
+		    }
 		    finishingInfo.needAnErrorClause = false;
 
 		}
@@ -1628,19 +1627,19 @@
 
 			// if debugging, wrap the evaluation of the
 			// predicate in a method
-						
+
 			// translate $ and # references
 			ActionTransInfo tInfo = new ActionTransInfo();
-			String actionStr = processActionForTreeSpecifiers(alt.semPred, 
-									  blk.line, 
-									  currentRule, 
+			String actionStr = processActionForTreeSpecifiers(alt.semPred,
+									  blk.line,
+									  currentRule,
 									  tInfo);
 			// ignore translation info...we don't need to
 			// do anything with it.  call that will inform
 			// SemanticPredicateListeners of the result
 
-			if (((grammar instanceof ParserGrammar) || 
-			     (grammar instanceof LexerGrammar)) && 
+			if (((grammar instanceof ParserGrammar) ||
+			     (grammar instanceof LexerGrammar)) &&
 			    grammar.debuggingOutput )
 			    e = "("+e+" and fireSemanticPredicateEvaluated(antlr.debug.SemanticPredicateEvent.PREDICTING,"+
 				addSemPred(charFormatter.escapeString(actionStr))+","+actionStr+"))";
@@ -1678,8 +1677,8 @@
 			    println("if " + e + " then");
 			}
 		    }
-					
-		}	
+
+		}
 
 		nIF++;
 		tabs++;
@@ -1697,7 +1696,7 @@
 
 	// Restore the AST generation state
 	genAST = savegenAST;
-		
+
 	// restore save text state
 	saveText=oldsaveTest;
 
@@ -1708,14 +1707,14 @@
 	    finishingInfo.generatedSwitch = true;
 	    finishingInfo.generatedAnIf = nIF>0;
 	    //return new JavaBlockFinishingInfo(ps+"}",true,nIF>0); // close up switch statement
-			
+
 	}
 	else {
 	    finishingInfo.postscript = ps;
 	    finishingInfo.generatedSwitch = false;
 	    finishingInfo.generatedAnIf = nIF>0;
 	    // return new JavaBlockFinishingInfo(ps, false,nIF>0);
-	}	
+	}
 	return finishingInfo;
     }
 
@@ -1790,15 +1789,15 @@
 
 	    // Enclose actions with !guessing
 	    if (doNoGuessTest) {
-		println("if ( input_state.guessing = 0 ) then"); 
+		println("if ( input_state.guessing = 0 ) then");
 		tabs++;
 	    }
 
 	    // we need to find out the type of argument of
 	    // toke_factory::create.  Sather cannot
 	    // overload function unless their signatures
-	    // can clearly be disambiguated.  Therefore the 
-	    // AST::create( $ANTLR_AST ) : $ANTLR_AST 
+	    // can clearly be disambiguated.  Therefore the
+	    // AST::create( $ANTLR_AST ) : $ANTLR_AST
 	    //   and
 	    // AST::create( $ANTLR_TOKEN ) : $ANTLR_AST
 	    // cannot coexist.  Therefore we rename them
@@ -1811,8 +1810,8 @@
 		// make this the current AST type, used
 		// for supsequent AST create's, even though
 		// the may be temporary AST's
-		labeledElementASTType = astType; 
-	    }		
+		labeledElementASTType = astType;
+	    }
 
 	    String astCreateString;
 	    if ( grammar instanceof TreeWalkerGrammar )
@@ -1850,8 +1849,8 @@
 	    }
 	}
     }
-    /** Close the try block and generate catch phrases 
-	 * if the element has a labeled handler in the rule 
+    /** Close the try block and generate catch phrases
+	 * if the element has a labeled handler in the rule
 	 */
     private void genErrorCatchForElement(AlternativeElement el) {
 	if (el.getLabel() == null) return;
@@ -1883,12 +1882,12 @@
 		    println("if ( input_state.guessing = 0 ) then");
 		    tabs++;
 		}
-			
+
 		// When not guessing, execute user handler action
 		printAction(
 			    processActionForTreeSpecifiers(handler.action.getText(), 0, currentRule, null)
 			    );
-				
+
 		if (grammar.hasSyntacticPredicate) {
 		    tabs--;
 		    println("else");
@@ -1956,7 +1955,7 @@
 		genMatchUsingAtomText(atom);
 	    }
 	    else {
-		tool.error("cannot ref character literals in grammar: "+atom);				
+		tool.error("cannot ref character literals in grammar: "+atom);
 	    }
 	}
 	else if ( atom instanceof TokenRefElement ) {
@@ -1969,20 +1968,20 @@
 	if (grammar instanceof TreeWalkerGrammar) {
 	    astArgs="sa_t,";
 	}
-		
+
 	// if in lexer and ! on element, save buffer index to kill later
 	if ( grammar instanceof LexerGrammar && (!saveText||atom.getAutoGenType()==GrammarElement.AUTO_GEN_BANG) ) {
 	    println("sa_save_index := text.length;");
 	}
-		
+
 	print(atom.not ? "match_not(" : "match(");
 	_print(astArgs);
-		
+
 	// print out what to match
 	if (atom.atomText.equals("EOF")) {
 	    // horrible hack to handle EOF case
 	    _print("ANTLR_COMMON_TOKEN::EOF_TYPE");
-	} 
+	}
 	else {
 	    _print(atom.atomText);
 	}
@@ -2009,7 +2008,7 @@
 
     /** Generate the nextToken() rule.  nextToken() is a synthetic
       * lexer rule that is the implicit OR of all user-defined lexer
-      * rules.  
+      * rules.
       */
     public void genNextToken() {
 	// Are there any public rules?  If not, then just generate a
@@ -2058,7 +2057,7 @@
 	if ( ((LexerGrammar)grammar).filterMode ) {
 	    filterRule = ((LexerGrammar)grammar).filterRule;
 	}
-		
+
 	println("");
 	println("next_token : TOKEN is");
 	tabs++;
@@ -2141,7 +2140,7 @@
 	    tabs--;
 	    println("end; -- if");
 	}
-		
+
 	// Generate literals test if desired
 	// make sure _ttype is set first; note _returnToken must be
 	// non-null as the rule was required to create it.
@@ -2166,7 +2165,7 @@
 	    if ( filterRule==null ) {
 		println("if ( ~commit_to_path ) then");
 		tabs++;
-		println("consume;");	
+		println("consume;");
 		tabs--;
 		println("end; -- if");
 	    }
@@ -2257,7 +2256,7 @@
 	// Save the AST generation state, and set it to that of the rule
 	boolean savegenAST = genAST;
 	genAST = genAST && rblk.getAutoGen();
-		
+
 	// boolean oldsaveTest = saveText;
 	saveText = rblk.getAutoGen();
 
@@ -2265,7 +2264,7 @@
 	if ( s.comment!=null ) {
 	    _println(s.comment);
 	}
-		
+
 	// Gen method name
 	print( s.getId() );
 
@@ -2276,18 +2275,18 @@
 	if (commonExtraParams.length() != 0 ) {
 	    hasArgs = true;
 	    _print("( " + commonExtraParams);
-	    if ( rblk.argAction != null ) 
+	    if ( rblk.argAction != null )
 		_print(",");
 	}
 
-	if ( rblk.argAction != null ) 
+	if ( rblk.argAction != null )
 	    if ( !hasArgs ) {
 		hasArgs = true;
 		_print("( ");
 	    }
 
 	// Gen arguments
-	if (rblk.argAction != null) 
+	if (rblk.argAction != null)
 	    {
 		// Has specified arguments
 		print(rblk.argAction);
@@ -2301,7 +2300,7 @@
 	    {
 		// Has specified return value
 		_print( " : " + extractSatherTypeOfAction(rblk.returnAction) );
-	    } 
+	    }
 
 	_println(" is");
 	tabs++;
@@ -2309,10 +2308,10 @@
 	// Convert return action to variable declaration
 	if (rblk.returnAction != null)
 	    println(rblk.returnAction + ";");
-		
+
 	// print out definitions needed by rules for various grammar types
 	println(commonLocalVars);
-		
+
 	if (grammar.traceRules) {
 	    if ( grammar instanceof TreeWalkerGrammar ) {
 		println("trace_in(\""+ s.getId() +"\",sa_t);");
@@ -2344,14 +2343,14 @@
 		println("fire_enter_rule( " + ruleNum + ", 0 );");
 	    else if (grammar instanceof LexerGrammar)
 		println("fire_enter_rule( " + ruleNum + ", sa_ttype );");
-   		    
 
+
 	// Generate trace code if desired
 	if ( grammar.debuggingOutput || grammar.traceRules) {
 	    println("protect -- debugging output");
 	    tabs++;
 	}
-		
+
 	// Initialize AST variables
 	if (grammar instanceof TreeWalkerGrammar) {
 	    // "Input" value for rule
@@ -2387,7 +2386,7 @@
 		genSemPred(pred, currentRule.line);
 	    if (alt.synPred != null) {
 		tool.warning(
-			     "Syntactic predicate ignored for single alternative", 
+			     "Syntactic predicate ignored for single alternative",
 			     grammar.getFilename(), alt.synPred.getLine()
 			     );
 	    }
@@ -2396,7 +2395,7 @@
 	else {
 	    // Multiple alternatives -- generate complex form
 	    boolean ok = grammar.theLLkAnalyzer.deterministic(rblk);
-		
+
 	    JavaBlockFinishingInfo howToFinish = genCommonBlock(rblk, false);
 	    genBlockFinish(howToFinish, throwNoViable);
 	}
@@ -2478,13 +2477,13 @@
 	    tabs--;
 	    println("end; -- if");
 	    println("sa_return_token := sa_token;");
-	}	
+	}
 
 	// Gen the return statement if there is one (lexer has hard-wired return action)
 	if (rblk.returnAction != null) {
 	    println("return " + extractSatherIdOfAction( rblk.returnAction, rblk.getLine() ) + ";");
 	}
-		
+
 	if ( grammar.debuggingOutput || grammar.traceRules) {
 
 	    // since Sather doesn't have anything similar to
@@ -2494,7 +2493,7 @@
 	    // exception is thrown
 
 	    tabs--;
-	    println("when $STR then -- assume this will catch everything");		
+	    println("when $STR then -- assume this will catch everything");
 	    tabs++;
 
 	    // cache debugging statements since they will have
@@ -2508,7 +2507,7 @@
 		    fire = "fire_exit_rule(" + ruleNum + ",0);";
 		else if (grammar instanceof LexerGrammar)
 		    fire = "fire_exit_rule(" + ruleNum + ", sa_ttype);";
-   		    
+
 	    if (grammar.traceRules) {
 		if ( grammar instanceof TreeWalkerGrammar ) {
 		    trace = "trace_out(\""+ s.getId() +"\", sa_t);";
@@ -2543,17 +2542,17 @@
 	tabs--;
 	println("end; -- rule");
 	println("");
-		
+
 	// Restore the AST generation state
 	genAST = savegenAST;
-		
+
 	// restore char save state
 	// saveText = oldsaveTest;
     }
-    private void GenRuleInvocation(RuleRefElement rr) {	
+    private void GenRuleInvocation(RuleRefElement rr) {
 	// dump rule name
 	_print( rr.targetRule );
-			
+
 	boolean hasArgs = false; // flag to let us know if we need to close the arg list
 	// lexers must tell rule if it should set _returnToken
 	if ( grammar instanceof LexerGrammar ) {
@@ -2564,11 +2563,11 @@
 	    }
 	    else {
 		_print("( false");
-	    }		
+	    }
 	    if (commonExtraArgs.length() != 0 || rr.args!=null ) {
 		_print(",");
 	    }
-	}	
+	}
 	else if ( commonExtraArgs.length() != 0 || rr.args != null ) {
 	    hasArgs = true;
 	    _print( "( " );
@@ -2579,7 +2578,7 @@
 	if (commonExtraArgs.length() != 0 && rr.args!=null ) {
 	    _print(",");
 	}
-		
+
 	// Process arguments to method, if any
 	RuleSymbol rs = (RuleSymbol)grammar.getSymbol(rr.targetRule);
 	if (rr.args != null)
@@ -2605,11 +2604,11 @@
 		}
 	    }
 
-	if ( hasArgs ) 
+	if ( hasArgs )
 	    _print(" )");
 
 	_println(";");
-		
+
 	// move down to the first child while parsing
 	if ( grammar instanceof TreeWalkerGrammar ) {
 	    println("sa_t := sa_ret_tree;");
@@ -2621,7 +2620,7 @@
 	pred = processActionForTreeSpecifiers(pred, line, currentRule, tInfo);
 	// ignore translation info...we don't need to do anything with it.
 	String escapedPred = charFormatter.escapeString(pred);
-	
+
 	// if debugging, wrap the semantic predicate evaluation in a method
 	// that can tell SemanticPredicateListeners the result
 	if (grammar.debuggingOutput && ((grammar instanceof ParserGrammar) || (grammar instanceof LexerGrammar)))
@@ -2641,7 +2640,7 @@
 	println("private String _semPredNames[] = {");
 	while(e.hasMoreElements())
 	    println("\""+e.nextElement()+"\",");
-	println("};");			
+	println("};");
     }
     protected void genSynPred(SynPredBlock blk, String lookaheadExpr) {
 	if ( DEBUG_CODE_GENERATOR ) System.out.println("gen=>("+blk+")");
@@ -2668,7 +2667,7 @@
 	if (grammar.debuggingOutput && ((grammar instanceof ParserGrammar) ||
 					(grammar instanceof LexerGrammar))) {
 	    println("fireSyntacticPredicateStarted();");
-	}	
+	}
 
 	syntacticPredLevel++;
 	println("protect");
@@ -2705,11 +2704,11 @@
 	    println("  fireSyntacticPredicateFailed();");
 	    tabs--;
 	    println("end; -- if");
-	}	
+	}
 
 	syntacticPredLevel--;
 	tabs--;
-		
+
 	// Close lookahead test
 	println("end; -- if");
 
@@ -2746,7 +2745,7 @@
 		    if ( ts!=null && ts.getParaphrase()!=null ) {
 			s = antlr.Tool.stripFrontBack(ts.getParaphrase(), "\"", "\"");
 		    }
-		}	
+		}
 		print(charFormatter.literalString(s));
 		if (i != v.size()-1) {
 		    _print(",");
@@ -2776,15 +2775,15 @@
 	// because they are all constants.
 	println("class " + tm.getName() + "_" + TokenTypesFileSuffix.toUpperCase() +" is");
 	tabs++;
+
 
-		
 	// Generate a definition for each token type
 	Vector v = tm.getVocabulary();
-		
+
 	// Do special tokens manually
 	println("const EOF : INT := " + Token.EOF_TYPE + ";");
 	println("const NULL_TREE_LOOKAHEAD : INT := " + Token.NULL_TREE_LOOKAHEAD + ";");
-		
+
 	for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
 	    String s = (String)v.elementAt(i);
 	    if (s != null) {
@@ -2797,7 +2796,7 @@
 		    else if ( sl.label != null ) {
 			println( "const " + sl.label + " : INT" + " := " + i + ";");
 		    }
-		    else {	
+		    else {
 			String mangledName = mangleLiteral(s);
 			if (mangledName != null) {
 			    // We were able to create a meaningful mangled token name
@@ -2808,7 +2807,7 @@
 			else {
 			    println("-- " + s + " := " + i);
 			}
-		    }	
+		    }
 		}
 		else if ( !s.startsWith("<") ) {
 		    println( "const " + s + " : INT" + " := " + i + ";");
@@ -2823,8 +2822,8 @@
 	println( "return #CHAR_SET( bool_array );" );
 	tabs--;
 	println("end;");
-		
 
+
 	// convert the INT array into INT_SET instance
 	println("");
 	println("int_set ( int_array : ARRAY{INT} ) : INT_SET is");
@@ -2870,7 +2869,7 @@
 	}
     }
 
-    protected String getLookaheadTestExpression(Lookahead[] look, int k) 
+    protected String getLookaheadTestExpression(Lookahead[] look, int k)
     {
 
 	StringBuffer e = new StringBuffer(100);
@@ -2894,7 +2893,7 @@
 	    }
 	}
 	e.append(")");
-	
+
 	return e.toString();
     }
 
@@ -2915,7 +2914,7 @@
 	    // that can see end of token.  E.g., A : {pred}? ('a')? ;
 	    return "true";
 	}
-				
+
 	/*
 	  boolean first = true;
 	  for (int i=1; i<=depth && i<=maxDepth; i++) {
@@ -2924,7 +2923,7 @@
 	  e.append(") and (");
 	  }
 	  first = false;
-			
+
 	  // Syn preds can yield <end-of-syn-pred> (epsilon) lookahead.
 	  // There is no way to predict what that token would be.  Just
 	  // allow anything instead.
@@ -2933,8 +2932,8 @@
 	  }
 	  else {
 	  e.append(getLookaheadTestTerm(i, p));
-	  }	
 	  }
+	  }
 
 	  e.append(")");
 	*/
@@ -2996,8 +2995,8 @@
 	}
 	int begin = elems[0];
 	int end = elems[elems.length-1];
-	return 
-	    "(" + lookaheadString(k) + " >= " + getValueString(begin) + " and " + 
+	return
+	    "(" + lookaheadString(k) + " >= " + getValueString(begin) + " and " +
 	    lookaheadString(k) + " <= " + getValueString(end) + ")";
     }
     /** getValueString: get a string representation of a token or char value
@@ -3054,7 +3053,7 @@
     private String lookaheadString(int k) {
 	if (grammar instanceof TreeWalkerGrammar) {
 	    return "sa_t.ttype";
-	} 
+	}
 	return "LA(" + k + ")";
     }
     /** Mangle a string literal into a meaningful token name.  This is
@@ -3074,7 +3073,7 @@
 	}
 	if ( antlr.Tool.upperCaseMangledLiterals ) {
 	    mangled = mangled.toUpperCase();
-	}	
+	}
 	return mangled;
     }
     /** Map an identifier to it's corresponding tree-node variable.
@@ -3119,7 +3118,7 @@
 				// There is more than one element with this id
 		return null;
 	    } else if (s.equals(currentRule.getRuleName())) {
-				// a recursive call to the enclosing rule is 
+				// a recursive call to the enclosing rule is
 				// ambiguous with the rule itself.
 		return null;
 	    } else {
@@ -3134,8 +3133,8 @@
 	    if ( transInfo!=null ) {
 		if ( !in_var ) {
 		    transInfo.refRuleRoot = r;
-		}	
-	    }	
+		}
+	    }
 	    return r;
 	} else {
 	    // id does not map to anything -- return itself.
@@ -3190,8 +3189,8 @@
 	      if ( suffix != null ) {
 	      labeledElementASTType = suffix;
 	      }
-	      }		
 	      }
+	      }
 	    */
 	    labeledElementType = "$ANTLR_TOKEN";
 	    labeledElementInit = "void";
@@ -3223,13 +3222,13 @@
 	      if ( suffix != null ) {
 	      labeledElementASTType = suffix;
 	      labeledElementType = suffix;
+	      }
 	      }
-	      }		
 	      }
 	    */
 	    if ( !g.hasOption("ASTLabelType") ) {
 		g.setOption("ASTLabelType", new Token(ANTLRTokenTypes.STRING_LITERAL,"AST"));
-	    }	
+	    }
 	    labeledElementInit = "void";
 	    commonExtraArgs = "sa_t";
 	    commonExtraParams = "sa_t : " + labeledElementASTType;
@@ -3289,15 +3288,15 @@
     /** Lexically process tree-specifiers in the action.
      *  This will replace @id and @(...) with the appropriate
      *  function calls and/or variables.
-     * 
+     *
      *  Override the default implementation inherited from CodeGenerator
      *  in order to instantiate the Sather's ActionLexer rather than Java's
      */
 
-    protected String processActionForTreeSpecifiers( String actionStr, 
-						     int line, 
-						     RuleBlock currentRule, 
-						     ActionTransInfo tInfo ) 
+    protected String processActionForTreeSpecifiers( String actionStr,
+						     int line,
+						     RuleBlock currentRule,
+						     ActionTransInfo tInfo )
     {
 	if ( actionStr==null || actionStr.length() == 0 ) return null;
 	// The action trans info tells us (at the moment) whether an
@@ -3307,7 +3306,7 @@
 	     grammar instanceof TreeWalkerGrammar ||
 	     (grammar instanceof LexerGrammar && actionStr.indexOf('%') != -1) ) {
 	    // Create a lexer to read an action and return the translated version
-	    antlr.actions.sather.ActionLexer lexer = 
+	    antlr.actions.sather.ActionLexer lexer =
 		new antlr.actions.sather.ActionLexer(actionStr, currentRule, this, tInfo);
 	    lexer.setLineOffset(line);
 	    lexer.setTool(tool);



1.4       +5 -5      e/src/jsrc/antlr/SimpleTokenManager.java

Index: SimpleTokenManager.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/SimpleTokenManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SimpleTokenManager.java	2001/10/26 03:08:51	1.3
+++ SimpleTokenManager.java	2001/11/29 20:33:26	1.4
@@ -4,13 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: SimpleTokenManager.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: SimpleTokenManager.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.io.*;
-import java.util.Hashtable;
-import java.util.Enumeration;
 import antlr.collections.impl.Vector;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
 class SimpleTokenManager implements TokenManager, Cloneable {
 	protected int maxToken = Token.MIN_USER_TYPE;
 	// Token vocabulary is Vector of String's
@@ -85,7 +85,7 @@
 	return table.keys();
 }
 	/** Get the token vocabulary (read-only).
-	 * @return A Vector of TokenSymbol 
+	 * @return A Vector of TokenSymbol
 	 */
 	public Vector getVocabulary() {
 		return vocabulary;



1.4       +3 -3      e/src/jsrc/antlr/Token.java

Index: Token.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Token.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Token.java	2001/10/26 03:08:51	1.3
+++ Token.java	2001/11/29 20:33:26	1.4
@@ -4,11 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Token.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: Token.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 /** A token is minimally a token type.  Subclasses can add the text matched
- *  for the token and line info. 
+ *  for the token and line info.
  */
 public class Token implements Cloneable {
 	// constants
@@ -20,7 +20,7 @@
 
 	// each Token has at least a token type
 	int type=INVALID_TYPE;
-	
+
 	// the illegal token object
 	public static Token badToken = new Token(INVALID_TYPE, "<no text>");
 



1.4       +4 -4      e/src/jsrc/antlr/TokenBuffer.java

Index: TokenBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenBuffer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenBuffer.java	2001/10/26 03:08:51	1.3
+++ TokenBuffer.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenBuffer.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenBuffer.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 /**A Stream of Token objects fed to the parser from a Tokenizer that can
@@ -21,9 +21,9 @@
  * @see antlr.Tokenizer
  * @see antlr.TokenQueue
  */
- 
-import java.io.IOException;
 
+
+
 public class TokenBuffer {
 
 	// Token source
@@ -52,7 +52,7 @@
 		numToConsume++;
 	}
 	/** Ensure that the token buffer is sufficiently full */
-	private final void fill(int amount) throws TokenStreamException 
+	private final void fill(int amount) throws TokenStreamException
 	{
 		syncConsume();
 		// Fill the buffer sufficiently to hold needed tokens



1.4       +3 -3      e/src/jsrc/antlr/TokenManager.java

Index: TokenManager.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenManager.java	2001/10/26 03:08:51	1.3
+++ TokenManager.java	2001/11/29 20:33:26	1.4
@@ -4,12 +4,12 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenManager.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenManager.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Hashtable;
-import java.util.Enumeration;
 import antlr.collections.impl.Vector;
+
+import java.util.Enumeration;
 
 /** Interface that describes the set of defined tokens */
 interface TokenManager {



1.4       +4 -4      e/src/jsrc/antlr/TokenQueue.java

Index: TokenQueue.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenQueue.java	2001/10/26 03:08:51	1.3
+++ TokenQueue.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenQueue.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenQueue.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 /** A private circular buffer object used by the token buffer */
@@ -40,7 +40,7 @@
 	/** Fetch a token from the queue by index
 	 * @param idx The index of the token to fetch, where zero is the token at the front of the queue
 	 */
-	public final Token elementAt(int idx) { 
+	public final Token elementAt(int idx) {
 		return buffer[(offset + idx) & sizeLessOne];
 	}
 	/** Expand the token buffer by doubling its capacity */
@@ -48,7 +48,7 @@
 	{
 		Token[] newBuffer = new Token[buffer.length * 2];
 		// Copy the contents to the new buffer
-		// Note that this will store the first logical item in the 
+		// Note that this will store the first logical item in the
 		// first physical array element.
 		for (int i = 0; i < buffer.length; i++)
 		{
@@ -71,7 +71,7 @@
 		nbrEntries = 0;
 	}
 	/** Remove token from front of queue */
-	public final void removeFirst() { 
+	public final void removeFirst() {
 		offset = (offset+1) & sizeLessOne;
 		nbrEntries--;
 	}



1.4       +3 -3      e/src/jsrc/antlr/TokenRangeElement.java

Index: TokenRangeElement.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenRangeElement.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenRangeElement.java	2001/10/26 03:08:51	1.3
+++ TokenRangeElement.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenRangeElement.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenRangeElement.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 class TokenRangeElement extends AlternativeElement {
@@ -32,8 +32,8 @@
 	public Lookahead look(int k) {
 		return grammar.theLLkAnalyzer.look(k, this);
 	}
-	public void setLabel(String label_) { 
-		label = label_; 
+	public void setLabel(String label_) {
+		label = label_;
 	}
 	public String toString() {
 	    if ( label!=null ) {



1.4       +4 -4      e/src/jsrc/antlr/TokenStreamHiddenTokenFilter.java

Index: TokenStreamHiddenTokenFilter.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenStreamHiddenTokenFilter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenStreamHiddenTokenFilter.java	2001/10/26 03:08:51	1.3
+++ TokenStreamHiddenTokenFilter.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenStreamHiddenTokenFilter.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenStreamHiddenTokenFilter.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 import antlr.collections.impl.BitSet;
@@ -21,7 +21,7 @@
 	protected BitSet hideMask;
 
 	private CommonHiddenStreamToken nextMonitoredToken;
-	
+
 	/** track tail of hidden list emanating from previous
 	 *  monitored token
 	 */
@@ -38,7 +38,7 @@
 	}
 private void consumeFirst() throws TokenStreamException {
 	consume(); // get first token of input stream
-	
+
 	// Handle situation where hidden or discarded tokens
 	// appear first in input stream
 	CommonHiddenStreamToken p=null;
@@ -106,7 +106,7 @@
 	if ( LA(1)==null ) {
 		consumeFirst();
 	}
-	
+
 	// we always consume hidden tokens after monitored, thus,
 	// upon entry LA(1) is a monitored token.
 	CommonHiddenStreamToken monitored = LA(1);



1.4       +4 -4      e/src/jsrc/antlr/TokenStreamSelector.java

Index: TokenStreamSelector.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TokenStreamSelector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TokenStreamSelector.java	2001/10/26 03:08:51	1.3
+++ TokenStreamSelector.java	2001/11/29 20:33:26	1.4
@@ -4,13 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TokenStreamSelector.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TokenStreamSelector.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Hashtable;
-import antlr.collections.impl.LList;
 import antlr.collections.Stack;
-import java.io.IOException;
+import antlr.collections.impl.LList;
+
+import java.util.Hashtable;
 
 /** A token stream MUX (multiplexor) knows about n token streams
  *  and can multiplex them onto the same channel for use by token



1.4       +10 -2     e/src/jsrc/antlr/Tool.java

Index: Tool.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/Tool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Tool.java	2001/10/26 03:08:51	1.3
+++ Tool.java	2001/11/29 20:33:26	1.4
@@ -4,12 +4,20 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Tool.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: Tool.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.io.*;
 import antlr.collections.impl.BitSet;
 import antlr.collections.impl.Vector;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.Reader;
 public class Tool {
     public static final String version = "2.7.1";
 



1.4       +2 -2      e/src/jsrc/antlr/ToolErrorHandler.java

Index: ToolErrorHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/ToolErrorHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ToolErrorHandler.java	2001/10/26 03:08:51	1.3
+++ ToolErrorHandler.java	2001/11/29 20:33:26	1.4
@@ -4,9 +4,9 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ToolErrorHandler.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: ToolErrorHandler.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
-import antlr.collections.impl.BitSet;
+
 
 interface ToolErrorHandler {
 



1.4       +6 -7      e/src/jsrc/antlr/TreeParser.java

Index: TreeParser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TreeParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TreeParser.java	2001/10/26 03:08:51	1.3
+++ TreeParser.java	2001/11/29 20:33:26	1.4
@@ -4,10 +4,9 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TreeParser.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TreeParser.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.NoSuchElementException;
 import antlr.collections.AST;
 import antlr.collections.impl.BitSet;
 
@@ -21,15 +20,15 @@
 
 	/** Where did this rule leave off parsing; avoids a return parameter */
 	protected AST _retTree;
-	
+
 	/** guessing nesting level; guessing==0 implies not guessing */
 	// protected int guessing = 0;
-	
+
 	/** Nesting level of registered handlers */
 	// protected int exceptionLevel = 0;
 
 	protected TreeParserSharedInputState inputState;
-	
+
 	/** Table of token type to token names */
 	protected String[] tokenNames;
 
@@ -38,7 +37,7 @@
 
 	/** AST support code; parser and treeparser delegate to this object */
 	protected ASTFactory astFactory = new ASTFactory();
-	
+
 	/** Used to keep track of indentdepth for traceIn/Out */
 	protected int traceDepth = 0;
 
@@ -102,7 +101,7 @@
 	public void setASTFactory(ASTFactory f) {
 		astFactory = f;
 	}
-    
+
     /** Specify the type of node to create during tree building */
     public void setASTNodeType(String nodeType) {
 	setASTNodeClass(nodeType);



1.4       +2 -6      e/src/jsrc/antlr/TreeWalkerGrammar.java

Index: TreeWalkerGrammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/TreeWalkerGrammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TreeWalkerGrammar.java	2001/10/26 03:08:51	1.3
+++ TreeWalkerGrammar.java	2001/11/29 20:33:26	1.4
@@ -4,14 +4,10 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: TreeWalkerGrammar.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: TreeWalkerGrammar.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
-import java.util.Hashtable;
-import java.util.Enumeration;
 import java.io.IOException;
-import antlr.collections.impl.BitSet;
-import antlr.collections.impl.Vector;
 
 
 /** Parser-specific grammar subclass */
@@ -66,7 +62,7 @@
 		if (key.equals("ASTLabelType")) {
 			super.setOption(key, value);
 			return true;
-		}	
+		}
 		if (super.setOption(key, value)) {
 			return true;
 		}



1.4       +3 -3      e/src/jsrc/antlr/WildcardElement.java

Index: WildcardElement.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/WildcardElement.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WildcardElement.java	2001/10/26 03:08:51	1.3
+++ WildcardElement.java	2001/11/29 20:33:26	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: WildcardElement.java,v 1.3 2001/10/26 03:08:51 markm Exp $
+ * $Id: WildcardElement.java,v 1.4 2001/11/29 20:33:26 markm Exp $
  */
 
 class WildcardElement extends GrammarAtom {
@@ -23,8 +23,8 @@
 	public Lookahead look(int k) {
 		return grammar.theLLkAnalyzer.look(k, this);
 	}
-	public void setLabel(String label_) { 
-		label = label_; 
+	public void setLabel(String label_) {
+		label = label_;
 	}
 	public String toString() {
 		String s = " ";



1.4       +136 -139  e/src/jsrc/antlr/actions/cpp/ActionLexer.java

Index: ActionLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/actions/cpp/ActionLexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ActionLexer.java	2001/10/26 03:08:56	1.3
+++ ActionLexer.java	2001/11/29 20:33:28	1.4
@@ -2,33 +2,30 @@
 
 	package antlr.actions.cpp;
 
-import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
+import antlr.ActionTransInfo;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
 import antlr.CharStreamException;
 import antlr.CharStreamIOException;
-import antlr.ANTLRException;
-import java.io.Reader;
-import java.util.Hashtable;
-import antlr.CharScanner;
+import antlr.CodeGenerator;
 import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
+import antlr.LexerSharedInputState;
 import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
+import antlr.RecognitionException;
+import antlr.RuleBlock;
+import antlr.Token;
 import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.Tool;
 import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
+import antlr.collections.impl.Vector;
 
-	import java.io.StringReader;
-	import antlr.collections.impl.Vector;
-	import antlr.*;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.Hashtable;
 
 /** Perform the following translations:
 
@@ -116,7 +113,7 @@
 					if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
 				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				if ( _returnToken==null ) continue tryAgain; // found SKIP token
 				_ttype = _returnToken.getType();
 				_returnToken.setType(_ttype);
@@ -141,7 +138,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ACTION;
 		int _saveIndex;
-		
+
 		{
 		int _cnt3=0;
 		_loop3:
@@ -206,12 +203,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSTUFF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STUFF;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '"':
 		{
@@ -293,7 +290,7 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mAST_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_ITEM;
@@ -301,7 +298,7 @@
 		Token t=null;
 		Token id=null;
 		Token ctor=null;
-		
+
 		if ((LA(1)=='#') && (LA(2)=='(')) {
 			_saveIndex=text.length();
 			match('#');
@@ -315,17 +312,17 @@
 			text.setLength(_saveIndex);
 			mID(true);
 			id=_returnToken;
-			
+
 						String idt = id.getText();
 						text.setLength(_begin); text.append(generator.mapTreeId(idt,transInfo));
-					
+
 			{
 			if ((_tokenSet_3.member(LA(1))) && (true)) {
 				mWS(false);
 			}
 			else {
 			}
-			
+
 			}
 			{
 			if ((LA(1)=='=') && (true)) {
@@ -333,7 +330,7 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else if ((LA(1)=='#') && (LA(2)=='[')) {
@@ -345,19 +342,19 @@
 		}
 		else if ((LA(1)=='#') && (LA(2)=='#')) {
 			match("##");
-			
+
 						String r=currentRule.getRuleName()+"_AST"; text.setLength(_begin); text.append(r);
 						if ( transInfo!=null ) {
 							transInfo.refRuleRoot=r;	// we ref root of tree
 						}
-					
+
 			{
 			if ((_tokenSet_3.member(LA(1))) && (true)) {
 				mWS(false);
 			}
 			else {
 			}
-			
+
 			}
 			{
 			if ((LA(1)=='=') && (true)) {
@@ -365,20 +362,20 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ITEM;
@@ -387,16 +384,16 @@
 		Token a2=null;
 		Token a3=null;
 		Token a4=null;
-		
+
 		if ((LA(1)=='$') && (LA(2)=='a')) {
 			match("$append(");
 			mTEXT_ARG(true);
 			a1=_returnToken;
 			match(')');
-			
+
 						String t = "text += "+a1.getText();
 						text.setLength(_begin); text.append(t);
-					
+
 		}
 		else if ((LA(1)=='$') && (LA(2)=='s')) {
 			match("$set");
@@ -406,60 +403,60 @@
 				mTEXT_ARG(true);
 				a2=_returnToken;
 				match(')');
-				
+
 								String t;
 								t = "text.erase(_begin); text += "+a2.getText();
 								text.setLength(_begin); text.append(t);
-							
+
 			}
 			else if ((LA(1)=='T') && (LA(2)=='o')) {
 				match("Token(");
 				mTEXT_ARG(true);
 				a3=_returnToken;
 				match(')');
-				
+
 								String t="_token = "+a3.getText();
 								text.setLength(_begin); text.append(t);
-							
+
 			}
 			else if ((LA(1)=='T') && (LA(2)=='y')) {
 				match("Type(");
 				mTEXT_ARG(true);
 				a4=_returnToken;
 				match(')');
-				
+
 								String t="_ttype = "+a4.getText();
 								text.setLength(_begin); text.append(t);
-							
+
 			}
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 		}
 		else if ((LA(1)=='$') && (LA(2)=='g')) {
 			match("$getText");
-			
+
 						text.setLength(_begin); text.append("text.substr(_begin,text.length()-_begin)");
-					
+
 		}
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMENT;
 		int _saveIndex;
-		
+
 		if ((LA(1)=='/') && (LA(2)=='/')) {
 			mSL_COMMENT(false);
 		}
@@ -469,19 +466,19 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STRING;
 		int _saveIndex;
-		
+
 		match('"');
 		{
 		_loop91:
@@ -541,12 +538,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CHAR;
 		int _saveIndex;
-		
+
 		match('\'');
 		{
 		switch ( LA(1)) {
@@ -603,19 +600,19 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTREE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TREE;
 		int _saveIndex;
 		Token t=null;
 		Token t2=null;
-		
+
 			StringBuffer buf = new StringBuffer();
 			int n=0;
 			Vector terms = new Vector(10);
-		
-		
+
+
 		_saveIndex=text.length();
 		match('(');
 		text.setLength(_saveIndex);
@@ -656,11 +653,11 @@
 		mTREE_ELEMENT(true);
 		text.setLength(_saveIndex);
 		t=_returnToken;
-		
+
 					terms.appendElement(
 						generator.processStringForASTConstructor(t.getText())
 											 );
-				
+
 		{
 		switch ( LA(1)) {
 		case '\t':  case '\n':  case '\r':  case ' ':
@@ -724,11 +721,11 @@
 				mTREE_ELEMENT(true);
 				text.setLength(_saveIndex);
 				t2=_returnToken;
-				
+
 								terms.appendElement(
 									generator.processStringForASTConstructor(t2.getText())
 														  );
-							
+
 				{
 				switch ( LA(1)) {
 				case '\t':  case '\n':  case '\r':  case ' ':
@@ -752,7 +749,7 @@
 			else {
 				break _loop20;
 			}
-			
+
 		} while (true);
 		}
 		text.setLength(_begin); text.append(generator.getASTCreateString(terms));
@@ -765,12 +762,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ID;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case 'a':  case 'b':  case 'c':  case 'd':
@@ -866,7 +863,7 @@
 			else {
 				break _loop77;
 			}
-			
+
 		} while (true);
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -875,12 +872,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS;
 		int _saveIndex;
-		
+
 		{
 		int _cnt111=0;
 		_loop111:
@@ -907,7 +904,7 @@
 			else {
 				if ( _cnt111>=1 ) { break _loop111; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt111++;
 		} while (true);
 		}
@@ -917,34 +914,34 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mVAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = VAR_ASSIGN;
 		int _saveIndex;
-		
+
 		match('=');
-		
+
 					// inform the code generator that an assignment was done to
 					// AST root for the rule if invoker set refRuleRoot.
 					if ( LA(1)!='=' && transInfo!=null && transInfo.refRuleRoot!=null ) {
 						transInfo.assignToRoot=true;
 					}
-				
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mAST_CONSTRUCTOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_CONSTRUCTOR;
 		int _saveIndex;
 		Token x=null;
 		Token y=null;
-		
+
 		_saveIndex=text.length();
 		match('[');
 		text.setLength(_saveIndex);
@@ -1086,30 +1083,30 @@
 		_saveIndex=text.length();
 		match(']');
 		text.setLength(_saveIndex);
-		
+
 		//			System.out.println("AST_CONSTRUCTOR: "+((x==null)?"null":x.getText())+
 		//									 ", "+((y==null)?"null":y.getText()));
 					String ys = generator.processStringForASTConstructor(x.getText());
-		
+
 					// the second does not need processing coz it's a string
 					// (eg second param of astFactory.create(x,y)
 					if ( y!=null )
 						ys += ","+y.getText();
-		
+
 					text.setLength(_begin); text.append( generator.getASTCreateString(null,ys) );
-				
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case '\t':  case '\n':  case '\r':  case ' ':
@@ -1158,13 +1155,13 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else {
 				if ( _cnt51>=1 ) { break _loop51; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt51++;
 		} while (true);
 		}
@@ -1174,14 +1171,14 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTREE_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TREE_ELEMENT;
 		int _saveIndex;
 		Token id=null;
 		boolean was_mapped;
-		
+
 		switch ( LA(1)) {
 		case '(':
 		{
@@ -1241,7 +1238,7 @@
 								String t = generator.mapTreeId(id.getText(), null);
 								text.setLength(_begin); text.append(t);
 							}
-						
+
 			}
 			else if ((LA(1)=='#') && (LA(2)=='#')) {
 				match("##");
@@ -1257,7 +1254,7 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 /** An ID_ELEMENT can be a func call, array ref, simple var,
  *  or AST label ref.
  */
@@ -1267,7 +1264,7 @@
 		_ttype = ID_ELEMENT;
 		int _saveIndex;
 		Token id=null;
-		
+
 		mID(true);
 		id=_returnToken;
 		{
@@ -1281,7 +1278,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1301,7 +1298,7 @@
 					else {
 						break _loop34;
 					}
-					
+
 				} while (true);
 				}
 				match('>');
@@ -1329,7 +1326,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			{
 			switch ( LA(1)) {
@@ -1399,7 +1396,7 @@
 					else {
 						break _loop39;
 					}
-					
+
 				} while (true);
 				}
 				break;
@@ -1506,7 +1503,7 @@
 				else {
 					if ( _cnt44>=1 ) { break _loop44; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				_cnt44++;
 			} while (true);
 			}
@@ -1530,11 +1527,11 @@
 				mID_ELEMENT(false);
 			}
 			else if ((_tokenSet_10.member(LA(1))) && (true)) {
-				
+
 								mapped = true;
 								String t = generator.mapTreeId(id.getText(), transInfo);
 								text.setLength(_begin); text.append(t);
-							
+
 				{
 				if (((_tokenSet_11.member(LA(1))) && (_tokenSet_10.member(LA(2))))&&(transInfo!=null && transInfo.refRuleRoot!=null)) {
 					{
@@ -1561,7 +1558,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 		else {
@@ -1576,7 +1573,7 @@
 		_returnToken = _token;
 		return mapped;
 	}
-	
+
 /** The arguments of a #[...] constructor are text, token type,
  *  or a tree.
  */
@@ -1584,7 +1581,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_CTOR_ELEMENT;
 		int _saveIndex;
-		
+
 		if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
 			mSTRING(false);
 		}
@@ -1597,19 +1594,19 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt102=0;
 		_loop102:
@@ -1620,7 +1617,7 @@
 			else {
 				if ( _cnt102>=1 ) { break _loop102; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt102++;
 		} while (true);
 		}
@@ -1630,12 +1627,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ARG;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case '\'':
@@ -1750,7 +1747,7 @@
 			else {
 				break _loop72;
 			}
-			
+
 		} while (true);
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -1759,12 +1756,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG_ELEMENT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case ':':  case 'A':  case 'B':  case 'C':
 		case 'D':  case 'E':  case 'F':  case 'G':
@@ -1822,13 +1819,13 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG_ID_ELEMENT;
 		int _saveIndex;
 		Token id=null;
-		
+
 		mID(true);
 		id=_returnToken;
 		{
@@ -1842,7 +1839,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1860,7 +1857,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			{
 			_loop60:
@@ -1877,14 +1874,14 @@
 						else {
 							break _loop59;
 						}
-						
+
 					} while (true);
 					}
 				}
 				else {
 					break _loop60;
 				}
-				
+
 			} while (true);
 			}
 			{
@@ -1928,7 +1925,7 @@
 					else {
 						throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 					}
-					
+
 					}
 					mTEXT_ARG(false);
 					{
@@ -1955,7 +1952,7 @@
 				else {
 					if ( _cnt65>=1 ) { break _loop65; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				_cnt65++;
 			} while (true);
 			}
@@ -1991,12 +1988,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mINT_OR_FLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT_OR_FLOAT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt105=0;
 		_loop105:
@@ -2007,7 +2004,7 @@
 			else {
 				if ( _cnt105>=1 ) { break _loop105; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt105++;
 		} while (true);
 		}
@@ -2029,7 +2026,7 @@
 				else {
 					break _loop108;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -2038,7 +2035,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -2046,12 +2043,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SL_COMMENT;
 		int _saveIndex;
-		
+
 		match("//");
 		{
 		_loop82:
@@ -2064,7 +2061,7 @@
 			else {
 				break _loop82;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -2080,7 +2077,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		newline();
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -2089,12 +2086,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ML_COMMENT;
 		int _saveIndex;
-		
+
 		match("/*");
 		{
 		_loop86:
@@ -2120,7 +2117,7 @@
 			else {
 				break _loop86;
 			}
-			
+
 		} while (true);
 		}
 		match("*/");
@@ -2130,12 +2127,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ESC;
 		int _saveIndex;
-		
+
 		match('\\');
 		{
 		switch ( LA(1)) {
@@ -2196,7 +2193,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
@@ -2204,7 +2201,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -2222,7 +2219,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -2238,12 +2235,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = DIGIT;
 		int _saveIndex;
-		
+
 		matchRange('0','9');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -2251,8 +2248,8 @@
 		}
 		_returnToken = _token;
 	}
-	
-	
+
+
 	private static final long _tokenSet_0_data_[] = { -141407503262728L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { -145135534866440L, 9223372036854775807L, 0L, 0L };
@@ -2295,5 +2292,5 @@
 	public static final BitSet _tokenSet_19 = new BitSet(_tokenSet_19_data_);
 	private static final long _tokenSet_20_data_[] = { 576388824486127104L, 576460746532061182L, 0L, 0L };
 	public static final BitSet _tokenSet_20 = new BitSet(_tokenSet_20_data_);
-	
+
 	}



1.4       +128 -131  e/src/jsrc/antlr/actions/java/ActionLexer.java

Index: ActionLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/actions/java/ActionLexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ActionLexer.java	2001/10/26 03:08:56	1.3
+++ ActionLexer.java	2001/11/29 20:33:28	1.4
@@ -2,33 +2,30 @@
 
 package antlr.actions.java;
 
-import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
+import antlr.ActionTransInfo;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
 import antlr.CharStreamException;
 import antlr.CharStreamIOException;
-import antlr.ANTLRException;
-import java.io.Reader;
-import java.util.Hashtable;
-import antlr.CharScanner;
+import antlr.CodeGenerator;
 import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
+import antlr.LexerSharedInputState;
 import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
+import antlr.RecognitionException;
+import antlr.RuleBlock;
+import antlr.Token;
 import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.Tool;
 import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
+import antlr.collections.impl.Vector;
 
+import java.io.InputStream;
+import java.io.Reader;
 import java.io.StringReader;
-import antlr.collections.impl.Vector;
-import antlr.*;
+import java.util.Hashtable;
 
 /** Perform the following translations:
 
@@ -116,7 +113,7 @@
 					if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
 				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				if ( _returnToken==null ) continue tryAgain; // found SKIP token
 				_ttype = _returnToken.getType();
 				_returnToken.setType(_ttype);
@@ -141,7 +138,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ACTION;
 		int _saveIndex;
-		
+
 		{
 		int _cnt3=0;
 		_loop3:
@@ -206,12 +203,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSTUFF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STUFF;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '"':
 		{
@@ -293,7 +290,7 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mAST_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_ITEM;
@@ -301,7 +298,7 @@
 		Token t=null;
 		Token id=null;
 		Token ctor=null;
-		
+
 		if ((LA(1)=='#') && (LA(2)=='(')) {
 			_saveIndex=text.length();
 			match('#');
@@ -315,17 +312,17 @@
 			text.setLength(_saveIndex);
 			mID(true);
 			id=_returnToken;
-			
+
 					String idt = id.getText();
 					text.setLength(_begin); text.append(generator.mapTreeId(idt,transInfo));
-					
+
 			{
 			if ((_tokenSet_3.member(LA(1))) && (true)) {
 				mWS(false);
 			}
 			else {
 			}
-			
+
 			}
 			{
 			if ((LA(1)=='=') && (true)) {
@@ -333,7 +330,7 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else if ((LA(1)=='#') && (LA(2)=='[')) {
@@ -345,19 +342,19 @@
 		}
 		else if ((LA(1)=='#') && (LA(2)=='#')) {
 			match("##");
-			
+
 					String r=currentRule.getRuleName()+"_AST"; text.setLength(_begin); text.append(r);
 					if ( transInfo!=null ) {
 						transInfo.refRuleRoot=r;	// we ref root of tree
 					}
-					
+
 			{
 			if ((_tokenSet_3.member(LA(1))) && (true)) {
 				mWS(false);
 			}
 			else {
 			}
-			
+
 			}
 			{
 			if ((LA(1)=='=') && (true)) {
@@ -365,20 +362,20 @@
 			}
 			else {
 			}
-			
+
 			}
 		}
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ITEM;
@@ -387,16 +384,16 @@
 		Token a2=null;
 		Token a3=null;
 		Token a4=null;
-		
+
 		if ((LA(1)=='$') && (LA(2)=='a')) {
 			match("$append(");
 			mTEXT_ARG(true);
 			a1=_returnToken;
 			match(')');
-			
+
 						String t = "text.append("+a1.getText()+")";
 						text.setLength(_begin); text.append(t);
-					
+
 		}
 		else if ((LA(1)=='$') && (LA(2)=='s')) {
 			match("$set");
@@ -406,60 +403,60 @@
 				mTEXT_ARG(true);
 				a2=_returnToken;
 				match(')');
-				
+
 							String t;
 							t = "text.setLength(_begin); text.append("+a2.getText()+")";
 							text.setLength(_begin); text.append(t);
-							
+
 			}
 			else if ((LA(1)=='T') && (LA(2)=='o')) {
 				match("Token(");
 				mTEXT_ARG(true);
 				a3=_returnToken;
 				match(')');
-				
+
 							String t="_token = "+a3.getText();
 							text.setLength(_begin); text.append(t);
-							
+
 			}
 			else if ((LA(1)=='T') && (LA(2)=='y')) {
 				match("Type(");
 				mTEXT_ARG(true);
 				a4=_returnToken;
 				match(')');
-				
+
 							String t="_ttype = "+a4.getText();
 							text.setLength(_begin); text.append(t);
-							
+
 			}
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 		}
 		else if ((LA(1)=='$') && (LA(2)=='g')) {
 			match("$getText");
-			
+
 						text.setLength(_begin); text.append("new String(text.getBuffer(),_begin,text.length()-_begin)");
-					
+
 		}
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMENT;
 		int _saveIndex;
-		
+
 		if ((LA(1)=='/') && (LA(2)=='/')) {
 			mSL_COMMENT(false);
 		}
@@ -469,19 +466,19 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STRING;
 		int _saveIndex;
-		
+
 		match('"');
 		{
 		_loop88:
@@ -541,12 +538,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CHAR;
 		int _saveIndex;
-		
+
 		match('\'');
 		{
 		switch ( LA(1)) {
@@ -603,19 +600,19 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTREE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TREE;
 		int _saveIndex;
 		Token t=null;
 		Token t2=null;
-		
+
 			StringBuffer buf = new StringBuffer();
 			int n=0;
 			Vector terms = new Vector(10);
-		
-		
+
+
 		_saveIndex=text.length();
 		match('(');
 		text.setLength(_saveIndex);
@@ -744,7 +741,7 @@
 			else {
 				break _loop20;
 			}
-			
+
 		} while (true);
 		}
 		text.setLength(_begin); text.append(generator.getASTCreateString(terms));
@@ -757,12 +754,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ID;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case 'a':  case 'b':  case 'c':  case 'd':
@@ -848,7 +845,7 @@
 			else {
 				break _loop74;
 			}
-			
+
 		} while (true);
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -857,12 +854,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS;
 		int _saveIndex;
-		
+
 		{
 		int _cnt108=0;
 		_loop108:
@@ -889,7 +886,7 @@
 			else {
 				if ( _cnt108>=1 ) { break _loop108; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt108++;
 		} while (true);
 		}
@@ -899,34 +896,34 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mVAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = VAR_ASSIGN;
 		int _saveIndex;
-		
+
 		match('=');
-		
+
 				// inform the code generator that an assignment was done to
 				// AST root for the rule if invoker set refRuleRoot.
 				if ( LA(1)!='=' && transInfo!=null && transInfo.refRuleRoot!=null ) {
 					transInfo.assignToRoot=true;
 				}
-				
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mAST_CONSTRUCTOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_CONSTRUCTOR;
 		int _saveIndex;
 		Token x=null;
 		Token y=null;
-		
+
 		_saveIndex=text.length();
 		match('[');
 		text.setLength(_saveIndex);
@@ -1068,25 +1065,25 @@
 		_saveIndex=text.length();
 		match(']');
 		text.setLength(_saveIndex);
-		
+
 				String ys = "";
 				if ( y!=null ) {
 					ys = ","+y.getText();
 				}
 				text.setLength(_begin); text.append(generator.getASTCreateString(null,x.getText()+ys));
-				
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case '\t':  case '\n':  case '\r':  case ' ':
@@ -1135,13 +1132,13 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else {
 				if ( _cnt48>=1 ) { break _loop48; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt48++;
 		} while (true);
 		}
@@ -1151,14 +1148,14 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTREE_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TREE_ELEMENT;
 		int _saveIndex;
 		Token id=null;
 		boolean was_mapped;
-		
+
 		switch ( LA(1)) {
 		case '(':
 		{
@@ -1218,7 +1215,7 @@
 								String t = generator.mapTreeId(id.getText(), null);
 								text.setLength(_begin); text.append(t);
 							}
-						
+
 			}
 			else if ((LA(1)=='#') && (LA(2)=='#')) {
 				match("##");
@@ -1234,7 +1231,7 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 /** An ID_ELEMENT can be a func call, array ref, simple var,
  *  or AST label ref.
  */
@@ -1244,7 +1241,7 @@
 		_ttype = ID_ELEMENT;
 		int _saveIndex;
 		Token id=null;
-		
+
 		mID(true);
 		id=_returnToken;
 		{
@@ -1258,7 +1255,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1276,7 +1273,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			{
 			switch ( LA(1)) {
@@ -1344,7 +1341,7 @@
 					else {
 						break _loop36;
 					}
-					
+
 				} while (true);
 				}
 				break;
@@ -1450,7 +1447,7 @@
 				else {
 					if ( _cnt41>=1 ) { break _loop41; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				_cnt41++;
 			} while (true);
 			}
@@ -1466,11 +1463,11 @@
 		case ')':  case '*':  case '+':  case ',':
 		case '-':  case '/':  case '=':  case ']':
 		{
-			
+
 							mapped = true;
 							String t = generator.mapTreeId(id.getText(), transInfo);
 							text.setLength(_begin); text.append(t);
-						
+
 			{
 			if (((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))))&&(transInfo!=null && transInfo.refRuleRoot!=null)) {
 				{
@@ -1497,7 +1494,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -1514,7 +1511,7 @@
 		_returnToken = _token;
 		return mapped;
 	}
-	
+
 /** The arguments of a #[...] constructor are text, token type,
  *  or a tree.
  */
@@ -1522,7 +1519,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = AST_CTOR_ELEMENT;
 		int _saveIndex;
-		
+
 		if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
 			mSTRING(false);
 		}
@@ -1535,19 +1532,19 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
 			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt99=0;
 		_loop99:
@@ -1558,7 +1555,7 @@
 			else {
 				if ( _cnt99>=1 ) { break _loop99; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt99++;
 		} while (true);
 		}
@@ -1568,12 +1565,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ARG;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case '\'':
@@ -1687,7 +1684,7 @@
 			else {
 				break _loop69;
 			}
-			
+
 		} while (true);
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -1696,12 +1693,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG_ELEMENT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case 'A':  case 'B':  case 'C':  case 'D':
 		case 'E':  case 'F':  case 'G':  case 'H':
@@ -1759,13 +1756,13 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = TEXT_ARG_ID_ELEMENT;
 		int _saveIndex;
 		Token id=null;
-		
+
 		mID(true);
 		id=_returnToken;
 		{
@@ -1779,7 +1776,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		{
 		switch ( LA(1)) {
@@ -1797,7 +1794,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			{
 			_loop57:
@@ -1814,14 +1811,14 @@
 						else {
 							break _loop56;
 						}
-						
+
 					} while (true);
 					}
 				}
 				else {
 					break _loop57;
 				}
-				
+
 			} while (true);
 			}
 			{
@@ -1865,7 +1862,7 @@
 					else {
 						throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 					}
-					
+
 					}
 					mTEXT_ARG(false);
 					{
@@ -1892,7 +1889,7 @@
 				else {
 					if ( _cnt62>=1 ) { break _loop62; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 				}
-				
+
 				_cnt62++;
 			} while (true);
 			}
@@ -1938,12 +1935,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mINT_OR_FLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = INT_OR_FLOAT;
 		int _saveIndex;
-		
+
 		{
 		int _cnt102=0;
 		_loop102:
@@ -1954,7 +1951,7 @@
 			else {
 				if ( _cnt102>=1 ) { break _loop102; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt102++;
 		} while (true);
 		}
@@ -1976,7 +1973,7 @@
 				else {
 					break _loop105;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -1985,7 +1982,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1993,12 +1990,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SL_COMMENT;
 		int _saveIndex;
-		
+
 		match("//");
 		{
 		_loop79:
@@ -2011,7 +2008,7 @@
 			else {
 				break _loop79;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -2027,7 +2024,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		newline();
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -2036,12 +2033,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ML_COMMENT;
 		int _saveIndex;
-		
+
 		match("/*");
 		{
 		_loop83:
@@ -2067,7 +2064,7 @@
 			else {
 				break _loop83;
 			}
-			
+
 		} while (true);
 		}
 		match("*/");
@@ -2077,12 +2074,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ESC;
 		int _saveIndex;
-		
+
 		match('\\');
 		{
 		switch ( LA(1)) {
@@ -2143,7 +2140,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
@@ -2151,7 +2148,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -2169,7 +2166,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -2185,12 +2182,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = DIGIT;
 		int _saveIndex;
-		
+
 		matchRange('0','9');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -2198,8 +2195,8 @@
 		}
 		_returnToken = _token;
 	}
-	
-	
+
+
 	private static final long _tokenSet_0_data_[] = { -141407503262728L, 9223372036854775807L, 0L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { -145135534866440L, 9223372036854775807L, 0L, 0L };
@@ -2240,5 +2237,5 @@
 	public static final BitSet _tokenSet_18 = new BitSet(_tokenSet_18_data_);
 	private static final long _tokenSet_19_data_[] = { 288158448334415360L, 576460746532061182L, 0L, 0L };
 	public static final BitSet _tokenSet_19 = new BitSet(_tokenSet_19_data_);
-	
+
 	}



1.5       +16 -19    e/src/jsrc/antlr/actions/sather/ActionLexer.java

Index: ActionLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/actions/sather/ActionLexer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ActionLexer.java	2001/11/27 07:27:53	1.4
+++ ActionLexer.java	2001/11/29 20:33:29	1.5
@@ -2,33 +2,30 @@
 
 package antlr.actions.sather;
 
-import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
+import antlr.ActionTransInfo;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
 import antlr.CharStreamException;
 import antlr.CharStreamIOException;
-import antlr.ANTLRException;
-import java.io.Reader;
-import java.util.Hashtable;
-import antlr.CharScanner;
+import antlr.CodeGenerator;
 import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
+import antlr.LexerSharedInputState;
 import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
+import antlr.RecognitionException;
+import antlr.RuleBlock;
+import antlr.Token;
 import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.Tool;
 import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
+import antlr.collections.impl.Vector;
 
+import java.io.InputStream;
+import java.io.Reader;
 import java.io.StringReader;
-import antlr.collections.impl.Vector;
-import antlr.*;
+import java.util.Hashtable;
 
 /** Perform the following translations:
 



1.4       +2 -3      e/src/jsrc/antlr/collections/impl/ASTEnumerator.java

Index: ASTEnumerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/ASTEnumerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ASTEnumerator.java	2001/10/26 03:08:58	1.3
+++ ASTEnumerator.java	2001/11/29 20:33:29	1.4
@@ -4,12 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ASTEnumerator.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: ASTEnumerator.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import antlr.collections.impl.Vector;
-import antlr.collections.ASTEnumeration;
 import antlr.collections.AST;
+
 import java.util.NoSuchElementException;
 
 public class ASTEnumerator implements antlr.collections.ASTEnumeration {



1.4       +2 -2      e/src/jsrc/antlr/collections/impl/BitSet.java

Index: BitSet.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/BitSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BitSet.java	2001/10/26 03:08:58	1.3
+++ BitSet.java	2001/11/29 20:33:29	1.4
@@ -4,7 +4,7 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: BitSet.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: BitSet.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.CharFormatter;
@@ -418,7 +418,7 @@
 	return s;
     }
 
-    /** 
+    /**
      * Dump a comma-separated list of the words making up the bit set.
      * This generates a comma-separated list of Java-like long int constants.
      */



1.4       +3 -4      e/src/jsrc/antlr/collections/impl/IndexedVector.java

Index: IndexedVector.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/IndexedVector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- IndexedVector.java	2001/10/26 03:08:58	1.3
+++ IndexedVector.java	2001/11/29 20:33:29	1.4
@@ -4,17 +4,16 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: IndexedVector.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: IndexedVector.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import java.util.Hashtable;
 import java.util.Enumeration;
-import antlr.collections.impl.Vector;
+import java.util.Hashtable;
 
 /**
  * A simple indexed vector: a normal vector except that you must
  * specify a key when adding an element.  This allows fast lookup
- * and allows the order of specification to be preserved. 
+ * and allows the order of specification to be preserved.
  */
 public class IndexedVector {
 	protected Vector elements;



1.4       +1 -4      e/src/jsrc/antlr/collections/impl/LLEnumeration.java

Index: LLEnumeration.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/LLEnumeration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LLEnumeration.java	2001/10/26 03:08:58	1.3
+++ LLEnumeration.java	2001/11/29 20:33:29	1.4
@@ -4,14 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LLEnumeration.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: LLEnumeration.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import antlr.collections.List;
-import antlr.collections.Stack;
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
-import antlr.collections.impl.LLCell;
 
 /**An enumeration of a LList.  Maintains a cursor through the list.
  * bad things would happen if the list changed via another thread



1.4       +4 -4      e/src/jsrc/antlr/collections/impl/LList.java

Index: LList.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/LList.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LList.java	2001/10/26 03:08:58	1.3
+++ LList.java	2001/11/29 20:33:29	1.4
@@ -4,14 +4,14 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: LList.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: LList.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.collections.List;
 import antlr.collections.Stack;
+
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
-import antlr.collections.impl.LLCell;
 
 /**A Linked List Implementation (not thread-safe for simplicity)
  * (adds to the tail) (has an enumeration)
@@ -79,7 +79,7 @@
 		return false;
 	}
 	// The next two methods make LLQueues and LLStacks easier.
-	
+
 	/** Insert an object at the head of the list.
 	 * @param o the object to add
 	 */
@@ -101,7 +101,7 @@
 		return o;
 	}
 	// Satisfy the Stack interface now.
-	
+
 	/** Push an object onto the stack.
 	 * @param o the object to push
 	 */



1.4       +1 -3      e/src/jsrc/antlr/collections/impl/Vector.java

Index: Vector.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/Vector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Vector.java	2001/10/26 03:08:58	1.3
+++ Vector.java	2001/11/29 20:33:29	1.4
@@ -4,12 +4,10 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Vector.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: Vector.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import antlr.collections.Enumerator;
 
 public class Vector implements Cloneable {
 	protected Object[] data;



1.4       +1 -2      e/src/jsrc/antlr/collections/impl/VectorEnumeration.java

Index: VectorEnumeration.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/VectorEnumeration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VectorEnumeration.java	2001/10/26 03:08:58	1.3
+++ VectorEnumeration.java	2001/11/29 20:33:29	1.4
@@ -4,12 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: VectorEnumeration.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: VectorEnumeration.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
-import antlr.collections.Enumerator;
 
 // based on java.lang.Vector; returns any null indices between non-null ones.
 class VectorEnumeration implements Enumeration {



1.4       +1 -2      e/src/jsrc/antlr/collections/impl/VectorEnumerator.java

Index: VectorEnumerator.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/collections/impl/VectorEnumerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VectorEnumerator.java	2001/10/26 03:08:58	1.3
+++ VectorEnumerator.java	2001/11/29 20:33:29	1.4
@@ -4,12 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: VectorEnumerator.java,v 1.3 2001/10/26 03:08:58 markm Exp $
+ * $Id: VectorEnumerator.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
-import antlr.collections.Enumerator;
 
 // based on java.lang.Vector; returns any null indices between non-null ones.
 class VectorEnumerator implements Enumeration {



1.4       +11 -8     e/src/jsrc/antlr/debug/DebuggingCharScanner.java

Index: DebuggingCharScanner.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/DebuggingCharScanner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DebuggingCharScanner.java	2001/10/26 03:08:58	1.3
+++ DebuggingCharScanner.java	2001/11/29 20:33:29	1.4
@@ -1,9 +1,12 @@
 package antlr.debug;
 
-import antlr.*;
-import antlr.collections.*;
-import antlr.collections.impl.*;
-import java.io.*;
+import antlr.CharScanner;
+import antlr.CharStreamException;
+import antlr.InputBuffer;
+import antlr.LexerSharedInputState;
+import antlr.MismatchedCharException;
+import antlr.Token;
+import antlr.collections.impl.BitSet;
 
 public abstract class DebuggingCharScanner extends CharScanner implements DebuggingParser {
 	private ParserEventSupport parserEventSupport = new ParserEventSupport(this);
@@ -44,10 +47,10 @@
 	}
 	public void consume() throws CharStreamException {
 		int la_1 = -99;
-		try {la_1 = LA(1);}	
+		try {la_1 = LA(1);}
 		catch (CharStreamException ignoreAnIOException) {}
 		super.consume();
-		parserEventSupport.fireConsume(la_1);		
+		parserEventSupport.fireConsume(la_1);
 	}
 	protected void fireEnterRule(int num, int data) {
 		if (isDebugMode())
@@ -83,7 +86,7 @@
 	}
 	public synchronized void goToSleep() {
 		try {wait();}
-		catch (InterruptedException e) {	}		
+		catch (InterruptedException e) {	}
 	}
 	public boolean isDebugMode() {
 		return !_notDebugMode;
@@ -208,7 +211,7 @@
 	public void removeSyntacticPredicateListener(SyntacticPredicateListener l) {
 		parserEventSupport.removeSyntacticPredicateListener(l);
 	}
-	public void removeTraceListener(TraceListener l) {	
+	public void removeTraceListener(TraceListener l) {
 		parserEventSupport.removeTraceListener(l);
 	}
 	/** Report exception errors caught in nextToken() */



1.4       +2 -2      e/src/jsrc/antlr/debug/DebuggingInputBuffer.java

Index: DebuggingInputBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/DebuggingInputBuffer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DebuggingInputBuffer.java	2001/10/26 03:08:58	1.3
+++ DebuggingInputBuffer.java	2001/11/29 20:33:29	1.4
@@ -1,9 +1,9 @@
 package antlr.debug;
 
-import antlr.InputBuffer;
 import antlr.CharStreamException;
+import antlr.InputBuffer;
+
 import java.util.Vector;
-import java.io.IOException;
 
 public class DebuggingInputBuffer extends InputBuffer {
 	private InputBuffer buffer;



1.4       +1 -1      e/src/jsrc/antlr/debug/InputBufferEvent.java

Index: InputBufferEvent.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/InputBufferEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InputBufferEvent.java	2001/10/26 03:08:58	1.3
+++ InputBufferEvent.java	2001/11/29 20:33:29	1.4
@@ -43,7 +43,7 @@
 		setLookaheadAmount(la);
 	}
 	public String toString() {
-		return "CharBufferEvent [" + 
+		return "CharBufferEvent [" +
 			(getType()==CONSUME?"CONSUME, ":"LA, ")+
 		getChar() + "," + getLookaheadAmount() + "]";
 	}



1.4       +4 -6      e/src/jsrc/antlr/debug/InputBufferEventSupport.java

Index: InputBufferEventSupport.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/InputBufferEventSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InputBufferEventSupport.java	2001/10/26 03:08:58	1.3
+++ InputBufferEventSupport.java	2001/11/29 20:33:29	1.4
@@ -1,8 +1,6 @@
 package antlr.debug;
 
 import java.util.Vector;
-import antlr.collections.impl.BitSet;
-import antlr.RecognitionException;
 
 public class InputBufferEventSupport {
 	private Object source;
@@ -24,7 +22,7 @@
 	}
 	public void fireConsume(char c) {
 		inputBufferEvent.setValues(InputBufferEvent.CONSUME, c, 0);
-		fireEvents(CONSUME, inputBufferListeners);		
+		fireEvents(CONSUME, inputBufferListeners);
 	}
 	public void fireEvent(int type, ListenerBase l) {
 		switch(type) {
@@ -34,17 +32,17 @@
 			case REWIND:  ((InputBufferListener)l).inputBufferRewind(inputBufferEvent); break;
 			default:
 				throw new IllegalArgumentException("bad type "+type+" for fireEvent()");
-		}	
+		}
 	}
 	public void fireEvents(int type, Vector listeners) {
 		Vector targets=null;
 		ListenerBase l=null;
-		
+
 		synchronized (this) {
 			if (listeners == null) return;
 			targets = (Vector)listeners.clone();
 		}
-		
+
 		if (targets != null)
 			for (int i = 0; i < targets.size(); i++) {
 				l = (ListenerBase)targets.elementAt(i);



1.4       +7 -11     e/src/jsrc/antlr/debug/LLkDebuggingParser.java

Index: LLkDebuggingParser.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/LLkDebuggingParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LLkDebuggingParser.java	2001/10/26 03:08:58	1.3
+++ LLkDebuggingParser.java	2001/11/29 20:33:29	1.4
@@ -1,17 +1,13 @@
 package antlr.debug;
 
-import antlr.ParserSharedInputState;
-import antlr.TokenStreamException;
 import antlr.LLkParser;
-import antlr.TokenBuffer;
-import antlr.TokenStream;
 import antlr.MismatchedTokenException;
+import antlr.ParserSharedInputState;
 import antlr.RecognitionException;
-import antlr.collections.impl.BitSet;
-import java.io.IOException;
+import antlr.TokenBuffer;
+import antlr.TokenStream;
 import antlr.TokenStreamException;
-
-import antlr.debug.ParserEventSupport;
+import antlr.collections.impl.BitSet;
 
 import java.lang.reflect.Constructor;
 
@@ -59,7 +55,7 @@
 	/**Get another token object from the token stream */
 	public void consume() {
 		int la_1 = -99;
-		try {la_1 = LA(1);}	
+		try {la_1 = LA(1);}
 		catch (TokenStreamException ignoreAnException) {}
 		super.consume();
 		parserEventSupport.fireConsume(la_1);
@@ -98,7 +94,7 @@
 	}
 	public synchronized void goToSleep() {
 		try {wait();}
-		catch (InterruptedException e) {	}		
+		catch (InterruptedException e) {	}
 	}
 	public boolean isDebugMode() {
 		return !_notDebugMode;
@@ -180,7 +176,7 @@
 	public void removeSyntacticPredicateListener(SyntacticPredicateListener l) {
 		parserEventSupport.removeSyntacticPredicateListener(l);
 	}
-	public void removeTraceListener(TraceListener l) {	
+	public void removeTraceListener(TraceListener l) {
 		parserEventSupport.removeTraceListener(l);
 	}
 	/** Parser error-reporting function can be overridden in subclass */



1.4       +13 -13    e/src/jsrc/antlr/debug/ParserEventSupport.java

Index: ParserEventSupport.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/ParserEventSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ParserEventSupport.java	2001/10/26 03:08:58	1.3
+++ ParserEventSupport.java	2001/11/29 20:33:29	1.4
@@ -1,10 +1,10 @@
 package antlr.debug;
 
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
 import antlr.collections.impl.BitSet;
-import antlr.RecognitionException;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
 
 
 /** A class to assist in firing parser events
@@ -84,7 +84,7 @@
 		if (l instanceof ParserController) {
 			((ParserController)l).setParserEventSupport(this);
 			controller = (ParserController)l;
-		}	
+		}
 		addParserMatchListener(l);
 		addParserTokenListener(l);
 
@@ -120,7 +120,7 @@
 	}
 	public void fireConsume(int value) {
 		tokenEvent.setValues(ParserTokenEvent.CONSUME, 1, value);
-		fireEvents(CONSUME, tokenListeners);		
+		fireEvents(CONSUME, tokenListeners);
 	}
 	public void fireDoneParsing() {
 		traceEvent.setValues(TraceEvent.DONE_PARSING, 0,0,0);
@@ -128,19 +128,19 @@
 		Hashtable targets=null;
 //		Hashtable targets=doneListeners;
 		ListenerBase l=null;
-		
+
 		synchronized (this) {
 			if (doneListeners == null) return;
 			targets = (Hashtable)doneListeners.clone();
 		}
-		
+
 		if (targets != null) {
 			Enumeration e = targets.keys();
 			while(e.hasMoreElements()) {
 				l = (ListenerBase)e.nextElement();
 				fireEvent(DONE_PARSING, l);
 			}
-		}	
+		}
 		if (controller != null)
 			controller.checkBreak();
 	}
@@ -173,14 +173,14 @@
 
 			case DONE_PARSING: l.doneParsing(traceEvent); break;
 			case NEW_LINE:     ((NewLineListener)l).hitNewLine(newLineEvent); break;
-			
+
 			default:
 				throw new IllegalArgumentException("bad type "+type+" for fireEvent()");
-		}	
+		}
 	}
 	public void fireEvents(int type, Vector listeners) {
 		ListenerBase l=null;
-		
+
 		if (listeners != null)
 			for (int i = 0; i < listeners.size(); i++) {
 				l = (ListenerBase)listeners.elementAt(i);
@@ -321,7 +321,7 @@
 		if (i != null)
 			val = i.intValue() - 1;
 
-		if (val == 0) 
+		if (val == 0)
 			doneListeners.remove(l);
 		else
 			doneListeners.put(l, new Integer(val));



1.4       +5 -5      e/src/jsrc/antlr/debug/ParserListener.java

Index: ParserListener.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/ParserListener.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ParserListener.java	2001/10/26 03:08:58	1.3
+++ ParserListener.java	2001/11/29 20:33:29	1.4
@@ -1,9 +1,9 @@
 package antlr.debug;
 
-public interface ParserListener extends SemanticPredicateListener, 
-										ParserMatchListener, 
-										MessageListener, 
-										ParserTokenListener, 
-										TraceListener, 
+public interface ParserListener extends SemanticPredicateListener,
+										ParserMatchListener,
+										MessageListener,
+										ParserTokenListener,
+										TraceListener,
 										SyntacticPredicateListener {
 }



1.4       +1 -1      e/src/jsrc/antlr/debug/ParserMatchEvent.java

Index: ParserMatchEvent.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/ParserMatchEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ParserMatchEvent.java	2001/10/26 03:08:58	1.3
+++ ParserMatchEvent.java	2001/11/29 20:33:29	1.4
@@ -65,7 +65,7 @@
 		setText(text);
 	}
 	public String toString() {
-		return "ParserMatchEvent [" + 
+		return "ParserMatchEvent [" +
 		       (isMatched()?"ok,":"bad,") +
 		       (isInverse()?"NOT ":"") +
 		       (getType()==TOKEN?"token,":"bitset,") +



1.4       +2 -2      e/src/jsrc/antlr/debug/ParserTokenEvent.java

Index: ParserTokenEvent.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/ParserTokenEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ParserTokenEvent.java	2001/10/26 03:08:58	1.3
+++ ParserTokenEvent.java	2001/11/29 20:33:29	1.4
@@ -36,9 +36,9 @@
 	public String toString() {
 		if (getType()==LA)
 			return "ParserTokenEvent [LA," + getAmount() + "," +
-			       getValue() + "]"; 
+			       getValue() + "]";
 		else
 			return "ParserTokenEvent [consume,1," +
-			       getValue() + "]"; 
+			       getValue() + "]";
 	}
 }



1.4       +1 -1      e/src/jsrc/antlr/debug/SemanticPredicateEvent.java

Index: SemanticPredicateEvent.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/SemanticPredicateEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SemanticPredicateEvent.java	2001/10/26 03:08:58	1.3
+++ SemanticPredicateEvent.java	2001/11/29 20:33:29	1.4
@@ -32,7 +32,7 @@
 		setResult(result);
 	}
 	public String toString() {
-		return "SemanticPredicateEvent [" + 
+		return "SemanticPredicateEvent [" +
 		       getCondition() + "," + getResult() + "," + getGuessing() + "]";
 	}
 }



1.4       +1 -1      e/src/jsrc/antlr/debug/TraceEvent.java

Index: TraceEvent.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/TraceEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TraceEvent.java	2001/10/26 03:08:58	1.3
+++ TraceEvent.java	2001/11/29 20:33:29	1.4
@@ -34,7 +34,7 @@
 		setData(data);
 	}
 	public String toString() {
-		return "ParserTraceEvent [" + 
+		return "ParserTraceEvent [" +
 		       (getType()==ENTER?"enter,":"exit,") +
 		       getRuleNum() + "," + getGuessing() +"]";
 	}



1.4       +16 -10    e/src/jsrc/antlr/debug/misc/ASTFrame.java

Index: ASTFrame.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/misc/ASTFrame.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ASTFrame.java	2001/10/26 03:08:59	1.3
+++ ASTFrame.java	2001/11/29 20:33:29	1.4
@@ -4,27 +4,33 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: ASTFrame.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: ASTFrame.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import antlr.*;
+import antlr.ASTFactory;
+import antlr.CommonAST;
 import antlr.collections.AST;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.tree.*;
 
+import javax.swing.JFrame;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.TreePath;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.Frame;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
 public class ASTFrame extends JFrame {
   // The initial width and height of the frame
   static final int WIDTH = 200;
   static final int HEIGHT = 300;
 
-  class MyTreeSelectionListener 
+  class MyTreeSelectionListener
 	  implements TreeSelectionListener {
 	public void valueChanged (TreeSelectionEvent event) {
 	  TreePath path = event.getPath();
-	  System.out.println ("Selected: " + 
+	  System.out.println ("Selected: " +
 		path.getLastPathComponent());
 	  Object elements[] = path.getPath();
 	  for (int i=0; i<elements.length; i++) {
@@ -61,5 +67,5 @@
 
 	ASTFrame frame = new ASTFrame("AST JTree Example", r);
 	frame.setVisible(true);
-  }  
+  }
 }



1.4       +14 -13    e/src/jsrc/antlr/debug/misc/JTreeASTModel.java

Index: JTreeASTModel.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/misc/JTreeASTModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JTreeASTModel.java	2001/10/26 03:08:59	1.3
+++ JTreeASTModel.java	2001/11/29 20:33:29	1.4
@@ -4,14 +4,15 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: JTreeASTModel.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: JTreeASTModel.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.collections.AST;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.tree.*;
 
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
 public class JTreeASTModel implements TreeModel {
 
   AST root = null;
@@ -21,9 +22,9 @@
 	  throw new IllegalArgumentException("root is null");
 	}
 	root = t;
-  }  
+  }
   public void addTreeModelListener(TreeModelListener l) {
-  }  
+  }
   public Object getChild(Object parent, int index) {
 	if (parent == null) {
 	  return null;
@@ -39,7 +40,7 @@
 	  i++;
 	}
 	return c;
-  }  
+  }
   public int getChildCount(Object parent) {
 	if ( parent==null ) {
 	  throw new IllegalArgumentException("root is null");
@@ -52,7 +53,7 @@
 	  i++;
 	}
 	return i;
-  }  
+  }
   public int getIndexOfChild(Object parent, Object child) {
 	if ( parent==null || child==null ) {
 	  throw new IllegalArgumentException("root or child is null");
@@ -71,20 +72,20 @@
 	  return i;
 	}
 	throw new java.util.NoSuchElementException("node is not a child");
-  }  
+  }
   public Object getRoot() {
 	return root;
-  }  
+  }
   public boolean isLeaf(Object node) {
 	if ( node == null ) {
 	  throw new IllegalArgumentException("node is null");
 	}
 	AST t = (AST)node;
 	return t.getFirstChild()==null;
-  }  
+  }
   public void removeTreeModelListener(TreeModelListener l) {
-  }  
+  }
   public void valueForPathChanged(TreePath path, Object newValue) {
 	System.out.println("heh, who is calling this mystery method?");
-  }  
+  }
 }



1.4       +9 -7      e/src/jsrc/antlr/debug/misc/JTreeASTPanel.java

Index: JTreeASTPanel.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/debug/misc/JTreeASTPanel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JTreeASTPanel.java	2001/10/26 03:08:59	1.3
+++ JTreeASTPanel.java	2001/11/29 20:33:29	1.4
@@ -4,17 +4,19 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: JTreeASTPanel.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: JTreeASTPanel.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.tree.*;
-import javax.swing.event.*;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.TreeModel;
+import java.awt.BorderLayout;
 
 public class JTreeASTPanel extends JPanel {
   JTree tree;
-  
+
   public JTreeASTPanel(TreeModel tm, TreeSelectionListener listener) {
 	// use a layout that will stretch tree to panel size
 	setLayout(new BorderLayout());
@@ -34,5 +36,5 @@
 	sp.getViewport().add(tree);
 
 	add(sp, BorderLayout.CENTER);
-  }  
+  }
 }



1.4       +5 -5      e/src/jsrc/antlr/preprocessor/Grammar.java

Index: Grammar.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Grammar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Grammar.java	2001/10/26 03:08:59	1.3
+++ Grammar.java	2001/11/29 20:33:29	1.4
@@ -4,13 +4,13 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Grammar.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: Grammar.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.collections.impl.IndexedVector;
-import java.util.Hashtable;
-import java.util.Enumeration;
+
 import java.io.IOException;
+import java.util.Enumeration;
 
 class Grammar {
     protected String name;
@@ -151,7 +151,7 @@
 	     o.getName().equals("exportVocab") ) {
 	    return;
 	}
-		
+
 	Option overriddenOption = null;
 	if ( options!=null ) {	// do we even have options?
 	    overriddenOption = (Option)options.getElement(o.getName());
@@ -226,7 +226,7 @@
 	    Rule r = (Rule)rules.elementAt(i);
 	    if ( !getName().equals(r.enclosingGrammar.getName()) ) {
 		s += "// inherited from grammar "+r.enclosingGrammar.getName()+System.getProperty("line.separator");
-	    }	
+	    }
 	    s += r+
 		System.getProperty("line.separator")+
 		System.getProperty("line.separator");



1.4       +10 -8     e/src/jsrc/antlr/preprocessor/GrammarFile.java

Index: GrammarFile.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/GrammarFile.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GrammarFile.java	2001/10/26 03:08:59	1.3
+++ GrammarFile.java	2001/11/29 20:33:29	1.4
@@ -4,12 +4,14 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: GrammarFile.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: GrammarFile.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.collections.impl.IndexedVector;
+
+import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.Enumeration;
-import java.io.*;
 
 /** Stores header action, grammar preamble, file options, and
  *  list of grammars in the file
@@ -31,9 +33,9 @@
 	public void generateExpandedFile() throws IOException {
 		if ( !expanded ) {
 			return;	// don't generate if nothing got expanded
-		}	
+		}
 		String expandedFileName = nameForExpandedGrammarFile(this.getName());
-		
+
 		// create the new grammar file with expanded grammars
 		PrintWriter expF = antlr.Tool.openOutputFile(expandedFileName);
 		expF.println(toString());
@@ -46,11 +48,11 @@
 	public String nameForExpandedGrammarFile(String f) {
 		if ( expanded ) {
 			// strip path to original input, make expanded file in current dir
-			return "expanded"+antlr.Tool.fileMinusPath(f);	
+			return "expanded"+antlr.Tool.fileMinusPath(f);
 		}
 		else {
 			return f;
-		}		
+		}
 	}
 	public void setExpanded(boolean exp) {
 		expanded = exp;
@@ -60,12 +62,12 @@
 	public String toString() {
 		String h = headerAction==null ? "" : headerAction;
 		String o = options==null ? "" : Hierarchy.optionsToString(options);
-		
+
 		String s=h+o;
 		for (Enumeration e=grammars.elements(); e.hasMoreElements(); ) {
 			Grammar g = (Grammar)e.nextElement();
 			s += g;
-		}	
+		}
 		return s;
 	}
 }



1.4       +14 -12    e/src/jsrc/antlr/preprocessor/Hierarchy.java

Index: Hierarchy.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Hierarchy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Hierarchy.java	2001/10/26 03:08:59	1.3
+++ Hierarchy.java	2001/11/29 20:33:29	1.4
@@ -4,15 +4,17 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Hierarchy.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: Hierarchy.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
+import antlr.ANTLRException;
+import antlr.TokenStreamException;
 import antlr.collections.impl.IndexedVector;
-import java.util.Hashtable;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
 import java.util.Enumeration;
-import java.io.*;
-import antlr.*;
-import antlr.preprocessor.Grammar;
+import java.util.Hashtable;
 
 public class Hierarchy {
 	protected static Grammar LexerRoot = new Grammar("Lexer", null, null);
@@ -24,11 +26,11 @@
 	public Hierarchy() {
 		symbols = new Hashtable(10);
 		files = new Hashtable(10);
-		
+
 		LexerRoot.setPredefined(true);
 		ParserRoot.setPredefined(true);
 		TreeParserRoot.setPredefined(true);
-		
+
 		symbols.put(LexerRoot.getName(), LexerRoot);
 		symbols.put(ParserRoot.getName(), ParserRoot);
 		symbols.put(TreeParserRoot.getName(), TreeParserRoot);
@@ -49,7 +51,7 @@
 		for (Enumeration e=f.getGrammars().elements(); e.hasMoreElements(); ) {
 			Grammar g = (Grammar)e.nextElement();
 			g.expandInPlace();
-		}	
+		}
 	}
 	public Grammar findRoot(Grammar g) {
 		if ( g.getSuperGrammarName()==null ) {		// at root
@@ -79,7 +81,7 @@
 	public void readGrammarFile(String file) throws FileNotFoundException {
 		FileReader grStream = new FileReader(file);
 		addGrammarFile(new GrammarFile(file));
-		
+
 		// Create the simplified grammar lexer/parser
 		PreprocessorLexer ppLexer = new PreprocessorLexer(grStream);
 		ppLexer.setFilename(file);
@@ -113,9 +115,9 @@
 				symbols.remove(c.getName()); // super not defined, kill sub
 			}
 		}
-	
+
 		if ( !complete ) return false;
-		
+
 		// Make another pass to set the 'type' field of each grammar
 		// This makes it easy later to ask a grammar what its type
 		// is w/o having to search hierarchy.
@@ -126,7 +128,7 @@
 			}
 			c.setType(findRoot(c).getName());
 		}
-		
+
 		return true;
 	}
 }



1.4       +2 -2      e/src/jsrc/antlr/preprocessor/Option.java

Index: Option.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Option.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Option.java	2001/10/26 03:08:59	1.3
+++ Option.java	2001/11/29 20:33:29	1.4
@@ -4,10 +4,10 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Option.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: Option.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
-import antlr.collections.impl.Vector;
+
 
 class Option {
 	protected String name;



1.4       +59 -69    e/src/jsrc/antlr/preprocessor/Preprocessor.java

Index: Preprocessor.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Preprocessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Preprocessor.java	2001/10/26 03:08:59	1.3
+++ Preprocessor.java	2001/11/29 20:33:29	1.4
@@ -2,26 +2,16 @@
 
 package antlr.preprocessor;
 
-import antlr.TokenBuffer;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.ANTLRException;
-import antlr.LLkParser;
-import antlr.Token;
-import antlr.TokenStream;
-import antlr.RecognitionException;
 import antlr.NoViableAltException;
-import antlr.MismatchedTokenException;
-import antlr.SemanticException;
 import antlr.ParserSharedInputState;
+import antlr.RecognitionException;
+import antlr.SemanticException;
+import antlr.Token;
+import antlr.TokenBuffer;
+import antlr.TokenStream;
+import antlr.TokenStreamException;
 import antlr.collections.impl.BitSet;
-import antlr.collections.AST;
-import antlr.ASTPair;
-import antlr.collections.impl.ASTArray;
-
 import antlr.collections.impl.IndexedVector;
-import java.util.Hashtable;
-import antlr.preprocessor.Grammar;
 
 public class Preprocessor extends antlr.LLkParser
        implements PreprocessorTokenTypes
@@ -53,13 +43,13 @@
 	public final void grammarFile(
 		Hierarchy hier, String file
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  hdr = null;
-		
+
 			Grammar gr;
 			IndexedVector opt=null;
-		
-		
+
+
 		try {      // for error handling
 			{
 			_loop3:
@@ -72,7 +62,7 @@
 				else {
 					break _loop3;
 				}
-				
+
 			} while (true);
 			}
 			{
@@ -99,7 +89,7 @@
 			do {
 				if ((LA(1)==ACTION||LA(1)==LITERAL_class)) {
 					gr=class_def(file, hier);
-					
+
 								if ( gr!=null && opt!=null ) {
 									hier.getFile(file).setOptions(opt);
 								}
@@ -107,12 +97,12 @@
 									gr.setFileName(file);
 									hier.addGrammar(gr);
 								}
-								
+
 				}
 				else {
 					break _loop6;
 				}
-				
+
 			} while (true);
 			}
 			match(Token.EOF_TYPE);
@@ -123,18 +113,18 @@
 			consumeUntil(_tokenSet_0);
 		}
 	}
-	
+
 	public final IndexedVector  optionSpec(
 		Grammar gr
 	) throws RecognitionException, TokenStreamException {
 		IndexedVector options;
-		
+
 		Token  op = null;
 		Token  rhs = null;
-		
+
 			options = new IndexedVector();
-		
-		
+
+
 		try {      // for error handling
 			match(OPTIONS_START);
 			{
@@ -145,7 +135,7 @@
 					match(ID);
 					rhs = LT(1);
 					match(ASSIGN_RHS);
-					
+
 									Option newOp = new Option(op.getText(),rhs.getText(),gr);
 									options.appendElement(newOp.getName(),newOp);
 									if ( gr!=null && op.getText().equals("importVocab") ) {
@@ -157,12 +147,12 @@
 										// This is heinously inconsistent!  Ugh.
 										gr.exportVocab = rhs.getText().substring(0,rhs.getText().length()-1);
 									}
-									
+
 				}
 				else {
 					break _loop16;
 				}
-				
+
 			} while (true);
 			}
 			match(RCURLY);
@@ -174,23 +164,23 @@
 		}
 		return options;
 	}
-	
+
 	public final Grammar  class_def(
 		String file, Hierarchy hier
 	) throws RecognitionException, TokenStreamException {
 		Grammar gr;
-		
+
 		Token  preamble = null;
 		Token  sub = null;
 		Token  sup = null;
 		Token  tk = null;
 		Token  memberA = null;
-		
+
 			gr=null;
 			IndexedVector rules = new IndexedVector(100);
 			IndexedVector classOptions = null;
-		
-		
+
+
 		try {      // for error handling
 			{
 			switch ( LA(1)) {
@@ -217,7 +207,7 @@
 			sup = LT(1);
 			match(ID);
 			match(SEMI);
-			
+
 						gr = (Grammar)hier.getGrammar(sub.getText());
 						if ( gr!=null ) {
 			//				antlr.Tool.toolError("redefinition of grammar "+gr.getName()+" ignored");
@@ -230,7 +220,7 @@
 								gr.setPreambleAction(preamble.getText());
 							}
 						}
-					
+
 			{
 			switch ( LA(1)) {
 			case OPTIONS_START:
@@ -253,11 +243,11 @@
 			}
 			}
 			}
-			
+
 					if ( gr!=null ) {
 						gr.setOptions(classOptions);
 					}
-					
+
 			{
 			switch ( LA(1)) {
 			case TOKENS_SPEC:
@@ -313,7 +303,7 @@
 				else {
 					if ( _cnt13>=1 ) { break _loop13; } else {throw new NoViableAltException(LT(1), getFilename());}
 				}
-				
+
 				_cnt13++;
 			} while (true);
 			}
@@ -325,23 +315,23 @@
 		}
 		return gr;
 	}
-	
+
 	public final void rule(
 		Grammar gr
 	) throws RecognitionException, TokenStreamException {
-		
+
 		Token  r = null;
 		Token  arg = null;
 		Token  ret = null;
 		Token  init = null;
 		Token  blk = null;
-		
+
 			IndexedVector o = null;	// options for rule
 			String vis = null;
 			boolean bang=false;
 			String eg=null, thr="";
-		
-		
+
+
 		try {      // for error handling
 			{
 			switch ( LA(1)) {
@@ -500,7 +490,7 @@
 			blk = LT(1);
 			match(RULE_BLOCK);
 			eg=exceptionGroup();
-			
+
 					String rtext = blk.getText()+eg;
 					Rule ppr = new Rule(r.getText(),rtext,o,gr);
 					ppr.setThrowsSpec(thr);
@@ -520,7 +510,7 @@
 					if ( gr!=null ) {
 						gr.addRule(ppr);
 					}
-					
+
 		}
 		catch (RecognitionException ex) {
 			reportError(ex);
@@ -528,14 +518,14 @@
 			consumeUntil(_tokenSet_4);
 		}
 	}
-	
+
 	public final String  throwsSpec() throws RecognitionException, TokenStreamException {
 		String t;
-		
+
 		Token  a = null;
 		Token  b = null;
 		t="throws ";
-		
+
 		try {      // for error handling
 			match(LITERAL_throws);
 			a = LT(1);
@@ -553,7 +543,7 @@
 				else {
 					break _loop27;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -564,12 +554,12 @@
 		}
 		return t;
 	}
-	
+
 	public final String  exceptionGroup() throws RecognitionException, TokenStreamException {
 		String g;
-		
+
 		String e=null; g="";
-		
+
 		try {      // for error handling
 			{
 			_loop30:
@@ -581,7 +571,7 @@
 				else {
 					break _loop30;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -592,15 +582,15 @@
 		}
 		return g;
 	}
-	
+
 	public final String  exceptionSpec() throws RecognitionException, TokenStreamException {
 		String es;
-		
+
 		Token  aa = null;
 		String h=null;
 		es = System.getProperty("line.separator")+"exception ";
-		
-		
+
+
 		try {      // for error handling
 			match(LITERAL_exception);
 			{
@@ -640,7 +630,7 @@
 				else {
 					break _loop34;
 				}
-				
+
 			} while (true);
 			}
 		}
@@ -651,14 +641,14 @@
 		}
 		return es;
 	}
-	
+
 	public final String  exceptionHandler() throws RecognitionException, TokenStreamException {
 		String h;
-		
+
 		Token  a1 = null;
 		Token  a2 = null;
 		h=null;
-		
+
 		try {      // for error handling
 			match(LITERAL_catch);
 			a1 = LT(1);
@@ -675,8 +665,8 @@
 		}
 		return h;
 	}
-	
-	
+
+
 	public static final String[] _tokenNames = {
 		"<0>",
 		"EOF",
@@ -720,7 +710,7 @@
 		"DIGIT",
 		"XDIGIT"
 	};
-	
+
 	private static final long _tokenSet_0_data_[] = { 2L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { 2329026L, 0L };
@@ -737,5 +727,5 @@
 	public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
 	private static final long _tokenSet_7_data_[] = { 50561474L, 0L };
 	public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
-	
+
 	}



1.4       +85 -89    e/src/jsrc/antlr/preprocessor/PreprocessorLexer.java

Index: PreprocessorLexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/PreprocessorLexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PreprocessorLexer.java	2001/10/26 03:08:59	1.3
+++ PreprocessorLexer.java	2001/11/29 20:33:29	1.4
@@ -2,29 +2,25 @@
 
 package antlr.preprocessor;
 
-import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
+import antlr.ANTLRHashString;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
 import antlr.CharStreamException;
 import antlr.CharStreamIOException;
-import antlr.ANTLRException;
-import java.io.Reader;
-import java.util.Hashtable;
-import antlr.CharScanner;
 import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
+import antlr.LexerSharedInputState;
 import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
+import antlr.RecognitionException;
+import antlr.Token;
 import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
 import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Hashtable;
 
 public class PreprocessorLexer extends antlr.CharScanner implements PreprocessorTokenTypes, TokenStream
  {
@@ -192,7 +188,7 @@
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RULE_BLOCK;
 		int _saveIndex;
-		
+
 		match(':');
 		{
 		if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
@@ -205,7 +201,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		mALT(false);
 		{
@@ -243,7 +239,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 				mALT(false);
 				{
@@ -269,7 +265,7 @@
 			else {
 				break _loop42;
 			}
-			
+
 		} while (true);
 		}
 		match(';');
@@ -279,12 +275,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = WS;
 		int _saveIndex;
-		
+
 		{
 		int _cnt82=0;
 		_loop82:
@@ -301,7 +297,7 @@
 			else {
 				if ( _cnt82>=1 ) { break _loop82; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
 			}
-			
+
 			_cnt82++;
 		} while (true);
 		}
@@ -312,12 +308,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mALT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ALT;
 		int _saveIndex;
-		
+
 		{
 		_loop53:
 		do {
@@ -327,7 +323,7 @@
 			else {
 				break _loop53;
 			}
-			
+
 		} while (true);
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -336,12 +332,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSUBRULE_BLOCK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SUBRULE_BLOCK;
 		int _saveIndex;
-		
+
 		match('(');
 		{
 		if ((_tokenSet_0.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
@@ -352,7 +348,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		mALT(false);
 		{
@@ -386,14 +382,14 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 				mALT(false);
 			}
 			else {
 				break _loop48;
 			}
-			
+
 		} while (true);
 		}
 		{
@@ -429,7 +425,7 @@
 		}
 		else {
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -437,12 +433,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ELEMENT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '/':
 		{
@@ -520,12 +516,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMENT;
 		int _saveIndex;
-		
+
 		{
 		if ((LA(1)=='/') && (LA(2)=='/')) {
 			mSL_COMMENT(false);
@@ -536,7 +532,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		_ttype = Token.SKIP;
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -545,12 +541,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ACTION;
 		int _saveIndex;
-		
+
 		match('{');
 		{
 		_loop112:
@@ -578,7 +574,7 @@
 			else {
 				break _loop112;
 			}
-			
+
 		} while (true);
 		}
 		match('}');
@@ -588,12 +584,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = STRING_LITERAL;
 		int _saveIndex;
-		
+
 		match('"');
 		{
 		_loop97:
@@ -653,12 +649,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CHAR_LITERAL;
 		int _saveIndex;
-		
+
 		match('\'');
 		{
 		switch ( LA(1)) {
@@ -715,12 +711,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mNEWLINE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = NEWLINE;
 		int _saveIndex;
-		
+
 		{
 		if ((LA(1)=='\r') && (LA(2)=='\n')) {
 			match('\r');
@@ -738,7 +734,7 @@
 		else {
 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -746,12 +742,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mBANG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = BANG;
 		int _saveIndex;
-		
+
 		match('!');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -759,12 +755,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SEMI;
 		int _saveIndex;
-		
+
 		match(';');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -772,12 +768,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = COMMA;
 		int _saveIndex;
-		
+
 		match(',');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -785,12 +781,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = RCURLY;
 		int _saveIndex;
-		
+
 		match('}');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -798,7 +794,7 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 /** This rule picks off keywords in the lexer that need to be
  *  handled specially.  For example, "header" is the start
  *  of the header action (used to distinguish between options
@@ -811,7 +807,7 @@
 		_ttype = ID_OR_KEYWORD;
 		int _saveIndex;
 		Token id=null;
-		
+
 		mID(true);
 		id=_returnToken;
 		_ttype = id.getType();
@@ -826,7 +822,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			{
 			switch ( LA(1)) {
@@ -922,7 +918,7 @@
 		}
 		else {
 		}
-		
+
 		}
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -930,12 +926,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ID;
 		int _saveIndex;
-		
+
 		{
 		switch ( LA(1)) {
 		case 'a':  case 'b':  case 'c':  case 'd':
@@ -1023,12 +1019,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mCURLY_BLOCK_SCARF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = CURLY_BLOCK_SCARF;
 		int _saveIndex;
-		
+
 		match('{');
 		{
 		_loop72:
@@ -1053,7 +1049,7 @@
 			else {
 				break _loop72;
 			}
-			
+
 		} while (true);
 		}
 		match('}');
@@ -1063,12 +1059,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mASSIGN_RHS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ASSIGN_RHS;
 		int _saveIndex;
-		
+
 		_saveIndex=text.length();
 		match('=');
 		text.setLength(_saveIndex);
@@ -1092,7 +1088,7 @@
 			else {
 				break _loop79;
 			}
-			
+
 		} while (true);
 		}
 		match(';');
@@ -1102,12 +1098,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = SL_COMMENT;
 		int _saveIndex;
-		
+
 		match("//");
 		{
 		_loop89:
@@ -1120,7 +1116,7 @@
 			else {
 				break _loop89;
 			}
-			
+
 		} while (true);
 		}
 		mNEWLINE(false);
@@ -1130,12 +1126,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ML_COMMENT;
 		int _saveIndex;
-		
+
 		match("/*");
 		{
 		_loop92:
@@ -1151,7 +1147,7 @@
 			else {
 				break _loop92;
 			}
-			
+
 		} while (true);
 		}
 		match("*/");
@@ -1161,12 +1157,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ESC;
 		int _saveIndex;
-		
+
 		match('\\');
 		{
 		switch ( LA(1)) {
@@ -1237,7 +1233,7 @@
 				else {
 					throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 				}
-				
+
 				}
 			}
 			else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
@@ -1245,7 +1241,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -1263,7 +1259,7 @@
 			else {
 				throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
 			}
-			
+
 			}
 			break;
 		}
@@ -1288,12 +1284,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = DIGIT;
 		int _saveIndex;
-		
+
 		matchRange('0','9');
 		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
 			_token = makeToken(_ttype);
@@ -1301,12 +1297,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	protected final void mXDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = XDIGIT;
 		int _saveIndex;
-		
+
 		switch ( LA(1)) {
 		case '0':  case '1':  case '2':  case '3':
 		case '4':  case '5':  case '6':  case '7':
@@ -1338,12 +1334,12 @@
 		}
 		_returnToken = _token;
 	}
-	
+
 	public final void mARG_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
 		int _ttype; Token _token=null; int _begin=text.length();
 		_ttype = ARG_ACTION;
 		int _saveIndex;
-		
+
 		match('[');
 		{
 		_loop109:
@@ -1368,7 +1364,7 @@
 			else {
 				break _loop109;
 			}
-			
+
 		} while (true);
 		}
 		match(']');
@@ -1378,8 +1374,8 @@
 		}
 		_returnToken = _token;
 	}
-	
-	
+
+
 	private static final long _tokenSet_0_data_[] = { 4294977024L, 0L, 0L };
 	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
 	private static final long _tokenSet_1_data_[] = { -2199023255560L, 9223372036854775807L, 0L, 0L };
@@ -1398,5 +1394,5 @@
 	public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
 	private static final long _tokenSet_8_data_[] = { 140741783332352L, 576460752303423488L, 0L, 0L };
 	public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
-	
+
 	}



1.4       +3 -3      e/src/jsrc/antlr/preprocessor/Rule.java

Index: Rule.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Rule.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Rule.java	2001/10/26 03:08:59	1.3
+++ Rule.java	2001/11/29 20:33:29	1.4
@@ -4,11 +4,11 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Rule.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: Rule.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 import antlr.collections.impl.IndexedVector;
-import java.util.Hashtable;
+
 import java.util.Enumeration;
 
 class Rule {
@@ -108,7 +108,7 @@
 		}
 		if ( initAction!=null ) {
 			s+=initAction+System.getProperty("line.separator");
-		}	
+		}
 		s += block;
 		return s;
 	}



1.4       +10 -7     e/src/jsrc/antlr/preprocessor/Tool.java

Index: Tool.java
===================================================================
RCS file: /cvs/e/src/jsrc/antlr/preprocessor/Tool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Tool.java	2001/10/26 03:08:59	1.3
+++ Tool.java	2001/11/29 20:33:29	1.4
@@ -4,15 +4,18 @@
  * Project led by Terence Parr at http://www.jGuru.com
  * Software rights: http://www.antlr.org/RIGHTS.html
  *
- * $Id: Tool.java,v 1.3 2001/10/26 03:08:59 markm Exp $
+ * $Id: Tool.java,v 1.4 2001/11/29 20:33:29 markm Exp $
  */
 
 /*
  * Tester for the preprocessor
- * 
+ *
  */
-import java.io.*;
 import antlr.collections.impl.Vector;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.Enumeration;
 
 public class Tool {
@@ -34,7 +37,7 @@
 	for (int i=0; i<a.length; i++) {
 	    System.out.print(" "+a[i]);
 	}
-	System.out.println();	
+	System.out.println();
     }
     public boolean preprocess() {
 	if (grammarFileName == null) {
@@ -97,7 +100,7 @@
 	for (int i=0; i<incomingArgs.length; i++) {
 	    if ( incomingArgs[i].equals("-glib") ) {
 				// if on a pc and they use a '/', warn them
-		if ( File.separator.equals("\\") && 
+		if ( File.separator.equals("\\") &&
 		     incomingArgs[i].indexOf('/') != -1 ) {
 		    antlrTool.warning("-glib cannot deal with '/' on a PC: use '\\'; ignoring...");
 		}
@@ -118,13 +121,13 @@
 	    }
 	    else if (incomingArgs[i].charAt(0) == '-') {
 		args[this.nargs++] = incomingArgs[i];
-	    }	
+	    }
 	    else {
 		// Must be the grammar file
 		grammarFileName = incomingArgs[i];
 		if ( grammars==null ) {
 		    grammars = new Vector(10);
-		}	
+		}
 		grammars.appendElement(grammarFileName);	// process it too
 		if ( (i+1)<incomingArgs.length ) {
 		    antlrTool.warning("grammar file must be last; ignoring other arguments...");