diff options
author | Rich Hickey <richhickey@gmail.com> | 2007-08-19 01:42:52 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2007-08-19 01:42:52 +0000 |
commit | 92075ac2c07da8a76bb3b07db4e59c8f7a10d915 (patch) | |
tree | f29ca3c6ff494bc2b805208a95ac8e372bd51f54 /src | |
parent | 508d68d6c108114195188cf18260759d2f35ac5e (diff) |
got rid of ANTLR reader
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/ReaderLexer.java | 2498 | ||||
-rw-r--r-- | src/jvm/clojure/lang/ReaderParser.java | 2675 |
2 files changed, 0 insertions, 5173 deletions
diff --git a/src/jvm/clojure/lang/ReaderLexer.java b/src/jvm/clojure/lang/ReaderLexer.java deleted file mode 100644 index 4a916507..00000000 --- a/src/jvm/clojure/lang/ReaderLexer.java +++ /dev/null @@ -1,2498 +0,0 @@ -// $ANTLR 3.0 /Users/rich/dev/clojure/src/jvm/Reader.g 2007-08-02 16:47:44 - -/** - * Copyright (c) Rich Hickey. All rights reserved. - * The use and distribution terms for this software are covered by the - * Common Public License 1.0 (http://opensource.org/licenses/cpl.php) - * which can be found in the file CPL.TXT at the root of this distribution. - * By using this software in any fashion, you are agreeing to be bound by - * the terms of this license. - * You must not remove this notice, or any other, from this software. - **/ -package clojure.lang; - - -import org.antlr.runtime.*; - -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -public class ReaderLexer extends Lexer{ -public static final int TrueToken = 11; -public static final int T29 = 29; -public static final int Exponent = 19; -public static final int OctalLiteral = 15; -public static final int T33 = 33; -public static final int Identifier = 4; -public static final int HexDigit = 18; -public static final int T36 = 36; -public static final int WS = 26; -public static final int CharacterLiteral = 9; -public static final int MethodIdentifier = 16; -public static final int NSIdentifier = 5; -public static final int T35 = 35; -public static final int COMMENT = 27; -public static final int KeywordIdentifier = 7; -public static final int StringLiteral = 10; -public static final int LINE_COMMENT = 28; -public static final int DotDot = 6; -public static final int T34 = 34; -public static final int JavaIDDigit = 25; -public static final int Letter = 24; -public static final int UnicodeEscape = 22; -public static final int Comma = 17; -public static final int HexLiteral = 14; -public static final int T37 = 37; -public static final int EscapeSequence = 21; -public static final int NullToken = 12; -public static final int EOF = -1; -public static final int DecimalLiteral = 13; -public static final int T32 = 32; -public static final int Tokens = 40; -public static final int T31 = 31; -public static final int OctalEscape = 23; -public static final int T38 = 38; -public static final int FloatingPointLiteral = 8; -public static final int T30 = 30; -public static final int FloatTypeSuffix = 20; -public static final int T39 = 39; - -RecognitionException rex = null; - -public void recover(RecognitionException re){ - super.recover(re); - if(rex == null) - rex = re; -} - -public void reportError(RecognitionException e){ - if(rex == null) - rex = e; -} - -public ReaderLexer(){ - ; -} - -public ReaderLexer(CharStream input){ - super(input); -} - -public String getGrammarFileName(){ - return "/Users/rich/dev/clojure/src/jvm/Reader.g"; -} - -// $ANTLR start T29 -public final void mT29() throws RecognitionException{ - try - { - int _type = T29; - // /Users/rich/dev/clojure/src/jvm/Reader.g:33:7: ( '(' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:33:7: '(' - { - match('('); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T29 - -// $ANTLR start T30 - -public final void mT30() throws RecognitionException{ - try - { - int _type = T30; - // /Users/rich/dev/clojure/src/jvm/Reader.g:34:7: ( ')' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:34:7: ')' - { - match(')'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T30 - -// $ANTLR start T31 - -public final void mT31() throws RecognitionException{ - try - { - int _type = T31; - // /Users/rich/dev/clojure/src/jvm/Reader.g:35:7: ( '[' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:35:7: '[' - { - match('['); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T31 - -// $ANTLR start T32 - -public final void mT32() throws RecognitionException{ - try - { - int _type = T32; - // /Users/rich/dev/clojure/src/jvm/Reader.g:36:7: ( ']' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:36:7: ']' - { - match(']'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T32 - -// $ANTLR start T33 - -public final void mT33() throws RecognitionException{ - try - { - int _type = T33; - // /Users/rich/dev/clojure/src/jvm/Reader.g:37:7: ( '{' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:37:7: '{' - { - match('{'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T33 - -// $ANTLR start T34 - -public final void mT34() throws RecognitionException{ - try - { - int _type = T34; - // /Users/rich/dev/clojure/src/jvm/Reader.g:38:7: ( '}' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:38:7: '}' - { - match('}'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T34 - -// $ANTLR start T35 - -public final void mT35() throws RecognitionException{ - try - { - int _type = T35; - // /Users/rich/dev/clojure/src/jvm/Reader.g:39:7: ( '/' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:39:7: '/' - { - match('/'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T35 - -// $ANTLR start T36 - -public final void mT36() throws RecognitionException{ - try - { - int _type = T36; - // /Users/rich/dev/clojure/src/jvm/Reader.g:40:7: ( '#^' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:40:7: '#^' - { - match("#^"); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T36 - -// $ANTLR start T37 - -public final void mT37() throws RecognitionException{ - try - { - int _type = T37; - // /Users/rich/dev/clojure/src/jvm/Reader.g:41:7: ( '.' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:41:7: '.' - { - match('.'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T37 - -// $ANTLR start T38 - -public final void mT38() throws RecognitionException{ - try - { - int _type = T38; - // /Users/rich/dev/clojure/src/jvm/Reader.g:42:7: ( '\\'' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:42:7: '\\'' - { - match('\''); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T38 - -// $ANTLR start T39 - -public final void mT39() throws RecognitionException{ - try - { - int _type = T39; - // /Users/rich/dev/clojure/src/jvm/Reader.g:43:7: ( '^' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:43:7: '^' - { - match('^'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end T39 - -// $ANTLR start Comma - -public final void mComma() throws RecognitionException{ - try - { - int _type = Comma; - // /Users/rich/dev/clojure/src/jvm/Reader.g:242:10: ( ',' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:242:10: ',' - { - match(','); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end Comma - -// $ANTLR start TrueToken - -public final void mTrueToken() throws RecognitionException{ - try - { - int _type = TrueToken; - // /Users/rich/dev/clojure/src/jvm/Reader.g:244:16: ( 'true' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:244:16: 'true' - { - match("true"); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end TrueToken - -// $ANTLR start NullToken - -public final void mNullToken() throws RecognitionException{ - try - { - int _type = NullToken; - // /Users/rich/dev/clojure/src/jvm/Reader.g:246:16: ( 'null' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:246:16: 'null' - { - match("null"); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end NullToken - -// $ANTLR start DotDot - -public final void mDotDot() throws RecognitionException{ - try - { - int _type = DotDot; - // /Users/rich/dev/clojure/src/jvm/Reader.g:248:10: ( '..' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:248:10: '..' - { - match(".."); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end DotDot - -// $ANTLR start HexLiteral - -public final void mHexLiteral() throws RecognitionException{ - try - { - int _type = HexLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:250:14: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:250:14: '0' ( 'x' | 'X' ) ( HexDigit )+ - { - match('0'); - if(input.LA(1) == 'X' || input.LA(1) == 'x') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:250:28: ( HexDigit )+ - int cnt1 = 0; - loop1: - do - { - int alt1 = 2; - int LA1_0 = input.LA(1); - - if(((LA1_0 >= '0' && LA1_0 <= '9') || (LA1_0 >= 'A' && LA1_0 <= 'F') || (LA1_0 >= 'a' && LA1_0 <= 'f'))) - { - alt1 = 1; - } - - - switch(alt1) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:250:28: HexDigit - { - mHexDigit(); - - } - break; - - default: - if(cnt1 >= 1) break loop1; - EarlyExitException eee = - new EarlyExitException(1, input); - throw eee; - } - cnt1++; - } while(true); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end HexLiteral - -// $ANTLR start DecimalLiteral - -public final void mDecimalLiteral() throws RecognitionException{ - try - { - int _type = DecimalLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:18: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:18: ( '0' | '1' .. '9' ( '0' .. '9' )* ) - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:18: ( '0' | '1' .. '9' ( '0' .. '9' )* ) - int alt3 = 2; - int LA3_0 = input.LA(1); - - if((LA3_0 == '0')) - { - alt3 = 1; - } - else if(((LA3_0 >= '1' && LA3_0 <= '9'))) - { - alt3 = 2; - } - else - { - NoViableAltException nvae = - new NoViableAltException("252:18: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 3, 0, input); - - throw nvae; - } - switch(alt3) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:19: '0' - { - match('0'); - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:25: '1' .. '9' ( '0' .. '9' )* - { - matchRange('1', '9'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:34: ( '0' .. '9' )* - loop2: - do - { - int alt2 = 2; - int LA2_0 = input.LA(1); - - if(((LA2_0 >= '0' && LA2_0 <= '9'))) - { - alt2 = 1; - } - - - switch(alt2) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:252:34: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - break loop2; - } - } while(true); - - - } - break; - - } - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end DecimalLiteral - -// $ANTLR start OctalLiteral - -public final void mOctalLiteral() throws RecognitionException{ - try - { - int _type = OctalLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:254:16: ( '0' ( '0' .. '7' )+ ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:254:16: '0' ( '0' .. '7' )+ - { - match('0'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:254:20: ( '0' .. '7' )+ - int cnt4 = 0; - loop4: - do - { - int alt4 = 2; - int LA4_0 = input.LA(1); - - if(((LA4_0 >= '0' && LA4_0 <= '7'))) - { - alt4 = 1; - } - - - switch(alt4) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:254:21: '0' .. '7' - { - matchRange('0', '7'); - - } - break; - - default: - if(cnt4 >= 1) break loop4; - EarlyExitException eee = - new EarlyExitException(4, input); - throw eee; - } - cnt4++; - } while(true); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end OctalLiteral - -// $ANTLR start HexDigit - -public final void mHexDigit() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:257:12: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:257:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) - { - if((input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'F') || - (input.LA(1) >= 'a' && input.LA(1) <= 'f')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - - } - finally - { - } -} -// $ANTLR end HexDigit - -// $ANTLR start FloatingPointLiteral - -public final void mFloatingPointLiteral() throws RecognitionException{ - try - { - int _type = FloatingPointLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:9: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix ) - int alt16 = 4; - alt16 = dfa16.predict(input); - switch(alt16) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:9: ( '0' .. '9' )+ - int cnt5 = 0; - loop5: - do - { - int alt5 = 2; - int LA5_0 = input.LA(1); - - if(((LA5_0 >= '0' && LA5_0 <= '9'))) - { - alt5 = 1; - } - - - switch(alt5) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:10: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - if(cnt5 >= 1) break loop5; - EarlyExitException eee = - new EarlyExitException(5, input); - throw eee; - } - cnt5++; - } while(true); - - match('.'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:25: ( '0' .. '9' )* - loop6: - do - { - int alt6 = 2; - int LA6_0 = input.LA(1); - - if(((LA6_0 >= '0' && LA6_0 <= '9'))) - { - alt6 = 1; - } - - - switch(alt6) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:26: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - break loop6; - } - } while(true); - - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:37: ( Exponent )? - int alt7 = 2; - int LA7_0 = input.LA(1); - - if((LA7_0 == 'E' || LA7_0 == 'e')) - { - alt7 = 1; - } - switch(alt7) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:37: Exponent - { - mExponent(); - - } - break; - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:47: ( FloatTypeSuffix )? - int alt8 = 2; - int LA8_0 = input.LA(1); - - if((LA8_0 == 'D' || LA8_0 == 'F' || LA8_0 == 'd' || LA8_0 == 'f')) - { - alt8 = 1; - } - switch(alt8) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:260:47: FloatTypeSuffix - { - mFloatTypeSuffix(); - - } - break; - - } - - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? - { - match('.'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:13: ( '0' .. '9' )+ - int cnt9 = 0; - loop9: - do - { - int alt9 = 2; - int LA9_0 = input.LA(1); - - if(((LA9_0 >= '0' && LA9_0 <= '9'))) - { - alt9 = 1; - } - - - switch(alt9) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:14: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - if(cnt9 >= 1) break loop9; - EarlyExitException eee = - new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } while(true); - - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:25: ( Exponent )? - int alt10 = 2; - int LA10_0 = input.LA(1); - - if((LA10_0 == 'E' || LA10_0 == 'e')) - { - alt10 = 1; - } - switch(alt10) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:25: Exponent - { - mExponent(); - - } - break; - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:35: ( FloatTypeSuffix )? - int alt11 = 2; - int LA11_0 = input.LA(1); - - if((LA11_0 == 'D' || LA11_0 == 'F' || LA11_0 == 'd' || LA11_0 == 'f')) - { - alt11 = 1; - } - switch(alt11) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:261:35: FloatTypeSuffix - { - mFloatTypeSuffix(); - - } - break; - - } - - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:262:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:262:9: ( '0' .. '9' )+ - int cnt12 = 0; - loop12: - do - { - int alt12 = 2; - int LA12_0 = input.LA(1); - - if(((LA12_0 >= '0' && LA12_0 <= '9'))) - { - alt12 = 1; - } - - - switch(alt12) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:262:10: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - if(cnt12 >= 1) break loop12; - EarlyExitException eee = - new EarlyExitException(12, input); - throw eee; - } - cnt12++; - } while(true); - - mExponent(); - // /Users/rich/dev/clojure/src/jvm/Reader.g:262:30: ( FloatTypeSuffix )? - int alt13 = 2; - int LA13_0 = input.LA(1); - - if((LA13_0 == 'D' || LA13_0 == 'F' || LA13_0 == 'd' || LA13_0 == 'f')) - { - alt13 = 1; - } - switch(alt13) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:262:30: FloatTypeSuffix - { - mFloatTypeSuffix(); - - } - break; - - } - - - } - break; - case 4: - // /Users/rich/dev/clojure/src/jvm/Reader.g:263:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:263:9: ( '0' .. '9' )+ - int cnt14 = 0; - loop14: - do - { - int alt14 = 2; - int LA14_0 = input.LA(1); - - if(((LA14_0 >= '0' && LA14_0 <= '9'))) - { - alt14 = 1; - } - - - switch(alt14) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:263:10: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - if(cnt14 >= 1) break loop14; - EarlyExitException eee = - new EarlyExitException(14, input); - throw eee; - } - cnt14++; - } while(true); - - // /Users/rich/dev/clojure/src/jvm/Reader.g:263:21: ( Exponent )? - int alt15 = 2; - int LA15_0 = input.LA(1); - - if((LA15_0 == 'E' || LA15_0 == 'e')) - { - alt15 = 1; - } - switch(alt15) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:263:21: Exponent - { - mExponent(); - - } - break; - - } - - mFloatTypeSuffix(); - - } - break; - - } - this.type = _type; - } - finally - { - } -} -// $ANTLR end FloatingPointLiteral - -// $ANTLR start Exponent - -public final void mExponent() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:267:12: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:267:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ - { - if(input.LA(1) == 'E' || input.LA(1) == 'e') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:267:22: ( '+' | '-' )? - int alt17 = 2; - int LA17_0 = input.LA(1); - - if((LA17_0 == '+' || LA17_0 == '-')) - { - alt17 = 1; - } - switch(alt17) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g: - { - if(input.LA(1) == '+' || input.LA(1) == '-') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:267:33: ( '0' .. '9' )+ - int cnt18 = 0; - loop18: - do - { - int alt18 = 2; - int LA18_0 = input.LA(1); - - if(((LA18_0 >= '0' && LA18_0 <= '9'))) - { - alt18 = 1; - } - - - switch(alt18) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:267:34: '0' .. '9' - { - matchRange('0', '9'); - - } - break; - - default: - if(cnt18 >= 1) break loop18; - EarlyExitException eee = - new EarlyExitException(18, input); - throw eee; - } - cnt18++; - } while(true); - - - } - - } - finally - { - } -} -// $ANTLR end Exponent - -// $ANTLR start FloatTypeSuffix - -public final void mFloatTypeSuffix() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:270:19: ( ( 'f' | 'F' | 'd' | 'D' ) ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:270:19: ( 'f' | 'F' | 'd' | 'D' ) - { - if(input.LA(1) == 'D' || input.LA(1) == 'F' || input.LA(1) == 'd' || input.LA(1) == 'f') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - - } - finally - { - } -} -// $ANTLR end FloatTypeSuffix - -// $ANTLR start CharacterLiteral - -public final void mCharacterLiteral() throws RecognitionException{ - try - { - int _type = CharacterLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:273:9: ( '\\\\' ( EscapeSequence | ~ ( '\\\\' ) ) ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:273:9: '\\\\' ( EscapeSequence | ~ ( '\\\\' ) ) - { - match('\\'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:273:14: ( EscapeSequence | ~ ( '\\\\' ) ) - int alt19 = 2; - int LA19_0 = input.LA(1); - - if((LA19_0 == '\\')) - { - alt19 = 1; - } - else if(((LA19_0 >= '\u0000' && LA19_0 <= '[') || (LA19_0 >= ']' && LA19_0 <= '\uFFFE'))) - { - alt19 = 2; - } - else - { - NoViableAltException nvae = - new NoViableAltException("273:14: ( EscapeSequence | ~ ( '\\\\' ) )", 19, 0, input); - - throw nvae; - } - switch(alt19) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:273:16: EscapeSequence - { - mEscapeSequence(); - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:273:33: ~ ( '\\\\' ) - { - if((input.LA(1) >= '\u0000' && input.LA(1) <= '[') || (input.LA(1) >= ']' && input.LA(1) <= '\uFFFE')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - } - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end CharacterLiteral - -// $ANTLR start StringLiteral - -public final void mStringLiteral() throws RecognitionException{ - try - { - int _type = StringLiteral; - // /Users/rich/dev/clojure/src/jvm/Reader.g:277:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:277:8: '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' - { - match('\"'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:277:12: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* - loop20: - do - { - int alt20 = 3; - int LA20_0 = input.LA(1); - - if((LA20_0 == '\\')) - { - alt20 = 1; - } - else if(((LA20_0 >= '\u0000' && LA20_0 <= '!') || (LA20_0 >= '#' && LA20_0 <= '[') || - (LA20_0 >= ']' && LA20_0 <= '\uFFFE'))) - { - alt20 = 2; - } - - - switch(alt20) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:277:14: EscapeSequence - { - mEscapeSequence(); - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:277:31: ~ ( '\\\\' | '\"' ) - { - if((input.LA(1) >= '\u0000' && input.LA(1) <= '!') || (input.LA(1) >= '#' && input.LA(1) <= '[') || - (input.LA(1) >= ']' && input.LA(1) <= '\uFFFE')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - default: - break loop20; - } - } while(true); - - match('\"'); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end StringLiteral - -// $ANTLR start EscapeSequence - -public final void mEscapeSequence() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:282:9: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape ) - int alt21 = 3; - int LA21_0 = input.LA(1); - - if((LA21_0 == '\\')) - { - switch(input.LA(2)) - { - case'\"': - case'\'': - case'\\': - case'b': - case'f': - case'n': - case'r': - case't': - { - alt21 = 1; - } - break; - case'u': - { - alt21 = 2; - } - break; - case'0': - case'1': - case'2': - case'3': - case'4': - case'5': - case'6': - case'7': - { - alt21 = 3; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException( - "280:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", - 21, 1, input); - - throw nvae; - } - - } - else - { - NoViableAltException nvae = - new NoViableAltException( - "280:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", - 21, 0, input); - - throw nvae; - } - switch(alt21) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:282:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) - { - match('\\'); - if(input.LA(1) == '\"' || input.LA(1) == '\'' || input.LA(1) == '\\' || input.LA(1) == 'b' || - input.LA(1) == 'f' || input.LA(1) == 'n' || input.LA(1) == 'r' || input.LA(1) == 't') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:283:9: UnicodeEscape - { - mUnicodeEscape(); - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:284:9: OctalEscape - { - mOctalEscape(); - - } - break; - - } - } - finally - { - } -} -// $ANTLR end EscapeSequence - -// $ANTLR start OctalEscape - -public final void mOctalEscape() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:9: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ) - int alt22 = 3; - int LA22_0 = input.LA(1); - - if((LA22_0 == '\\')) - { - int LA22_1 = input.LA(2); - - if(((LA22_1 >= '0' && LA22_1 <= '3'))) - { - int LA22_2 = input.LA(3); - - if(((LA22_2 >= '0' && LA22_2 <= '7'))) - { - int LA22_4 = input.LA(4); - - if(((LA22_4 >= '0' && LA22_4 <= '7'))) - { - alt22 = 1; - } - else - { - alt22 = 2; - } - } - else - { - alt22 = 3; - } - } - else if(((LA22_1 >= '4' && LA22_1 <= '7'))) - { - int LA22_3 = input.LA(3); - - if(((LA22_3 >= '0' && LA22_3 <= '7'))) - { - alt22 = 2; - } - else - { - alt22 = 3; - } - } - else - { - NoViableAltException nvae = - new NoViableAltException( - "287:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", - 22, 1, input); - - throw nvae; - } - } - else - { - NoViableAltException nvae = - new NoViableAltException( - "287:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", - 22, 0, input); - - throw nvae; - } - switch(alt22) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) - { - match('\\'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:14: ( '0' .. '3' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:15: '0' .. '3' - { - matchRange('0', '3'); - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:25: ( '0' .. '7' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:26: '0' .. '7' - { - matchRange('0', '7'); - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:36: ( '0' .. '7' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:289:37: '0' .. '7' - { - matchRange('0', '7'); - - } - - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:290:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) - { - match('\\'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:290:14: ( '0' .. '7' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:290:15: '0' .. '7' - { - matchRange('0', '7'); - - } - - // /Users/rich/dev/clojure/src/jvm/Reader.g:290:25: ( '0' .. '7' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:290:26: '0' .. '7' - { - matchRange('0', '7'); - - } - - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:291:9: '\\\\' ( '0' .. '7' ) - { - match('\\'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:291:14: ( '0' .. '7' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:291:15: '0' .. '7' - { - matchRange('0', '7'); - - } - - - } - break; - - } - } - finally - { - } -} -// $ANTLR end OctalEscape - -// $ANTLR start UnicodeEscape - -public final void mUnicodeEscape() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:296:9: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:296:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit - { - match('\\'); - match('u'); - mHexDigit(); - mHexDigit(); - mHexDigit(); - mHexDigit(); - - } - - } - finally - { - } -} -// $ANTLR end UnicodeEscape - -// $ANTLR start Identifier - -public final void mIdentifier() throws RecognitionException{ - try - { - int _type = Identifier; - // /Users/rich/dev/clojure/src/jvm/Reader.g:306:6: ( Letter ( '-' | Letter | JavaIDDigit )* ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:306:6: Letter ( '-' | Letter | JavaIDDigit )* - { - mLetter(); - // /Users/rich/dev/clojure/src/jvm/Reader.g:306:13: ( '-' | Letter | JavaIDDigit )* - loop23: - do - { - int alt23 = 2; - int LA23_0 = input.LA(1); - - if((LA23_0 == '$' || LA23_0 == '-' || (LA23_0 >= '0' && LA23_0 <= '9') || - (LA23_0 >= 'A' && LA23_0 <= 'Z') || LA23_0 == '_' || (LA23_0 >= 'a' && LA23_0 <= 'z') || - (LA23_0 >= '\u00C0' && LA23_0 <= '\u00D6') || (LA23_0 >= '\u00D8' && LA23_0 <= '\u00F6') || - (LA23_0 >= '\u00F8' && LA23_0 <= '\u1FFF') || (LA23_0 >= '\u3040' && LA23_0 <= '\u318F') || - (LA23_0 >= '\u3300' && LA23_0 <= '\u337F') || (LA23_0 >= '\u3400' && LA23_0 <= '\u3D2D') || - (LA23_0 >= '\u4E00' && LA23_0 <= '\u9FFF') || (LA23_0 >= '\uF900' && LA23_0 <= '\uFAFF'))) - { - alt23 = 1; - } - - - switch(alt23) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g: - { - if(input.LA(1) == '$' || input.LA(1) == '-' || (input.LA(1) >= '0' && input.LA(1) <= '9') || - (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || - (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u00C0' && input.LA(1) <= '\u00D6') || - (input.LA(1) >= '\u00D8' && input.LA(1) <= '\u00F6') || - (input.LA(1) >= '\u00F8' && input.LA(1) <= '\u1FFF') || - (input.LA(1) >= '\u3040' && input.LA(1) <= '\u318F') || - (input.LA(1) >= '\u3300' && input.LA(1) <= '\u337F') || - (input.LA(1) >= '\u3400' && input.LA(1) <= '\u3D2D') || - (input.LA(1) >= '\u4E00' && input.LA(1) <= '\u9FFF') || - (input.LA(1) >= '\uF900' && input.LA(1) <= '\uFAFF')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - default: - break loop23; - } - } while(true); - - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end Identifier - -// $ANTLR start NSIdentifier - -public final void mNSIdentifier() throws RecognitionException{ - try - { - int _type = NSIdentifier; - // /Users/rich/dev/clojure/src/jvm/Reader.g:310:3: ( Identifier '/' Identifier ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:310:3: Identifier '/' Identifier - { - mIdentifier(); - match('/'); - mIdentifier(); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end NSIdentifier - -// $ANTLR start KeywordIdentifier - -public final void mKeywordIdentifier() throws RecognitionException{ - try - { - int _type = KeywordIdentifier; - // /Users/rich/dev/clojure/src/jvm/Reader.g:314:3: ( ':' Identifier '/' Identifier | ':' Identifier ) - int alt24 = 2; - alt24 = dfa24.predict(input); - switch(alt24) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:314:3: ':' Identifier '/' Identifier - { - match(':'); - mIdentifier(); - match('/'); - mIdentifier(); - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:315:3: ':' Identifier - { - match(':'); - mIdentifier(); - - } - break; - - } - this.type = _type; - } - finally - { - } -} -// $ANTLR end KeywordIdentifier - -// $ANTLR start MethodIdentifier - -public final void mMethodIdentifier() throws RecognitionException{ - try - { - int _type = MethodIdentifier; - // /Users/rich/dev/clojure/src/jvm/Reader.g:319:9: ( Letter ( Letter | JavaIDDigit )* '(' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:319:9: Letter ( Letter | JavaIDDigit )* '(' - { - mLetter(); - // /Users/rich/dev/clojure/src/jvm/Reader.g:319:16: ( Letter | JavaIDDigit )* - loop25: - do - { - int alt25 = 2; - int LA25_0 = input.LA(1); - - if((LA25_0 == '$' || (LA25_0 >= '0' && LA25_0 <= '9') || (LA25_0 >= 'A' && LA25_0 <= 'Z') || - LA25_0 == '_' || (LA25_0 >= 'a' && LA25_0 <= 'z') || (LA25_0 >= '\u00C0' && LA25_0 <= '\u00D6') || - (LA25_0 >= '\u00D8' && LA25_0 <= '\u00F6') || (LA25_0 >= '\u00F8' && LA25_0 <= '\u1FFF') || - (LA25_0 >= '\u3040' && LA25_0 <= '\u318F') || (LA25_0 >= '\u3300' && LA25_0 <= '\u337F') || - (LA25_0 >= '\u3400' && LA25_0 <= '\u3D2D') || (LA25_0 >= '\u4E00' && LA25_0 <= '\u9FFF') || - (LA25_0 >= '\uF900' && LA25_0 <= '\uFAFF'))) - { - alt25 = 1; - } - - - switch(alt25) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g: - { - if(input.LA(1) == '$' || (input.LA(1) >= '0' && input.LA(1) <= '9') || - (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || - (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u00C0' && input.LA(1) <= '\u00D6') || - (input.LA(1) >= '\u00D8' && input.LA(1) <= '\u00F6') || - (input.LA(1) >= '\u00F8' && input.LA(1) <= '\u1FFF') || - (input.LA(1) >= '\u3040' && input.LA(1) <= '\u318F') || - (input.LA(1) >= '\u3300' && input.LA(1) <= '\u337F') || - (input.LA(1) >= '\u3400' && input.LA(1) <= '\u3D2D') || - (input.LA(1) >= '\u4E00' && input.LA(1) <= '\u9FFF') || - (input.LA(1) >= '\uF900' && input.LA(1) <= '\uFAFF')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - default: - break loop25; - } - } while(true); - - match('('); - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end MethodIdentifier - -// $ANTLR start Letter - -public final void mLetter() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:326:8: ( '\\u0024' | '\\u0041' .. '\\u005a' | '\\u005f' | '\\u0061' .. '\\u007a' | '\\u00c0' .. '\\u00d6' | '\\u00d8' .. '\\u00f6' | '\\u00f8' .. '\\u00ff' | '\\u0100' .. '\\u1fff' | '\\u3040' .. '\\u318f' | '\\u3300' .. '\\u337f' | '\\u3400' .. '\\u3d2d' | '\\u4e00' .. '\\u9fff' | '\\uf900' .. '\\ufaff' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g: - { - if(input.LA(1) == '$' || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || - (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u00C0' && input.LA(1) <= '\u00D6') || - (input.LA(1) >= '\u00D8' && input.LA(1) <= '\u00F6') || - (input.LA(1) >= '\u00F8' && input.LA(1) <= '\u1FFF') || - (input.LA(1) >= '\u3040' && input.LA(1) <= '\u318F') || - (input.LA(1) >= '\u3300' && input.LA(1) <= '\u337F') || - (input.LA(1) >= '\u3400' && input.LA(1) <= '\u3D2D') || - (input.LA(1) >= '\u4E00' && input.LA(1) <= '\u9FFF') || (input.LA(1) >= '\uF900' && input.LA(1) <= '\uFAFF')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - - } - finally - { - } -} -// $ANTLR end Letter - -// $ANTLR start JavaIDDigit - -public final void mJavaIDDigit() throws RecognitionException{ - try - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:344:6: ( '\\u0030' .. '\\u0039' | '\\u0660' .. '\\u0669' | '\\u06f0' .. '\\u06f9' | '\\u0966' .. '\\u096f' | '\\u09e6' .. '\\u09ef' | '\\u0a66' .. '\\u0a6f' | '\\u0ae6' .. '\\u0aef' | '\\u0b66' .. '\\u0b6f' | '\\u0be7' .. '\\u0bef' | '\\u0c66' .. '\\u0c6f' | '\\u0ce6' .. '\\u0cef' | '\\u0d66' .. '\\u0d6f' | '\\u0e50' .. '\\u0e59' | '\\u0ed0' .. '\\u0ed9' | '\\u1040' .. '\\u1049' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g: - { - if((input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= '\u0660' && input.LA(1) <= '\u0669') || - (input.LA(1) >= '\u06F0' && input.LA(1) <= '\u06F9') || - (input.LA(1) >= '\u0966' && input.LA(1) <= '\u096F') || - (input.LA(1) >= '\u09E6' && input.LA(1) <= '\u09EF') || - (input.LA(1) >= '\u0A66' && input.LA(1) <= '\u0A6F') || - (input.LA(1) >= '\u0AE6' && input.LA(1) <= '\u0AEF') || - (input.LA(1) >= '\u0B66' && input.LA(1) <= '\u0B6F') || - (input.LA(1) >= '\u0BE7' && input.LA(1) <= '\u0BEF') || - (input.LA(1) >= '\u0C66' && input.LA(1) <= '\u0C6F') || - (input.LA(1) >= '\u0CE6' && input.LA(1) <= '\u0CEF') || - (input.LA(1) >= '\u0D66' && input.LA(1) <= '\u0D6F') || - (input.LA(1) >= '\u0E50' && input.LA(1) <= '\u0E59') || - (input.LA(1) >= '\u0ED0' && input.LA(1) <= '\u0ED9') || (input.LA(1) >= '\u1040' && input.LA(1) <= '\u1049')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - - } - finally - { - } -} -// $ANTLR end JavaIDDigit - -// $ANTLR start WS - -public final void mWS() throws RecognitionException{ - try - { - int _type = WS; - // /Users/rich/dev/clojure/src/jvm/Reader.g:361:8: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:361:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) - { - if((input.LA(1) >= '\t' && input.LA(1) <= '\n') || (input.LA(1) >= '\f' && input.LA(1) <= '\r') || - input.LA(1) == ' ') - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - channel = HIDDEN; - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end WS - -// $ANTLR start COMMENT - -public final void mCOMMENT() throws RecognitionException{ - try - { - int _type = COMMENT; - // /Users/rich/dev/clojure/src/jvm/Reader.g:365:9: ( '#|' ( options {greedy=false; } : . )* '|#' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:365:9: '#|' ( options {greedy=false; } : . )* '|#' - { - match("#|"); - - // /Users/rich/dev/clojure/src/jvm/Reader.g:365:14: ( options {greedy=false; } : . )* - loop26: - do - { - int alt26 = 2; - int LA26_0 = input.LA(1); - - if((LA26_0 == '|')) - { - int LA26_1 = input.LA(2); - - if((LA26_1 == '#')) - { - alt26 = 2; - } - else if(((LA26_1 >= '\u0000' && LA26_1 <= '\"') || (LA26_1 >= '$' && LA26_1 <= '\uFFFE'))) - { - alt26 = 1; - } - - - } - else if(((LA26_0 >= '\u0000' && LA26_0 <= '{') || (LA26_0 >= '}' && LA26_0 <= '\uFFFE'))) - { - alt26 = 1; - } - - - switch(alt26) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:365:42: . - { - matchAny(); - - } - break; - - default: - break loop26; - } - } while(true); - - match("|#"); - - channel = HIDDEN; - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end COMMENT - -// $ANTLR start LINE_COMMENT - -public final void mLINE_COMMENT() throws RecognitionException{ - try - { - int _type = LINE_COMMENT; - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:7: ( ';' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:7: ';' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' - { - match(';'); - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:11: (~ ( '\\n' | '\\r' ) )* - loop27: - do - { - int alt27 = 2; - int LA27_0 = input.LA(1); - - if(((LA27_0 >= '\u0000' && LA27_0 <= '\t') || (LA27_0 >= '\u000B' && LA27_0 <= '\f') || - (LA27_0 >= '\u000E' && LA27_0 <= '\uFFFE'))) - { - alt27 = 1; - } - - - switch(alt27) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:11: ~ ( '\\n' | '\\r' ) - { - if((input.LA(1) >= '\u0000' && input.LA(1) <= '\t') || - (input.LA(1) >= '\u000B' && input.LA(1) <= '\f') || - (input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFE')) - { - input.consume(); - - } - else - { - MismatchedSetException mse = - new MismatchedSetException(null, input); - recover(mse); - throw mse; - } - - - } - break; - - default: - break loop27; - } - } while(true); - - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:25: ( '\\r' )? - int alt28 = 2; - int LA28_0 = input.LA(1); - - if((LA28_0 == '\r')) - { - alt28 = 1; - } - switch(alt28) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:369:25: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - channel = HIDDEN; - - } - - this.type = _type; - } - finally - { - } -} -// $ANTLR end LINE_COMMENT - -public void mTokens() throws RecognitionException{ - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:10: ( T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | T38 | T39 | Comma | TrueToken | NullToken | DotDot | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | NSIdentifier | KeywordIdentifier | MethodIdentifier | WS | COMMENT | LINE_COMMENT ) - int alt29 = 28; - alt29 = dfa29.predict(input); - switch(alt29) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:10: T29 - { - mT29(); - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:14: T30 - { - mT30(); - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:18: T31 - { - mT31(); - - } - break; - case 4: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:22: T32 - { - mT32(); - - } - break; - case 5: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:26: T33 - { - mT33(); - - } - break; - case 6: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:30: T34 - { - mT34(); - - } - break; - case 7: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:34: T35 - { - mT35(); - - } - break; - case 8: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:38: T36 - { - mT36(); - - } - break; - case 9: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:42: T37 - { - mT37(); - - } - break; - case 10: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:46: T38 - { - mT38(); - - } - break; - case 11: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:50: T39 - { - mT39(); - - } - break; - case 12: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:54: Comma - { - mComma(); - - } - break; - case 13: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:60: TrueToken - { - mTrueToken(); - - } - break; - case 14: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:70: NullToken - { - mNullToken(); - - } - break; - case 15: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:80: DotDot - { - mDotDot(); - - } - break; - case 16: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:87: HexLiteral - { - mHexLiteral(); - - } - break; - case 17: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:98: DecimalLiteral - { - mDecimalLiteral(); - - } - break; - case 18: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:113: OctalLiteral - { - mOctalLiteral(); - - } - break; - case 19: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:126: FloatingPointLiteral - { - mFloatingPointLiteral(); - - } - break; - case 20: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:147: CharacterLiteral - { - mCharacterLiteral(); - - } - break; - case 21: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:164: StringLiteral - { - mStringLiteral(); - - } - break; - case 22: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:178: Identifier - { - mIdentifier(); - - } - break; - case 23: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:189: NSIdentifier - { - mNSIdentifier(); - - } - break; - case 24: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:202: KeywordIdentifier - { - mKeywordIdentifier(); - - } - break; - case 25: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:220: MethodIdentifier - { - mMethodIdentifier(); - - } - break; - case 26: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:237: WS - { - mWS(); - - } - break; - case 27: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:240: COMMENT - { - mCOMMENT(); - - } - break; - case 28: - // /Users/rich/dev/clojure/src/jvm/Reader.g:1:248: LINE_COMMENT - { - mLINE_COMMENT(); - - } - break; - - } - -} - - -protected DFA16 dfa16 = new DFA16(this); -protected DFA24 dfa24 = new DFA24(this); -protected DFA29 dfa29 = new DFA29(this); -static final String DFA16_eotS = - "\7\uffff\1\10\2\uffff"; -static final String DFA16_eofS = - "\12\uffff"; -static final String DFA16_minS = - "\2\56\1\uffff\1\53\2\uffff\2\60\2\uffff"; -static final String DFA16_maxS = - "\1\71\1\146\1\uffff\1\71\2\uffff\1\71\1\146\2\uffff"; -static final String DFA16_acceptS = - "\2\uffff\1\2\1\uffff\1\1\1\4\2\uffff\2\3"; -static final String DFA16_specialS = - "\12\uffff}>"; -static final String[] DFA16_transitionS = { - "\1\2\1\uffff\12\1", - "\1\4\1\uffff\12\1\12\uffff\1\5\1\3\1\5\35\uffff\1\5\1\3\1\5", - "", - "\1\6\1\uffff\1\6\2\uffff\12\7", - "", - "", - "\12\7", - "\12\7\12\uffff\1\11\1\uffff\1\11\35\uffff\1\11\1\uffff\1\11", - "", - "" -}; - -static final short[] DFA16_eot = DFA.unpackEncodedString(DFA16_eotS); -static final short[] DFA16_eof = DFA.unpackEncodedString(DFA16_eofS); -static final char[] DFA16_min = DFA.unpackEncodedStringToUnsignedChars(DFA16_minS); -static final char[] DFA16_max = DFA.unpackEncodedStringToUnsignedChars(DFA16_maxS); -static final short[] DFA16_accept = DFA.unpackEncodedString(DFA16_acceptS); -static final short[] DFA16_special = DFA.unpackEncodedString(DFA16_specialS); -static final short[][] DFA16_transition; - -static - { - int numStates = DFA16_transitionS.length; - DFA16_transition = new short[numStates][]; - for(int i = 0; i < numStates; i++) - { - DFA16_transition[i] = DFA.unpackEncodedString(DFA16_transitionS[i]); - } - } - -class DFA16 extends DFA{ - - public DFA16(BaseRecognizer recognizer){ - this.recognizer = recognizer; - this.decisionNumber = 16; - this.eot = DFA16_eot; - this.eof = DFA16_eof; - this.min = DFA16_min; - this.max = DFA16_max; - this.accept = DFA16_accept; - this.special = DFA16_special; - this.transition = DFA16_transition; - } - - public String getDescription(){ - return "259:1: FloatingPointLiteral : ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix );"; - } -} - -static final String DFA24_eotS = - "\2\uffff\1\3\1\uffff\1\3\1\uffff"; -static final String DFA24_eofS = - "\6\uffff"; -static final String DFA24_minS = - "\1\72\2\44\1\uffff\1\44\1\uffff"; -static final String DFA24_maxS = - "\1\72\2\ufaff\1\uffff\1\ufaff\1\uffff"; -static final String DFA24_acceptS = - "\3\uffff\1\2\1\uffff\1\1"; -static final String DFA24_specialS = - "\6\uffff}>"; -static final String[] DFA24_transitionS = { - "\1\1", - "\1\2\34\uffff\32\2\4\uffff\1\2\1\uffff\32\2\105\uffff\27\2\1" + - "\uffff\37\2\1\uffff\u1f08\2\u1040\uffff\u0150\2\u0170\uffff" + - "\u0080\2\u0080\uffff\u092e\2\u10d2\uffff\u5200\2\u5900\uffff" + - "\u0200\2", - "\1\4\10\uffff\1\4\1\uffff\1\5\12\4\7\uffff\32\4\4\uffff\1\4" + - "\1\uffff\32\4\105\uffff\27\4\1\uffff\37\4\1\uffff\u1f08\4\u1040" + - "\uffff\u0150\4\u0170\uffff\u0080\4\u0080\uffff\u092e\4\u10d2" + - "\uffff\u5200\4\u5900\uffff\u0200\4", - "", - "\1\4\10\uffff\1\4\1\uffff\1\5\12\4\7\uffff\32\4\4\uffff\1\4" + - "\1\uffff\32\4\105\uffff\27\4\1\uffff\37\4\1\uffff\u1f08\4\u1040" + - "\uffff\u0150\4\u0170\uffff\u0080\4\u0080\uffff\u092e\4\u10d2" + - "\uffff\u5200\4\u5900\uffff\u0200\4", - "" -}; - -static final short[] DFA24_eot = DFA.unpackEncodedString(DFA24_eotS); -static final short[] DFA24_eof = DFA.unpackEncodedString(DFA24_eofS); -static final char[] DFA24_min = DFA.unpackEncodedStringToUnsignedChars(DFA24_minS); -static final char[] DFA24_max = DFA.unpackEncodedStringToUnsignedChars(DFA24_maxS); -static final short[] DFA24_accept = DFA.unpackEncodedString(DFA24_acceptS); -static final short[] DFA24_special = DFA.unpackEncodedString(DFA24_specialS); -static final short[][] DFA24_transition; - -static - { - int numStates = DFA24_transitionS.length; - DFA24_transition = new short[numStates][]; - for(int i = 0; i < numStates; i++) - { - DFA24_transition[i] = DFA.unpackEncodedString(DFA24_transitionS[i]); - } - } - -class DFA24 extends DFA{ - - public DFA24(BaseRecognizer recognizer){ - this.recognizer = recognizer; - this.decisionNumber = 24; - this.eot = DFA24_eot; - this.eof = DFA24_eof; - this.min = DFA24_min; - this.max = DFA24_max; - this.accept = DFA24_accept; - this.special = DFA24_special; - this.transition = DFA24_transition; - } - - public String getDescription(){ - return "313:1: KeywordIdentifier : ( ':' Identifier '/' Identifier | ':' Identifier );"; - } -} - -static final String DFA29_eotS = - "\11\uffff\1\32\3\uffff\2\35\2\45\2\uffff\1\35\10\uffff\1\35\1\uffff" + - "\1\35\1\uffff\1\35\1\uffff\1\35\1\uffff\1\51\1\uffff\1\45\2\35\1" + - "\uffff\1\54\1\55\2\uffff"; -static final String DFA29_eofS = - "\56\uffff"; -static final String DFA29_minS = - "\1\11\7\uffff\1\136\1\56\3\uffff\2\44\2\56\2\uffff\1\44\10\uffff" + - "\1\44\1\uffff\1\44\1\uffff\1\44\1\uffff\1\44\1\uffff\1\56\1\uffff" + - "\1\56\2\44\1\uffff\2\44\2\uffff"; -static final String DFA29_maxS = - "\1\ufaff\7\uffff\1\174\1\71\3\uffff\2\ufaff\1\170\1\146\2\uffff" + - "\1\ufaff\10\uffff\1\ufaff\1\uffff\1\ufaff\1\uffff\1\ufaff\1\uffff" + - "\1\ufaff\1\uffff\1\146\1\uffff\1\146\2\ufaff\1\uffff\2\ufaff\2\uffff"; -static final String DFA29_acceptS = - "\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\2\uffff\1\12\1\13\1\14\4\uffff" + - "\1\24\1\25\1\uffff\1\30\1\32\1\34\1\10\1\33\1\17\1\11\1\23\1\uffff" + - "\1\26\1\uffff\1\31\1\uffff\1\27\1\uffff\1\20\1\uffff\1\21\3\uffff" + - "\1\22\2\uffff\1\15\1\16"; -static final String DFA29_specialS = - "\56\uffff}>"; -static final String[] DFA29_transitionS = { - "\2\25\1\uffff\2\25\22\uffff\1\25\1\uffff\1\22\1\10\1\23\2\uffff" + - "\1\12\1\1\1\2\2\uffff\1\14\1\uffff\1\11\1\7\1\17\11\20\1\24" + - "\1\26\5\uffff\32\23\1\3\1\21\1\4\1\13\1\23\1\uffff\15\23\1\16" + - "\5\23\1\15\6\23\1\5\1\uffff\1\6\102\uffff\27\23\1\uffff\37\23" + - "\1\uffff\u1f08\23\u1040\uffff\u0150\23\u0170\uffff\u0080\23" + - "\u0080\uffff\u092e\23\u10d2\uffff\u5200\23\u5900\uffff\u0200" + - "\23", - "", - "", - "", - "", - "", - "", - "", - "\1\27\35\uffff\1\30", - "\1\31\1\uffff\12\33", - "", - "", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\21\36\1\34\10\36\105\uffff\27\36\1" + - "\uffff\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff" + - "\u0080\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff" + - "\u0200\36", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\24\36\1\42\5\36\105\uffff\27\36\1\uffff" + - "\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080" + - "\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "\1\33\1\uffff\10\44\2\33\12\uffff\3\33\21\uffff\1\43\13\uffff" + - "\3\33\21\uffff\1\43", - "\1\33\1\uffff\12\46\12\uffff\3\33\35\uffff\3\33", - "", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\32\36\105\uffff\27\36\1\uffff\37\36" + - "\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080\36" + - "\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\24\36\1\47\5\36\105\uffff\27\36\1\uffff" + - "\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080" + - "\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\32\36\105\uffff\27\36\1\uffff\37\36" + - "\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080\36" + - "\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "", - "\1\40\10\uffff\1\40\1\uffff\1\41\12\40\7\uffff\32\40\4\uffff" + - "\1\40\1\uffff\32\40\105\uffff\27\40\1\uffff\37\40\1\uffff\u1f08" + - "\40\u1040\uffff\u0150\40\u0170\uffff\u0080\40\u0080\uffff\u092e" + - "\40\u10d2\uffff\u5200\40\u5900\uffff\u0200\40", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\13\36\1\50\16\36\105\uffff\27\36\1" + - "\uffff\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff" + - "\u0080\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff" + - "\u0200\36", - "", - "\1\33\1\uffff\10\44\2\33\12\uffff\3\33\35\uffff\3\33", - "", - "\1\33\1\uffff\12\46\12\uffff\3\33\35\uffff\3\33", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\4\36\1\52\25\36\105\uffff\27\36\1\uffff" + - "\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080" + - "\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\13\36\1\53\16\36\105\uffff\27\36\1" + - "\uffff\37\36\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff" + - "\u0080\36\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff" + - "\u0200\36", - "", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\32\36\105\uffff\27\36\1\uffff\37\36" + - "\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080\36" + - "\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "\1\36\3\uffff\1\37\4\uffff\1\40\1\uffff\1\41\12\36\7\uffff\32" + - "\36\4\uffff\1\36\1\uffff\32\36\105\uffff\27\36\1\uffff\37\36" + - "\1\uffff\u1f08\36\u1040\uffff\u0150\36\u0170\uffff\u0080\36" + - "\u0080\uffff\u092e\36\u10d2\uffff\u5200\36\u5900\uffff\u0200" + - "\36", - "", - "" -}; - -static final short[] DFA29_eot = DFA.unpackEncodedString(DFA29_eotS); -static final short[] DFA29_eof = DFA.unpackEncodedString(DFA29_eofS); -static final char[] DFA29_min = DFA.unpackEncodedStringToUnsignedChars(DFA29_minS); -static final char[] DFA29_max = DFA.unpackEncodedStringToUnsignedChars(DFA29_maxS); -static final short[] DFA29_accept = DFA.unpackEncodedString(DFA29_acceptS); -static final short[] DFA29_special = DFA.unpackEncodedString(DFA29_specialS); -static final short[][] DFA29_transition; - -static - { - int numStates = DFA29_transitionS.length; - DFA29_transition = new short[numStates][]; - for(int i = 0; i < numStates; i++) - { - DFA29_transition[i] = DFA.unpackEncodedString(DFA29_transitionS[i]); - } - } - -class DFA29 extends DFA{ - - public DFA29(BaseRecognizer recognizer){ - this.recognizer = recognizer; - this.decisionNumber = 29; - this.eot = DFA29_eot; - this.eof = DFA29_eof; - this.min = DFA29_min; - this.max = DFA29_max; - this.accept = DFA29_accept; - this.special = DFA29_special; - this.transition = DFA29_transition; - } - - public String getDescription(){ - return "1:1: Tokens : ( T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | T38 | T39 | Comma | TrueToken | NullToken | DotDot | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | Identifier | NSIdentifier | KeywordIdentifier | MethodIdentifier | WS | COMMENT | LINE_COMMENT );"; - } -} - - -}
\ No newline at end of file diff --git a/src/jvm/clojure/lang/ReaderParser.java b/src/jvm/clojure/lang/ReaderParser.java deleted file mode 100644 index 8f384451..00000000 --- a/src/jvm/clojure/lang/ReaderParser.java +++ /dev/null @@ -1,2675 +0,0 @@ -// $ANTLR 3.0 /Users/rich/dev/clojure/src/jvm/Reader.g 2007-08-02 16:47:44 - -package clojure.lang; - -import java.math.BigInteger; -import java.io.Writer; -import java.io.PrintWriter; - - -import org.antlr.runtime.*; - -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; - -/** - * Copyright (c) Rich Hickey. All rights reserved. - * The use and distribution terms for this software are covered by the - * Common Public License 1.0 (http://opensource.org/licenses/cpl.php) - * which can be found in the file CPL.TXT at the root of this distribution. - * By using this software in any fashion, you are agreeing to be bound by - * the terms of this license. - * You must not remove this notice, or any other, from this software. - */ -public class ReaderParser extends Parser{ -public static final String[] tokenNames = new String[]{ - "<invalid>", "<EOR>", "<DOWN>", "<UP>", "Identifier", "NSIdentifier", "DotDot", "KeywordIdentifier", - "FloatingPointLiteral", "CharacterLiteral", "StringLiteral", "TrueToken", "NullToken", "DecimalLiteral", - "HexLiteral", "OctalLiteral", "MethodIdentifier", "Comma", "HexDigit", "Exponent", "FloatTypeSuffix", - "EscapeSequence", "UnicodeEscape", "OctalEscape", "Letter", "JavaIDDigit", "WS", "COMMENT", "LINE_COMMENT", - "'('", "')'", "'['", "']'", "'{'", "'}'", "'/'", "'#^'", "'.'", "'\\''", "'^'" -}; -public static final int TrueToken = 11; -public static final int Exponent = 19; -public static final int OctalLiteral = 15; -public static final int Identifier = 4; -public static final int HexDigit = 18; -public static final int WS = 26; -public static final int CharacterLiteral = 9; -public static final int MethodIdentifier = 16; -public static final int NSIdentifier = 5; -public static final int COMMENT = 27; -public static final int KeywordIdentifier = 7; -public static final int StringLiteral = 10; -public static final int LINE_COMMENT = 28; -public static final int DotDot = 6; -public static final int JavaIDDigit = 25; -public static final int Letter = 24; -public static final int UnicodeEscape = 22; -public static final int HexLiteral = 14; -public static final int Comma = 17; -public static final int EscapeSequence = 21; -public static final int EOF = -1; -public static final int NullToken = 12; -public static final int DecimalLiteral = 13; -public static final int OctalEscape = 23; -public static final int FloatingPointLiteral = 8; -public static final int FloatTypeSuffix = 20; - -public ReaderParser(TokenStream input){ - super(input); - ruleMemo = new HashMap[49 + 1]; -} - - -public String[] getTokenNames(){ - return tokenNames; -} - -public String getGrammarFileName(){ - return "/Users/rich/dev/clojure/src/jvm/Reader.g"; -} - -//add these lines to expressions, dotExpression, args -// in the e=expression(); case -//after: -// if (failed) return val; - -/* - //WARNING- HAND MODIFIED! - if(es == null) es = new ArrayList(); - es.add(e); - // END HAND MODIFIED - */ - -//add this to mapexpr: -/* - //WARNING- HAND MODIFIED! - val = val.assoc(k, v); - // END HAND MODIFIED - */ - -final static Symbol DOTDOT = Symbol.create(null, ".."); -final static Symbol QUOTE = Symbol.create(null, "quote"); -final static Symbol META = Symbol.create(null, "meta"); - -public static void main(String[] args) throws Exception{ - Writer w = new PrintWriter(System.out); - // Create an input character stream from standard in - CharStream input = new ANTLRFileStream(args[0]); - // Create an ExprLexer that feeds from that stream - ReaderLexer lexer = new ReaderLexer(input); - // Create a stream of tokens fed by the lexer - CommonTokenStream tokens = new CommonTokenStream(lexer); - // Create a parser that feeds off the token stream - ReaderParser parser = new ReaderParser(tokens); - // Begin parsing at rule prog, get return value structure - try - { - if(lexer.rex != null) - throw lexer.rex; - for(int i = 0; i < 20; i++) - { - Object e = parser.expression(); - RT.print(e, w); - w.write('\n'); - w.flush(); - } - } - catch(RecognitionException rex) - { - System.err.printf("Error parsing at line: %d, col: %d", rex.line, rex.charPositionInLine); - } -} - -protected void mismatch(IntStream input, int ttype, BitSet follow) - throws RecognitionException{ - throw new MismatchedTokenException(ttype, input); -} - -public void recoverFromMismatchedSet(IntStream input, - RecognitionException e, - BitSet follow) - throws RecognitionException{ - throw e; -} - - -// $ANTLR start expression -// /Users/rich/dev/clojure/src/jvm/Reader.g:121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression ); -public final Object expression() throws RecognitionException{ - Object val = null; - int expression_StartIndex = input.index(); - Object d = null; - - Object e = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 1)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:122:3: (d= dotExpression | e= otherThanDotExpression ) - int alt1 = 2; - switch(input.LA(1)) - { - case HexLiteral: - { - int LA1_1 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 1, input); - - throw nvae; - } - } - break; - case OctalLiteral: - { - int LA1_2 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 2, input); - - throw nvae; - } - } - break; - case DecimalLiteral: - { - int LA1_3 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 3, input); - - throw nvae; - } - } - break; - case FloatingPointLiteral: - { - int LA1_4 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 4, input); - - throw nvae; - } - } - break; - case CharacterLiteral: - { - int LA1_5 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 5, input); - - throw nvae; - } - } - break; - case StringLiteral: - { - int LA1_6 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 6, input); - - throw nvae; - } - } - break; - case TrueToken: - { - int LA1_7 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 7, input); - - throw nvae; - } - } - break; - case NullToken: - { - int LA1_8 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 8, input); - - throw nvae; - } - } - break; - case Identifier: - { - int LA1_9 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 9, input); - - throw nvae; - } - } - break; - case NSIdentifier: - { - int LA1_10 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 10, input); - - throw nvae; - } - } - break; - case DotDot: - { - int LA1_11 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 11, input); - - throw nvae; - } - } - break; - case KeywordIdentifier: - { - int LA1_12 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 12, input); - - throw nvae; - } - } - break; - case 29: - { - int LA1_13 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 13, input); - - throw nvae; - } - } - break; - case 31: - { - int LA1_14 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 14, input); - - throw nvae; - } - } - break; - case 33: - { - int LA1_15 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 15, input); - - throw nvae; - } - } - break; - case 36: - { - int LA1_16 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 16, input); - - throw nvae; - } - } - break; - case 38: - { - int LA1_17 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 17, input); - - throw nvae; - } - } - break; - case 39: - { - int LA1_18 = input.LA(2); - - if((synpred1())) - { - alt1 = 1; - } - else if((true)) - { - alt1 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 18, input); - - throw nvae; - } - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "121:1: expression returns [Object val] : (d= dotExpression | e= otherThanDotExpression );", - 1, 0, input); - - throw nvae; - } - - switch(alt1) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:122:3: d= dotExpression - { - pushFollow(FOLLOW_dotExpression_in_expression72); - d = dotExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = d; - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:123:4: e= otherThanDotExpression - { - pushFollow(FOLLOW_otherThanDotExpression_in_expression83); - e = otherThanDotExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = e; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 1, expression_StartIndex); - } - } - return val; -} -// $ANTLR end expression - -// $ANTLR start otherThanDotExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:126:1: fragment otherThanDotExpression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | q= quotedExpression | ct= caretExpression ); - -public final Object otherThanDotExpression() throws RecognitionException{ - Object val = null; - int otherThanDotExpression_StartIndex = input.index(); - Object lt = null; - - Symbol s = null; - - Keyword k = null; - - ISeq le = null; - - IPersistentArray ve = null; - - IPersistentMap me = null; - - Obj mx = null; - - Object q = null; - - Object ct = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 2)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:128:4: (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | q= quotedExpression | ct= caretExpression ) - int alt2 = 9; - switch(input.LA(1)) - { - case FloatingPointLiteral: - case CharacterLiteral: - case StringLiteral: - case TrueToken: - case NullToken: - case DecimalLiteral: - case HexLiteral: - case OctalLiteral: - { - alt2 = 1; - } - break; - case Identifier: - case NSIdentifier: - case DotDot: - { - alt2 = 2; - } - break; - case KeywordIdentifier: - { - alt2 = 3; - } - break; - case 29: - { - alt2 = 4; - } - break; - case 31: - { - alt2 = 5; - } - break; - case 33: - { - alt2 = 6; - } - break; - case 36: - { - alt2 = 7; - } - break; - case 38: - { - alt2 = 8; - } - break; - case 39: - { - alt2 = 9; - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "126:1: fragment otherThanDotExpression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | q= quotedExpression | ct= caretExpression );", - 2, 0, input); - - throw nvae; - } - - switch(alt2) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:128:4: lt= literal - { - pushFollow(FOLLOW_literal_in_otherThanDotExpression106); - lt = literal(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = lt; - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:129:3: s= symbol - { - pushFollow(FOLLOW_symbol_in_otherThanDotExpression116); - s = symbol(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = s; - } - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:130:3: k= keyword - { - pushFollow(FOLLOW_keyword_in_otherThanDotExpression126); - k = keyword(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = k; - } - - } - break; - case 4: - // /Users/rich/dev/clojure/src/jvm/Reader.g:131:3: le= listExpression - { - pushFollow(FOLLOW_listExpression_in_otherThanDotExpression136); - le = listExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = le; - } - - } - break; - case 5: - // /Users/rich/dev/clojure/src/jvm/Reader.g:132:3: ve= vectorExpression - { - pushFollow(FOLLOW_vectorExpression_in_otherThanDotExpression146); - ve = vectorExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = ve; - } - - } - break; - case 6: - // /Users/rich/dev/clojure/src/jvm/Reader.g:133:3: me= mapExpression - { - pushFollow(FOLLOW_mapExpression_in_otherThanDotExpression156); - me = mapExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = me; - } - - } - break; - case 7: - // /Users/rich/dev/clojure/src/jvm/Reader.g:134:3: mx= metaExpression - { - pushFollow(FOLLOW_metaExpression_in_otherThanDotExpression166); - mx = metaExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = mx; - } - - } - break; - case 8: - // /Users/rich/dev/clojure/src/jvm/Reader.g:135:3: q= quotedExpression - { - pushFollow(FOLLOW_quotedExpression_in_otherThanDotExpression176); - q = quotedExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = q; - } - - } - break; - case 9: - // /Users/rich/dev/clojure/src/jvm/Reader.g:136:3: ct= caretExpression - { - pushFollow(FOLLOW_caretExpression_in_otherThanDotExpression186); - ct = caretExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = ct; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 2, otherThanDotExpression_StartIndex); - } - } - return val; -} -// $ANTLR end otherThanDotExpression - -// $ANTLR start listExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:139:1: listExpression returns [ISeq val] : '(' es= expressions ')' ; - -public final ISeq listExpression() throws RecognitionException{ - ISeq val = null; - int listExpression_StartIndex = input.index(); - List es = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 3)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:140:4: ( '(' es= expressions ')' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:140:4: '(' es= expressions ')' - { - match(input, 29, FOLLOW_29_in_listExpression203); - if(failed) return val; - pushFollow(FOLLOW_expressions_in_listExpression210); - es = expressions(); - _fsp--; - if(failed) return val; - match(input, 30, FOLLOW_30_in_listExpression212); - if(failed) return val; - if(backtracking == 0) - { - val = es != null ? RT.seq(es) : PersistentList.EMPTY; - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 3, listExpression_StartIndex); - } - } - return val; -} -// $ANTLR end listExpression - -// $ANTLR start expressions -// /Users/rich/dev/clojure/src/jvm/Reader.g:143:10: fragment expressions returns [List es] : (e= expression )* ; - -public final List expressions() throws RecognitionException{ - List es = null; - int expressions_StartIndex = input.index(); - Object e = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 4)) - { - return es; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:144:4: ( (e= expression )* ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:144:4: (e= expression )* - { - // /Users/rich/dev/clojure/src/jvm/Reader.g:144:6: (e= expression )* - loop3: - do - { - int alt3 = 2; - int LA3_0 = input.LA(1); - - if(((LA3_0 >= Identifier && LA3_0 <= OctalLiteral) || LA3_0 == 29 || LA3_0 == 31 || LA3_0 == 33 || - LA3_0 == 36 || (LA3_0 >= 38 && LA3_0 <= 39))) - { - alt3 = 1; - } - - - switch(alt3) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: e= expression - { - pushFollow(FOLLOW_expression_in_expressions234); - e = expression(); - _fsp--; - if(failed) return es; - //WARNING- HAND MODIFIED! - if(es == null) es = new ArrayList(); - es.add(e); - // END HAND MODIFIED - - } - break; - - default: - break loop3; - } - } while(true); - - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 4, expressions_StartIndex); - } - } - return es; -} -// $ANTLR end expressions - -// $ANTLR start vectorExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:147:1: vectorExpression returns [IPersistentArray val] : '[' es= expressions ']' ; - -public final IPersistentArray vectorExpression() throws RecognitionException{ - IPersistentArray val = null; - int vectorExpression_StartIndex = input.index(); - List es = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 5)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:148:4: ( '[' es= expressions ']' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:148:4: '[' es= expressions ']' - { - match(input, 31, FOLLOW_31_in_vectorExpression251); - if(failed) return val; - pushFollow(FOLLOW_expressions_in_vectorExpression257); - es = expressions(); - _fsp--; - if(failed) return val; - match(input, 32, FOLLOW_32_in_vectorExpression259); - if(failed) return val; - if(backtracking == 0) - { - val = es != null ? RT.tuple(es.toArray()) : PersistentVector.EMPTY; - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 5, vectorExpression_StartIndex); - } - } - return val; -} -// $ANTLR end vectorExpression - -// $ANTLR start mapExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:151:1: mapExpression returns [IPersistentMap val] : '{' (k= expression v= expression )* '}' ; - -public final IPersistentMap mapExpression() throws RecognitionException{ - IPersistentMap val = null; - int mapExpression_StartIndex = input.index(); - Object k = null; - - Object v = null; - - - val = PersistentHashMap.EMPTY; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 6)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:155:4: ( '{' (k= expression v= expression )* '}' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:155:4: '{' (k= expression v= expression )* '}' - { - match(input, 33, FOLLOW_33_in_mapExpression279); - if(failed) return val; - // /Users/rich/dev/clojure/src/jvm/Reader.g:155:8: (k= expression v= expression )* - loop4: - do - { - int alt4 = 2; - int LA4_0 = input.LA(1); - - if(((LA4_0 >= Identifier && LA4_0 <= OctalLiteral) || LA4_0 == 29 || LA4_0 == 31 || LA4_0 == 33 || - LA4_0 == 36 || (LA4_0 >= 38 && LA4_0 <= 39))) - { - alt4 = 1; - } - - - switch(alt4) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:155:9: k= expression v= expression - { - pushFollow(FOLLOW_expression_in_mapExpression284); - k = expression(); - _fsp--; - if(failed) return val; - pushFollow(FOLLOW_expression_in_mapExpression288); - v = expression(); - _fsp--; - if(failed) return val; - //WARNING- HAND MODIFIED! - val = val.assoc(k, v); - // END HAND MODIFIED - - } - break; - - default: - break loop4; - } - } while(true); - - match(input, 34, FOLLOW_34_in_mapExpression292); - if(failed) return val; - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 6, mapExpression_StartIndex); - } - } - return val; -} -// $ANTLR end mapExpression - -// $ANTLR start symbol -// /Users/rich/dev/clojure/src/jvm/Reader.g:158:1: symbol returns [Symbol val] : (n= Identifier | n= NSIdentifier | dd= DotDot ); - -public final Symbol symbol() throws RecognitionException{ - Symbol val = null; - int symbol_StartIndex = input.index(); - Token n = null; - Token dd = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 7)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:159:3: (n= Identifier | n= NSIdentifier | dd= DotDot ) - int alt5 = 3; - switch(input.LA(1)) - { - case Identifier: - { - alt5 = 1; - } - break; - case NSIdentifier: - { - alt5 = 2; - } - break; - case DotDot: - { - alt5 = 3; - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "158:1: symbol returns [Symbol val] : (n= Identifier | n= NSIdentifier | dd= DotDot );", - 5, 0, input); - - throw nvae; - } - - switch(alt5) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:159:3: n= Identifier - { - n = (Token) input.LT(1); - match(input, Identifier, FOLLOW_Identifier_in_symbol309); - if(failed) return val; - if(backtracking == 0) - { - val = Symbol.intern(n.getText()); - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:160:3: n= NSIdentifier - { - n = (Token) input.LT(1); - match(input, NSIdentifier, FOLLOW_NSIdentifier_in_symbol319); - if(failed) return val; - if(backtracking == 0) - { - val = Symbol.intern(n.getText()); - } - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:161:3: dd= DotDot - { - dd = (Token) input.LT(1); - match(input, DotDot, FOLLOW_DotDot_in_symbol329); - if(failed) return val; - if(backtracking == 0) - { - val = DOTDOT; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 7, symbol_StartIndex); - } - } - return val; -} -// $ANTLR end symbol - -// $ANTLR start keyword -// /Users/rich/dev/clojure/src/jvm/Reader.g:164:1: keyword returns [Keyword val] : k= KeywordIdentifier ; - -public final Keyword keyword() throws RecognitionException{ - Keyword val = null; - int keyword_StartIndex = input.index(); - Token k = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 8)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:165:3: (k= KeywordIdentifier ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:165:3: k= KeywordIdentifier - { - k = (Token) input.LT(1); - match(input, KeywordIdentifier, FOLLOW_KeywordIdentifier_in_keyword349); - if(failed) return val; - if(backtracking == 0) - { - val = new Keyword(Symbol.intern(k.getText().substring(1))); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 8, keyword_StartIndex); - } - } - return val; -} -// $ANTLR end keyword - -// $ANTLR start literal -// /Users/rich/dev/clojure/src/jvm/Reader.g:169:1: literal returns [Object val] : (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral ); - -public final Object literal() throws RecognitionException{ - Object val = null; - int literal_StartIndex = input.index(); - Token fp = null; - Token c = null; - Token s = null; - Num i = null; - - Num r = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 9)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:170:6: (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral ) - int alt6 = 7; - switch(input.LA(1)) - { - case HexLiteral: - case OctalLiteral: - { - alt6 = 1; - } - break; - case DecimalLiteral: - { - int LA6_2 = input.LA(2); - - if((LA6_2 == 35)) - { - alt6 = 7; - } - else if((LA6_2 == EOF || (LA6_2 >= Identifier && LA6_2 <= OctalLiteral) || LA6_2 == Comma || - (LA6_2 >= 29 && LA6_2 <= 34) || (LA6_2 >= 36 && LA6_2 <= 39))) - { - alt6 = 1; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "169:1: literal returns [Object val] : (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral );", - 6, 2, input); - - throw nvae; - } - } - break; - case FloatingPointLiteral: - { - alt6 = 2; - } - break; - case CharacterLiteral: - { - alt6 = 3; - } - break; - case StringLiteral: - { - alt6 = 4; - } - break; - case TrueToken: - { - alt6 = 5; - } - break; - case NullToken: - { - alt6 = 6; - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "169:1: literal returns [Object val] : (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral );", - 6, 0, input); - - throw nvae; - } - - switch(alt6) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:170:6: i= integerLiteral - { - pushFollow(FOLLOW_integerLiteral_in_literal376); - i = integerLiteral(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = i; - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:171:6: fp= FloatingPointLiteral - { - fp = (Token) input.LT(1); - match(input, FloatingPointLiteral, FOLLOW_FloatingPointLiteral_in_literal389); - if(failed) return val; - if(backtracking == 0) - { - val = Num.from(Double.valueOf(fp.getText())); - } - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:172:6: c= CharacterLiteral - { - c = (Token) input.LT(1); - match(input, CharacterLiteral, FOLLOW_CharacterLiteral_in_literal402); - if(failed) return val; - if(backtracking == 0) - { - val = c.getText().charAt(0); - } - - } - break; - case 4: - // /Users/rich/dev/clojure/src/jvm/Reader.g:173:6: s= StringLiteral - { - s = (Token) input.LT(1); - match(input, StringLiteral, FOLLOW_StringLiteral_in_literal415); - if(failed) return val; - if(backtracking == 0) - { - val = s.getText().substring(1, s.getText().length() - 1); - } - - } - break; - case 5: - // /Users/rich/dev/clojure/src/jvm/Reader.g:174:6: TrueToken - { - match(input, TrueToken, FOLLOW_TrueToken_in_literal424); - if(failed) return val; - if(backtracking == 0) - { - val = Boolean.TRUE; - } - - } - break; - case 6: - // /Users/rich/dev/clojure/src/jvm/Reader.g:175:6: NullToken - { - match(input, NullToken, FOLLOW_NullToken_in_literal433); - if(failed) return val; - if(backtracking == 0) - { - val = null; - } - - } - break; - case 7: - // /Users/rich/dev/clojure/src/jvm/Reader.g:176:6: r= ratioLiteral - { - pushFollow(FOLLOW_ratioLiteral_in_literal446); - r = ratioLiteral(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = r; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 9, literal_StartIndex); - } - } - return val; -} -// $ANTLR end literal - -// $ANTLR start ratioLiteral -// /Users/rich/dev/clojure/src/jvm/Reader.g:179:1: ratioLiteral returns [Num val] : n= DecimalLiteral '/' d= DecimalLiteral ; - -public final Num ratioLiteral() throws RecognitionException{ - Num val = null; - int ratioLiteral_StartIndex = input.index(); - Token n = null; - Token d = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 10)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:180:4: (n= DecimalLiteral '/' d= DecimalLiteral ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:180:4: n= DecimalLiteral '/' d= DecimalLiteral - { - n = (Token) input.LT(1); - match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_ratioLiteral469); - if(failed) return val; - match(input, 35, FOLLOW_35_in_ratioLiteral471); - if(failed) return val; - d = (Token) input.LT(1); - match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_ratioLiteral477); - if(failed) return val; - if(backtracking == 0) - { - val = Num.divide(new BigInteger(n.getText()), new BigInteger(d.getText())); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 10, ratioLiteral_StartIndex); - } - } - return val; -} -// $ANTLR end ratioLiteral - -// $ANTLR start integerLiteral -// /Users/rich/dev/clojure/src/jvm/Reader.g:183:1: integerLiteral returns [Num val] : (hn= HexLiteral | on= OctalLiteral | nn= DecimalLiteral ); - -public final Num integerLiteral() throws RecognitionException{ - Num val = null; - int integerLiteral_StartIndex = input.index(); - Token hn = null; - Token on = null; - Token nn = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 11)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:184:9: (hn= HexLiteral | on= OctalLiteral | nn= DecimalLiteral ) - int alt7 = 3; - switch(input.LA(1)) - { - case HexLiteral: - { - alt7 = 1; - } - break; - case OctalLiteral: - { - alt7 = 2; - } - break; - case DecimalLiteral: - { - alt7 = 3; - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "183:1: integerLiteral returns [Num val] : (hn= HexLiteral | on= OctalLiteral | nn= DecimalLiteral );", - 7, 0, input); - - throw nvae; - } - - switch(alt7) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:184:9: hn= HexLiteral - { - hn = (Token) input.LT(1); - match(input, HexLiteral, FOLLOW_HexLiteral_in_integerLiteral503); - if(failed) return val; - if(backtracking == 0) - { - val = Num.from(new BigInteger(hn.getText().substring(2), 16)); - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:185:9: on= OctalLiteral - { - on = (Token) input.LT(1); - match(input, OctalLiteral, FOLLOW_OctalLiteral_in_integerLiteral522); - if(failed) return val; - if(backtracking == 0) - { - val = Num.from(new BigInteger(on.getText().substring(1), 8)); - } - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:186:9: nn= DecimalLiteral - { - nn = (Token) input.LT(1); - match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_integerLiteral540); - if(failed) return val; - if(backtracking == 0) - { - val = Num.from(new BigInteger(nn.getText())); - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 11, integerLiteral_StartIndex); - } - } - return val; -} -// $ANTLR end integerLiteral - -// $ANTLR start metaTag -// /Users/rich/dev/clojure/src/jvm/Reader.g:191:1: fragment metaTag returns [IPersistentMap val] : ( '#^' s= symbol | '#^' m= mapExpression ); - -public final IPersistentMap metaTag() throws RecognitionException{ - IPersistentMap val = null; - int metaTag_StartIndex = input.index(); - Symbol s = null; - - IPersistentMap m = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 12)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:193:3: ( '#^' s= symbol | '#^' m= mapExpression ) - int alt8 = 2; - int LA8_0 = input.LA(1); - - if((LA8_0 == 36)) - { - int LA8_1 = input.LA(2); - - if(((LA8_1 >= Identifier && LA8_1 <= DotDot))) - { - alt8 = 1; - } - else if((LA8_1 == 33)) - { - alt8 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "191:1: fragment metaTag returns [IPersistentMap val] : ( '#^' s= symbol | '#^' m= mapExpression );", - 8, 1, input); - - throw nvae; - } - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "191:1: fragment metaTag returns [IPersistentMap val] : ( '#^' s= symbol | '#^' m= mapExpression );", - 8, 0, input); - - throw nvae; - } - switch(alt8) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:193:3: '#^' s= symbol - { - match(input, 36, FOLLOW_36_in_metaTag563); - if(failed) return val; - pushFollow(FOLLOW_symbol_in_metaTag569); - s = symbol(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = RT.map(RT.TAG_KEY, s); - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:194:3: '#^' m= mapExpression - { - match(input, 36, FOLLOW_36_in_metaTag575); - if(failed) return val; - pushFollow(FOLLOW_mapExpression_in_metaTag581); - m = mapExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = m; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 12, metaTag_StartIndex); - } - } - return val; -} -// $ANTLR end metaTag - -// $ANTLR start objExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:197:1: fragment objExpression returns [Obj val] : (s= symbol | le= listExpression | me= mapExpression | ve= vectorExpression ); - -public final Obj objExpression() throws RecognitionException{ - Obj val = null; - int objExpression_StartIndex = input.index(); - Symbol s = null; - - ISeq le = null; - - IPersistentMap me = null; - - IPersistentArray ve = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 13)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:199:3: (s= symbol | le= listExpression | me= mapExpression | ve= vectorExpression ) - int alt9 = 4; - switch(input.LA(1)) - { - case Identifier: - case NSIdentifier: - case DotDot: - { - alt9 = 1; - } - break; - case 29: - { - alt9 = 2; - } - break; - case 33: - { - alt9 = 3; - } - break; - case 31: - { - alt9 = 4; - } - break; - default: - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "197:1: fragment objExpression returns [Obj val] : (s= symbol | le= listExpression | me= mapExpression | ve= vectorExpression );", - 9, 0, input); - - throw nvae; - } - - switch(alt9) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:199:3: s= symbol - { - pushFollow(FOLLOW_symbol_in_objExpression604); - s = symbol(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = s; - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:200:3: le= listExpression - { - pushFollow(FOLLOW_listExpression_in_objExpression614); - le = listExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = (Obj) le; - } - - } - break; - case 3: - // /Users/rich/dev/clojure/src/jvm/Reader.g:201:3: me= mapExpression - { - pushFollow(FOLLOW_mapExpression_in_objExpression624); - me = mapExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = (Obj) me; - } - - } - break; - case 4: - // /Users/rich/dev/clojure/src/jvm/Reader.g:202:3: ve= vectorExpression - { - pushFollow(FOLLOW_vectorExpression_in_objExpression634); - ve = vectorExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = (Obj) ve; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 13, objExpression_StartIndex); - } - } - return val; -} -// $ANTLR end objExpression - -// $ANTLR start metaExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:205:1: metaExpression returns [Obj val] : m= metaTag e= objExpression ; - -public final Obj metaExpression() throws RecognitionException{ - Obj val = null; - int metaExpression_StartIndex = input.index(); - IPersistentMap m = null; - - Obj e = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 14)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:206:3: (m= metaTag e= objExpression ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:206:3: m= metaTag e= objExpression - { - pushFollow(FOLLOW_metaTag_in_metaExpression656); - m = metaTag(); - _fsp--; - if(failed) return val; - pushFollow(FOLLOW_objExpression_in_metaExpression662); - e = objExpression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = e.withMeta(m); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 14, metaExpression_StartIndex); - } - } - return val; -} -// $ANTLR end metaExpression - -// $ANTLR start member -// /Users/rich/dev/clojure/src/jvm/Reader.g:209:1: fragment member returns [Object val] : ( '.' i= Identifier | '.' m= method ); - -public final Object member() throws RecognitionException{ - Object val = null; - int member_StartIndex = input.index(); - Token i = null; - Object m = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 15)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:211:4: ( '.' i= Identifier | '.' m= method ) - int alt10 = 2; - int LA10_0 = input.LA(1); - - if((LA10_0 == 37)) - { - int LA10_1 = input.LA(2); - - if((LA10_1 == Identifier)) - { - alt10 = 1; - } - else if((LA10_1 == MethodIdentifier)) - { - alt10 = 2; - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "209:1: fragment member returns [Object val] : ( '.' i= Identifier | '.' m= method );", - 10, 1, input); - - throw nvae; - } - } - else - { - if(backtracking > 0) - { - failed = true; - return val; - } - NoViableAltException nvae = - new NoViableAltException( - "209:1: fragment member returns [Object val] : ( '.' i= Identifier | '.' m= method );", 10, - 0, input); - - throw nvae; - } - switch(alt10) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:211:4: '.' i= Identifier - { - match(input, 37, FOLLOW_37_in_member682); - if(failed) return val; - i = (Token) input.LT(1); - match(input, Identifier, FOLLOW_Identifier_in_member688); - if(failed) return val; - if(backtracking == 0) - { - val = Symbol.intern(i.getText()); - } - - } - break; - case 2: - // /Users/rich/dev/clojure/src/jvm/Reader.g:212:4: '.' m= method - { - match(input, 37, FOLLOW_37_in_member695); - if(failed) return val; - pushFollow(FOLLOW_method_in_member701); - m = method(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = m; - } - - } - break; - - } - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 15, member_StartIndex); - } - } - return val; -} -// $ANTLR end member - -// $ANTLR start method -// /Users/rich/dev/clojure/src/jvm/Reader.g:215:1: fragment method returns [Object val] : i= MethodIdentifier (es= args )? ')' ; - -public final Object method() throws RecognitionException{ - Object val = null; - int method_StartIndex = input.index(); - Token i = null; - ISeq es = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 16)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:217:4: (i= MethodIdentifier (es= args )? ')' ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:217:4: i= MethodIdentifier (es= args )? ')' - { - i = (Token) input.LT(1); - match(input, MethodIdentifier, FOLLOW_MethodIdentifier_in_method726); - if(failed) return val; - // /Users/rich/dev/clojure/src/jvm/Reader.g:217:28: (es= args )? - int alt11 = 2; - int LA11_0 = input.LA(1); - - if(((LA11_0 >= Identifier && LA11_0 <= OctalLiteral) || LA11_0 == 29 || LA11_0 == 31 || LA11_0 == 33 || - LA11_0 == 36 || (LA11_0 >= 38 && LA11_0 <= 39))) - { - alt11 = 1; - } - switch(alt11) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: es= args - { - pushFollow(FOLLOW_args_in_method732); - es = args(); - _fsp--; - if(failed) return val; - - } - break; - - } - - match(input, 30, FOLLOW_30_in_method735); - if(failed) return val; - if(backtracking == 0) - { - val = RT.cons(Symbol.intern(i.getText().substring(0, i.getText().length() - 1)), es); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 16, method_StartIndex); - } - } - return val; -} -// $ANTLR end method - -// $ANTLR start args -// /Users/rich/dev/clojure/src/jvm/Reader.g:220:10: fragment args returns [ISeq val] : e1= expression ( Comma e= expression )* ; - -public final ISeq args() throws RecognitionException{ - ISeq val = null; - int args_StartIndex = input.index(); - Object e1 = null; - - Object e = null; - - - List es = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 17)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:224:4: (e1= expression ( Comma e= expression )* ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:224:4: e1= expression ( Comma e= expression )* - { - pushFollow(FOLLOW_expression_in_args761); - e1 = expression(); - _fsp--; - if(failed) return val; - // /Users/rich/dev/clojure/src/jvm/Reader.g:224:21: ( Comma e= expression )* - loop12: - do - { - int alt12 = 2; - int LA12_0 = input.LA(1); - - if((LA12_0 == Comma)) - { - alt12 = 1; - } - - - switch(alt12) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:224:22: Comma e= expression - { - match(input, Comma, FOLLOW_Comma_in_args765); - if(failed) return val; - pushFollow(FOLLOW_expression_in_args771); - e = expression(); - _fsp--; - if(failed) return val; - //WARNING- HAND MODIFIED! - if(es == null) es = new ArrayList(); - es.add(e); - // END HAND MODIFIED - - } - break; - - default: - break loop12; - } - } while(true); - - if(backtracking == 0) - { - val = RT.cons(e1, es != null ? RT.seq(es) : null); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 17, args_StartIndex); - } - } - return val; -} -// $ANTLR end args - -// $ANTLR start dotExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:227:1: dotExpression returns [Object val] : s= otherThanDotExpression (e= member )+ ; - -public final Object dotExpression() throws RecognitionException{ - Object val = null; - int dotExpression_StartIndex = input.index(); - Object s = null; - - Object e = null; - - - List es = null; - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 18)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:231:3: (s= otherThanDotExpression (e= member )+ ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:231:3: s= otherThanDotExpression (e= member )+ - { - pushFollow(FOLLOW_otherThanDotExpression_in_dotExpression800); - s = otherThanDotExpression(); - _fsp--; - if(failed) return val; - // /Users/rich/dev/clojure/src/jvm/Reader.g:231:32: (e= member )+ - int cnt13 = 0; - loop13: - do - { - int alt13 = 2; - int LA13_0 = input.LA(1); - - if((LA13_0 == 37)) - { - int LA13_2 = input.LA(2); - - if((synpred29())) - { - alt13 = 1; - } - - - } - - - switch(alt13) - { - case 1: - // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: e= member - { - pushFollow(FOLLOW_member_in_dotExpression806); - e = member(); - _fsp--; - if(failed) return val; - //WARNING- HAND MODIFIED! - if(es == null) es = new ArrayList(); - es.add(e); - // END HAND MODIFIED - - } - break; - - default: - if(cnt13 >= 1) break loop13; - if(backtracking > 0) - { - failed = true; - return val; - } - EarlyExitException eee = - new EarlyExitException(13, input); - throw eee; - } - cnt13++; - } while(true); - - if(backtracking == 0) - { - val = RT.listStar(DOTDOT, s, RT.seq(es)); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 18, dotExpression_StartIndex); - } - } - return val; -} -// $ANTLR end dotExpression - -// $ANTLR start quotedExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:234:1: quotedExpression returns [Object val] : '\\'' e= expression ; - -public final Object quotedExpression() throws RecognitionException{ - Object val = null; - int quotedExpression_StartIndex = input.index(); - Object e = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 19)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:235:3: ( '\\'' e= expression ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:235:3: '\\'' e= expression - { - match(input, 38, FOLLOW_38_in_quotedExpression824); - if(failed) return val; - pushFollow(FOLLOW_expression_in_quotedExpression830); - e = expression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = RT.list(QUOTE, e); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 19, quotedExpression_StartIndex); - } - } - return val; -} -// $ANTLR end quotedExpression - -// $ANTLR start caretExpression -// /Users/rich/dev/clojure/src/jvm/Reader.g:238:1: caretExpression returns [Object val] : '^' e= expression ; - -public final Object caretExpression() throws RecognitionException{ - Object val = null; - int caretExpression_StartIndex = input.index(); - Object e = null; - - - try - { - if(backtracking > 0 && alreadyParsedRule(input, 20)) - { - return val; - } - // /Users/rich/dev/clojure/src/jvm/Reader.g:239:3: ( '^' e= expression ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:239:3: '^' e= expression - { - match(input, 39, FOLLOW_39_in_caretExpression848); - if(failed) return val; - pushFollow(FOLLOW_expression_in_caretExpression854); - e = expression(); - _fsp--; - if(failed) return val; - if(backtracking == 0) - { - val = RT.list(META, e); - } - - } - - } - - catch(RecognitionException exc) - { - throw exc; - } - finally - { - if(backtracking > 0) - { - memoize(input, 20, caretExpression_StartIndex); - } - } - return val; -} -// $ANTLR end caretExpression - -// $ANTLR start synpred1 - -public final void synpred1_fragment() throws RecognitionException{ - // /Users/rich/dev/clojure/src/jvm/Reader.g:122:3: ( dotExpression ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:122:3: dotExpression - { - pushFollow(FOLLOW_dotExpression_in_synpred172); - dotExpression(); - _fsp--; - if(failed) return; - - } -} -// $ANTLR end synpred1 - -// $ANTLR start synpred29 - -public final void synpred29_fragment() throws RecognitionException{ - // /Users/rich/dev/clojure/src/jvm/Reader.g:231:34: ( member ) - // /Users/rich/dev/clojure/src/jvm/Reader.g:231:34: member - { - pushFollow(FOLLOW_member_in_synpred29806); - member(); - _fsp--; - if(failed) return; - - } -} -// $ANTLR end synpred29 - -public final boolean synpred29(){ - backtracking++; - int start = input.mark(); - try - { - synpred29_fragment(); // can never throw exception - } - catch(RecognitionException re) - { - System.err.println("impossible: " + re); - } - boolean success = !failed; - input.rewind(start); - backtracking--; - failed = false; - return success; -} - -public final boolean synpred1(){ - backtracking++; - int start = input.mark(); - try - { - synpred1_fragment(); // can never throw exception - } - catch(RecognitionException re) - { - System.err.println("impossible: " + re); - } - boolean success = !failed; - input.rewind(start); - backtracking--; - failed = false; - return success; -} - - -public static final BitSet FOLLOW_dotExpression_in_expression72 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_otherThanDotExpression_in_expression83 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_literal_in_otherThanDotExpression106 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_symbol_in_otherThanDotExpression116 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_keyword_in_otherThanDotExpression126 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_listExpression_in_otherThanDotExpression136 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_vectorExpression_in_otherThanDotExpression146 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_mapExpression_in_otherThanDotExpression156 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_metaExpression_in_otherThanDotExpression166 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_quotedExpression_in_otherThanDotExpression176 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_caretExpression_in_otherThanDotExpression186 = - new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_29_in_listExpression203 = new BitSet(new long[]{0x000000D2E000FFF0L}); -public static final BitSet FOLLOW_expressions_in_listExpression210 = new BitSet(new long[]{0x0000000040000000L}); -public static final BitSet FOLLOW_30_in_listExpression212 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_expression_in_expressions234 = new BitSet(new long[]{0x000000D2A000FFF2L}); -public static final BitSet FOLLOW_31_in_vectorExpression251 = new BitSet(new long[]{0x000000D3A000FFF0L}); -public static final BitSet FOLLOW_expressions_in_vectorExpression257 = new BitSet(new long[]{0x0000000100000000L}); -public static final BitSet FOLLOW_32_in_vectorExpression259 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_33_in_mapExpression279 = new BitSet(new long[]{0x000000D6A000FFF0L}); -public static final BitSet FOLLOW_expression_in_mapExpression284 = new BitSet(new long[]{0x000000D2A000FFF0L}); -public static final BitSet FOLLOW_expression_in_mapExpression288 = new BitSet(new long[]{0x000000D6A000FFF0L}); -public static final BitSet FOLLOW_34_in_mapExpression292 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_Identifier_in_symbol309 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_NSIdentifier_in_symbol319 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_DotDot_in_symbol329 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_KeywordIdentifier_in_keyword349 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_integerLiteral_in_literal376 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_FloatingPointLiteral_in_literal389 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_CharacterLiteral_in_literal402 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_StringLiteral_in_literal415 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_TrueToken_in_literal424 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_NullToken_in_literal433 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_ratioLiteral_in_literal446 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_DecimalLiteral_in_ratioLiteral469 = new BitSet(new long[]{0x0000000800000000L}); -public static final BitSet FOLLOW_35_in_ratioLiteral471 = new BitSet(new long[]{0x0000000000002000L}); -public static final BitSet FOLLOW_DecimalLiteral_in_ratioLiteral477 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_HexLiteral_in_integerLiteral503 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_OctalLiteral_in_integerLiteral522 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_DecimalLiteral_in_integerLiteral540 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_36_in_metaTag563 = new BitSet(new long[]{0x0000000000000070L}); -public static final BitSet FOLLOW_symbol_in_metaTag569 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_36_in_metaTag575 = new BitSet(new long[]{0x0000000200000000L}); -public static final BitSet FOLLOW_mapExpression_in_metaTag581 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_symbol_in_objExpression604 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_listExpression_in_objExpression614 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_mapExpression_in_objExpression624 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_vectorExpression_in_objExpression634 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_metaTag_in_metaExpression656 = new BitSet(new long[]{0x00000002A0000070L}); -public static final BitSet FOLLOW_objExpression_in_metaExpression662 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_37_in_member682 = new BitSet(new long[]{0x0000000000000010L}); -public static final BitSet FOLLOW_Identifier_in_member688 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_37_in_member695 = new BitSet(new long[]{0x0000000000010000L}); -public static final BitSet FOLLOW_method_in_member701 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_MethodIdentifier_in_method726 = new BitSet(new long[]{0x000000D2E000FFF0L}); -public static final BitSet FOLLOW_args_in_method732 = new BitSet(new long[]{0x0000000040000000L}); -public static final BitSet FOLLOW_30_in_method735 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_expression_in_args761 = new BitSet(new long[]{0x0000000000020002L}); -public static final BitSet FOLLOW_Comma_in_args765 = new BitSet(new long[]{0x000000D2A000FFF0L}); -public static final BitSet FOLLOW_expression_in_args771 = new BitSet(new long[]{0x0000000000020002L}); -public static final BitSet FOLLOW_otherThanDotExpression_in_dotExpression800 = - new BitSet(new long[]{0x0000002000000000L}); -public static final BitSet FOLLOW_member_in_dotExpression806 = new BitSet(new long[]{0x0000002000000002L}); -public static final BitSet FOLLOW_38_in_quotedExpression824 = new BitSet(new long[]{0x000000D2A000FFF0L}); -public static final BitSet FOLLOW_expression_in_quotedExpression830 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_39_in_caretExpression848 = new BitSet(new long[]{0x000000D2A000FFF0L}); -public static final BitSet FOLLOW_expression_in_caretExpression854 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_dotExpression_in_synpred172 = new BitSet(new long[]{0x0000000000000002L}); -public static final BitSet FOLLOW_member_in_synpred29806 = new BitSet(new long[]{0x0000000000000002L}); - -}
\ No newline at end of file |