diff options
-rw-r--r-- | src/jvm/Reader.g | 328 | ||||
-rw-r--r-- | src/jvm/clojure/lang/ReaderLexer.java | 2388 | ||||
-rw-r--r-- | src/jvm/clojure/lang/ReaderParser.java | 2072 |
3 files changed, 4788 insertions, 0 deletions
diff --git a/src/jvm/Reader.g b/src/jvm/Reader.g new file mode 100644 index 00000000..4b0a13b5 --- /dev/null +++ b/src/jvm/Reader.g @@ -0,0 +1,328 @@ +/** + * 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. + **/ + +grammar Reader; +options { language=Java; backtrack=true; memoize=true;} +@header { +package clojure.lang; +import java.math.BigInteger; +import java.io.Writer; +import java.io.PrintWriter; +} +@lexer::header { + + package clojure.lang; +} +@lexer::members{ + 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; + } +} + +@members{ +//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 = new Symbol(".."); + +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<10;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; +} + + +} + +@rulecatch { +catch (RecognitionException exc) { +throw exc; +} +} + +expression returns[Object val] + : lt = literal {$val = $lt.val;} + |s = symbol {$val = $s.val;} + |k = keyword {$val = $k.val;} + |le = listExpression {$val = $le.val;} + |ve = vectorExpression {$val = $ve.val;} + |me = mapExpression {$val = $me.val;} + |mx = metaExpression {$val = $mx.val;} + |g = dotExpression {$val = $g.val;} + ; + +listExpression returns[ISeq val] + : '(' es = expressions ')' {$val = es!=null?RT.seq(es):PersistentList.EMPTY;} + ; + +fragment expressions returns[List es] + : e = expression* + ; + +vectorExpression returns[IPersistentArray val] + : '[' es = expressions ']' {$val = es!=null?RT.tuple(es.toArray()):PersistentVector.EMPTY;} + ; + +mapExpression returns[IPersistentMap val] +@init{ +val = PersistentHashMap.EMPTY; +} + : '{' (k=expression v=expression)* '}' + ; + +symbol returns[Symbol val] + :n = (Identifier|JavaIdentifier) {$val = new Symbol($n.text);} + |ns = (Identifier|JavaIdentifier) '/' nn = (Identifier|JavaIdentifier) {$val = new Symbol($ns.text,$nn.text);} + |dd = DotDot {$val = DOTDOT;} + ; + +keyword returns[Keyword val] + :':' s = symbol {$val = new Keyword($s.val);} + ; + + +literal returns[Object val] + :i = integerLiteral {$val=$i.val;} + |fp = FloatingPointLiteral {$val=Num.from(Double.valueOf($fp.text));} + |c = CharacterLiteral {$val=$c.text.charAt(0);} + |s = StringLiteral {$val=$s.text.substring(1,s.getText().length()-1);} + |TrueToken {$val=Boolean.TRUE;} + |NullToken {$val=null;} + |r = ratioLiteral {$val=$r.val;} + ; + +ratioLiteral returns[Num val] + : n = DecimalLiteral '/' d = DecimalLiteral {$val = Num.divide(new BigInteger($n.text),new BigInteger($d.text));} + ; + +integerLiteral returns[Num val] + : hn = HexLiteral {$val = Num.from(new BigInteger($hn.text.substring(2),16));} + | on = OctalLiteral {$val = Num.from(new BigInteger($on.text.substring(1),8));} + | nn = DecimalLiteral {$val = Num.from(new BigInteger($nn.text));} + ; + + + +fragment +metaTag returns[IPersistentMap val] + :'#^' s = symbol {$val = RT.map(RT.TAG_KEY,$s.val);} + |'#^' m = mapExpression {$val = $m.val;} + ; + +fragment +objExpression returns[Obj val] + :s = symbol {$val = $s.val;} + |le = listExpression {$val = (Obj)$le.val;} + |me = mapExpression {$val = (Obj)$me.val;} + |ve = vectorExpression {$val = (Obj)$ve.val;} + ; + +metaExpression returns [Obj val] + :m = metaTag e = objExpression {$val = $e.val.withMeta($m.val);} + ; + +fragment +member returns [Object val] + : '.' i = JavaIdentifier {$val = new Symbol($i.text);} + | '.' m = method {$val = $m.val;} + ; + +fragment +method returns [Object val] + : i = MethodIdentifier es = args? ')' {$val = RT.cons(new Symbol($i.text.substring(0,$i.text.length()-1)), es);} + ; + +fragment args returns[ISeq val] +@init{ +List es = null; +} + : e1 = expression (Comma e = expression)* {$val = RT.cons(e1,es!=null?RT.seq(es):null);} + ; + +dotExpression returns [Object val] +@init{ +List es = null; +} + :s = symbol e = member+ {$val = RT.listStar(DOTDOT,s,RT.seq(es));} + ; +// LEXER +Comma : ','; +TrueToken : 'true'; + +NullToken : 'null' ; + +DotDot : '..'; + +HexLiteral : '0' ('x'|'X') HexDigit+; + +DecimalLiteral : ('0' | '1'..'9' '0'..'9'*); + +OctalLiteral : '0' ('0'..'7')+; + +fragment +HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ; + +FloatingPointLiteral + : ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix? + | '.' ('0'..'9')+ Exponent? FloatTypeSuffix? + | ('0'..'9')+ Exponent FloatTypeSuffix? + | ('0'..'9')+ Exponent? FloatTypeSuffix + ; + +fragment +Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ; + +fragment +FloatTypeSuffix : ('f'|'F'|'d'|'D') ; + +CharacterLiteral + : '\\' ( EscapeSequence | ~('\\') ) + ; + +StringLiteral + : '"' ( EscapeSequence | ~('\\'|'"') )* '"' + ; + +fragment +EscapeSequence + : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') + | UnicodeEscape + | OctalEscape + ; + +fragment +OctalEscape + : '\\' ('0'..'3') ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') + ; + +fragment +UnicodeEscape + : '\\' 'u' HexDigit HexDigit HexDigit HexDigit + ; + +JavaIdentifier + : Letter (Letter|JavaIDDigit)* + ; + +Identifier + : Letter ('-' |Letter|JavaIDDigit)* + ; + +MethodIdentifier + : Letter (Letter|JavaIDDigit)* '(' + ; +/**I found this char range in JavaCC's grammar, but Letter and Digit overlap. + Still works, but... + */ +fragment +Letter + : '\u0024' | + '\u0041'..'\u005a' | + '\u005f' | + '\u0061'..'\u007a' | + '\u00c0'..'\u00d6' | + '\u00d8'..'\u00f6' | + '\u00f8'..'\u00ff' | + '\u0100'..'\u1fff' | + '\u3040'..'\u318f' | + '\u3300'..'\u337f' | + '\u3400'..'\u3d2d' | + '\u4e00'..'\u9fff' | + '\uf900'..'\ufaff' + ; + +fragment +JavaIDDigit + : + '\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' + ; + +WS : (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;} + ; + +COMMENT + : '#|' ( options {greedy=false;} : . )* '|#' {$channel=HIDDEN;} + ; + +LINE_COMMENT + : ';' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;} + ; diff --git a/src/jvm/clojure/lang/ReaderLexer.java b/src/jvm/clojure/lang/ReaderLexer.java new file mode 100644 index 00000000..631f002f --- /dev/null +++ b/src/jvm/clojure/lang/ReaderLexer.java @@ -0,0 +1,2388 @@ +// $ANTLR 3.0 /Users/rich/dev/clojure/src/jvm/Reader.g 2007-07-13 12:56:20 + + +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 = 10; +public static final int T29 = 29; +public static final int Exponent = 18; +public static final int OctalLiteral = 14; +public static final int T33 = 33; +public static final int Identifier = 4; +public static final int HexDigit = 17; +public static final int T36 = 36; +public static final int WS = 25; +public static final int CharacterLiteral = 8; +public static final int MethodIdentifier = 15; +public static final int T28 = 28; +public static final int T35 = 35; +public static final int COMMENT = 26; +public static final int StringLiteral = 9; +public static final int LINE_COMMENT = 27; +public static final int DotDot = 6; +public static final int T34 = 34; +public static final int JavaIDDigit = 24; +public static final int Letter = 23; +public static final int UnicodeEscape = 21; +public static final int Comma = 16; +public static final int HexLiteral = 13; +public static final int T37 = 37; +public static final int EscapeSequence = 20; +public static final int NullToken = 11; +public static final int EOF = -1; +public static final int DecimalLiteral = 12; +public static final int T32 = 32; +public static final int Tokens = 38; +public static final int T31 = 31; +public static final int OctalEscape = 22; +public static final int FloatingPointLiteral = 7; +public static final int T30 = 30; +public static final int FloatTypeSuffix = 19; +public static final int JavaIdentifier = 5; + +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 T28 +public final void mT28() throws RecognitionException{ + try + { + int _type = T28; + // /Users/rich/dev/clojure/src/jvm/Reader.g:25:7: ( '(' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:25:7: '(' + { + match('('); + + } + + this.type = _type; + } + finally + { + } +} +// $ANTLR end T28 + +// $ANTLR start T29 + +public final void mT29() throws RecognitionException{ + try + { + int _type = T29; + // /Users/rich/dev/clojure/src/jvm/Reader.g:26:7: ( ')' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:26: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:27:7: ( '[' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:27: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:28:7: ( ']' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:28: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:29:7: ( '{' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:29: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:30:7: ( '}' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:30: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:31:7: ( '/' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:31: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:32:7: ( ':' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:32: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:33:7: ( '#^' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:33: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:34:7: ( '.' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:34:7: '.' + { + match('.'); + + } + + this.type = _type; + } + finally + { + } +} +// $ANTLR end T37 + +// $ANTLR start Comma + +public final void mComma() throws RecognitionException{ + try + { + int _type = Comma; + // /Users/rich/dev/clojure/src/jvm/Reader.g:212:10: ( ',' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:212: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:213:16: ( 'true' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:213: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:215:16: ( 'null' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:215: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:217:10: ( '..' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:217: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:219:14: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:219: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:219: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:219: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:221:18: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:221:18: ( '0' | '1' .. '9' ( '0' .. '9' )* ) + { + // /Users/rich/dev/clojure/src/jvm/Reader.g:221: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("221:18: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 3, 0, input); + + throw nvae; + } + switch(alt3) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:221:19: '0' + { + match('0'); + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:221:25: '1' .. '9' ( '0' .. '9' )* + { + matchRange('1', '9'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:221: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:221: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:223:16: ( '0' ( '0' .. '7' )+ ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:223:16: '0' ( '0' .. '7' )+ + { + match('0'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:223: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:223: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:226:12: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:226: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:229: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:229:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? + { + // /Users/rich/dev/clojure/src/jvm/Reader.g:229: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:229: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:229: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:229:26: '0' .. '9' + { + matchRange('0', '9'); + + } + break; + + default: + break loop6; + } + } while(true); + + // /Users/rich/dev/clojure/src/jvm/Reader.g:229: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:229:37: Exponent + { + mExponent(); + + } + break; + + } + + // /Users/rich/dev/clojure/src/jvm/Reader.g:229: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:229:47: FloatTypeSuffix + { + mFloatTypeSuffix(); + + } + break; + + } + + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:230:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? + { + match('.'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:230: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:230: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:230: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:230:25: Exponent + { + mExponent(); + + } + break; + + } + + // /Users/rich/dev/clojure/src/jvm/Reader.g:230: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:230:35: FloatTypeSuffix + { + mFloatTypeSuffix(); + + } + break; + + } + + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:231:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? + { + // /Users/rich/dev/clojure/src/jvm/Reader.g:231: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:231: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:231: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:231:30: FloatTypeSuffix + { + mFloatTypeSuffix(); + + } + break; + + } + + + } + break; + case 4: + // /Users/rich/dev/clojure/src/jvm/Reader.g:232:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix + { + // /Users/rich/dev/clojure/src/jvm/Reader.g:232: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:232: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:232: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:232: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:236:12: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:236: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:236: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:236: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:236: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:239:19: ( ( 'f' | 'F' | 'd' | 'D' ) ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:239: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:242:9: ( '\\\\' ( EscapeSequence | ~ ( '\\\\' ) ) ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:242:9: '\\\\' ( EscapeSequence | ~ ( '\\\\' ) ) + { + match('\\'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:242: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("242:14: ( EscapeSequence | ~ ( '\\\\' ) )", 19, 0, input); + + throw nvae; + } + switch(alt19) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:242:16: EscapeSequence + { + mEscapeSequence(); + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:242: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:246:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:246:8: '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' + { + match('\"'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:246: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:246:14: EscapeSequence + { + mEscapeSequence(); + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:246: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:251: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'u': + { + alt21 = 2; + } + break; + case'\"': + case'\'': + case'\\': + case'b': + case'f': + case'n': + case'r': + case't': + { + alt21 = 1; + } + 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( + "249:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", + 21, 1, input); + + throw nvae; + } + + } + else + { + NoViableAltException nvae = + new NoViableAltException( + "249: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:251: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:252:9: UnicodeEscape + { + mUnicodeEscape(); + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:253: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:258: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( + "256: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( + "256: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:258:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) + { + match('\\'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:14: ( '0' .. '3' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:15: '0' .. '3' + { + matchRange('0', '3'); + + } + + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:25: ( '0' .. '7' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:26: '0' .. '7' + { + matchRange('0', '7'); + + } + + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:36: ( '0' .. '7' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:258:37: '0' .. '7' + { + matchRange('0', '7'); + + } + + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:259:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) + { + match('\\'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:259:14: ( '0' .. '7' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:259:15: '0' .. '7' + { + matchRange('0', '7'); + + } + + // /Users/rich/dev/clojure/src/jvm/Reader.g:259:25: ( '0' .. '7' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:259:26: '0' .. '7' + { + matchRange('0', '7'); + + } + + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:260:9: '\\\\' ( '0' .. '7' ) + { + match('\\'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:260:14: ( '0' .. '7' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:260: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:265:9: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:265:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit + { + match('\\'); + match('u'); + mHexDigit(); + mHexDigit(); + mHexDigit(); + mHexDigit(); + + } + + } + finally + { + } +} +// $ANTLR end UnicodeEscape + +// $ANTLR start JavaIdentifier + +public final void mJavaIdentifier() throws RecognitionException{ + try + { + int _type = JavaIdentifier; + // /Users/rich/dev/clojure/src/jvm/Reader.g:269:9: ( Letter ( Letter | JavaIDDigit )* ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:269:9: Letter ( Letter | JavaIDDigit )* + { + mLetter(); + // /Users/rich/dev/clojure/src/jvm/Reader.g:269:16: ( Letter | JavaIDDigit )* + loop23: + do + { + int alt23 = 2; + int LA23_0 = input.LA(1); + + if((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) >= '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 JavaIdentifier + +// $ANTLR start Identifier + +public final void mIdentifier() throws RecognitionException{ + try + { + int _type = Identifier; + // /Users/rich/dev/clojure/src/jvm/Reader.g:273:9: ( Letter ( '-' | Letter | JavaIDDigit )* ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:273:9: Letter ( '-' | Letter | JavaIDDigit )* + { + mLetter(); + // /Users/rich/dev/clojure/src/jvm/Reader.g:273:16: ( '-' | Letter | JavaIDDigit )* + loop24: + do + { + int alt24 = 2; + int LA24_0 = input.LA(1); + + if((LA24_0 == '$' || LA24_0 == '-' || (LA24_0 >= '0' && LA24_0 <= '9') || + (LA24_0 >= 'A' && LA24_0 <= 'Z') || LA24_0 == '_' || (LA24_0 >= 'a' && LA24_0 <= 'z') || + (LA24_0 >= '\u00C0' && LA24_0 <= '\u00D6') || (LA24_0 >= '\u00D8' && LA24_0 <= '\u00F6') || + (LA24_0 >= '\u00F8' && LA24_0 <= '\u1FFF') || (LA24_0 >= '\u3040' && LA24_0 <= '\u318F') || + (LA24_0 >= '\u3300' && LA24_0 <= '\u337F') || (LA24_0 >= '\u3400' && LA24_0 <= '\u3D2D') || + (LA24_0 >= '\u4E00' && LA24_0 <= '\u9FFF') || (LA24_0 >= '\uF900' && LA24_0 <= '\uFAFF'))) + { + alt24 = 1; + } + + + switch(alt24) + { + 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 loop24; + } + } while(true); + + + } + + this.type = _type; + } + finally + { + } +} +// $ANTLR end Identifier + +// $ANTLR start MethodIdentifier + +public final void mMethodIdentifier() throws RecognitionException{ + try + { + int _type = MethodIdentifier; + // /Users/rich/dev/clojure/src/jvm/Reader.g:277:9: ( Letter ( Letter | JavaIDDigit )* '(' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:277:9: Letter ( Letter | JavaIDDigit )* '(' + { + mLetter(); + // /Users/rich/dev/clojure/src/jvm/Reader.g:277: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:284: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:302: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:319:8: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:319: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:323:9: ( '#|' ( options {greedy=false; } : . )* '|#' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:323:9: '#|' ( options {greedy=false; } : . )* '|#' + { + match("#|"); + + // /Users/rich/dev/clojure/src/jvm/Reader.g:323: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:323: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:327:7: ( ';' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:327:7: ';' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' + { + match(';'); + // /Users/rich/dev/clojure/src/jvm/Reader.g:327: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:327: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:327: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:327: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: ( T28 | T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | Comma | TrueToken | NullToken | DotDot | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | JavaIdentifier | Identifier | MethodIdentifier | WS | COMMENT | LINE_COMMENT ) + int alt29 = 26; + alt29 = dfa29.predict(input); + switch(alt29) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:10: T28 + { + mT28(); + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:14: T29 + { + mT29(); + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:18: T30 + { + mT30(); + + } + break; + case 4: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:22: T31 + { + mT31(); + + } + break; + case 5: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:26: T32 + { + mT32(); + + } + break; + case 6: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:30: T33 + { + mT33(); + + } + break; + case 7: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:34: T34 + { + mT34(); + + } + break; + case 8: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:38: T35 + { + mT35(); + + } + break; + case 9: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:42: T36 + { + mT36(); + + } + break; + case 10: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:46: T37 + { + mT37(); + + } + break; + case 11: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:50: Comma + { + mComma(); + + } + break; + case 12: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:56: TrueToken + { + mTrueToken(); + + } + break; + case 13: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:66: NullToken + { + mNullToken(); + + } + break; + case 14: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:76: DotDot + { + mDotDot(); + + } + break; + case 15: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:83: HexLiteral + { + mHexLiteral(); + + } + break; + case 16: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:94: DecimalLiteral + { + mDecimalLiteral(); + + } + break; + case 17: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:109: OctalLiteral + { + mOctalLiteral(); + + } + break; + case 18: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:122: FloatingPointLiteral + { + mFloatingPointLiteral(); + + } + break; + case 19: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:143: CharacterLiteral + { + mCharacterLiteral(); + + } + break; + case 20: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:160: StringLiteral + { + mStringLiteral(); + + } + break; + case 21: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:174: JavaIdentifier + { + mJavaIdentifier(); + + } + break; + case 22: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:189: Identifier + { + mIdentifier(); + + } + break; + case 23: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:200: MethodIdentifier + { + mMethodIdentifier(); + + } + break; + case 24: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:217: WS + { + mWS(); + + } + break; + case 25: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:220: COMMENT + { + mCOMMENT(); + + } + break; + case 26: + // /Users/rich/dev/clojure/src/jvm/Reader.g:1:228: LINE_COMMENT + { + mLINE_COMMENT(); + + } + break; + + } + +} + + +protected DFA16 dfa16 = new DFA16(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\4\1\1\2\uffff\2\3"; +static final String DFA16_specialS = + "\12\uffff}>"; +static final String[] DFA16_transitionS = { + "\1\2\1\uffff\12\1", + "\1\5\1\uffff\12\1\12\uffff\1\4\1\3\1\4\35\uffff\1\4\1\3\1\4", + "", + "\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 "228:1: FloatingPointLiteral : ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix );"; + } +} + +static final String DFA29_eotS = + "\12\uffff\1\31\1\uffff\2\33\2\42\2\uffff\1\33\7\uffff\1\33\1\uffff" + + "\1\33\2\uffff\1\33\1\uffff\1\46\1\uffff\1\42\2\33\1\uffff\1\51\1" + + "\52\2\uffff"; +static final String DFA29_eofS = + "\53\uffff"; +static final String DFA29_minS = + "\1\11\10\uffff\1\136\1\56\1\uffff\2\44\2\56\2\uffff\1\44\7\uffff" + + "\1\44\1\uffff\1\44\2\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\10\uffff\1\174\1\71\1\uffff\2\ufaff\1\170\1\146\2\uffff" + + "\1\ufaff\7\uffff\1\ufaff\1\uffff\1\ufaff\2\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\1\10\2\uffff\1\13\4\uffff\1" + + "\23\1\24\1\uffff\1\30\1\32\1\31\1\11\1\16\1\22\1\12\1\uffff\1\25" + + "\1\uffff\1\27\1\26\1\uffff\1\17\1\uffff\1\20\3\uffff\1\21\2\uffff" + + "\1\14\1\15"; +static final String DFA29_specialS = + "\53\uffff}>"; +static final String[] DFA29_transitionS = { + "\2\23\1\uffff\2\23\22\uffff\1\23\1\uffff\1\21\1\11\1\22\3\uffff" + + "\1\1\1\2\2\uffff\1\13\1\uffff\1\12\1\7\1\16\11\17\1\10\1\24" + + "\5\uffff\32\22\1\3\1\20\1\4\1\uffff\1\22\1\uffff\15\22\1\15" + + "\5\22\1\14\6\22\1\5\1\uffff\1\6\102\uffff\27\22\1\uffff\37\22" + + "\1\uffff\u1f08\22\u1040\uffff\u0150\22\u0170\uffff\u0080\22" + + "\u0080\uffff\u092e\22\u10d2\uffff\u5200\22\u5900\uffff\u0200" + + "\22", + "", + "", + "", + "", + "", + "", + "", + "", + "\1\26\35\uffff\1\25", + "\1\27\1\uffff\12\30", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\21\34\1\32\10\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\24\34\1\37\5\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "\1\30\1\uffff\10\41\2\30\12\uffff\3\30\21\uffff\1\40\13\uffff" + + "\3\30\21\uffff\1\40", + "\1\30\1\uffff\12\43\12\uffff\3\30\35\uffff\3\30", + "", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\32\34\105\uffff\27\34\1\uffff\37\34\1" + + "\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080\34\u0080" + + "\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200\34", + "", + "", + "", + "", + "", + "", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\24\34\1\44\5\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\32\34\105\uffff\27\34\1\uffff\37\34\1" + + "\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080\34\u0080" + + "\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200\34", + "", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\13\34\1\45\16\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "", + "\1\30\1\uffff\10\41\2\30\12\uffff\3\30\35\uffff\3\30", + "", + "\1\30\1\uffff\12\43\12\uffff\3\30\35\uffff\3\30", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\4\34\1\47\25\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\13\34\1\50\16\34\105\uffff\27\34\1\uffff" + + "\37\34\1\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080" + + "\34\u0080\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200" + + "\34", + "", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\32\34\105\uffff\27\34\1\uffff\37\34\1" + + "\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080\34\u0080" + + "\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200\34", + "\1\34\3\uffff\1\35\4\uffff\1\36\2\uffff\12\34\7\uffff\32\34" + + "\4\uffff\1\34\1\uffff\32\34\105\uffff\27\34\1\uffff\37\34\1" + + "\uffff\u1f08\34\u1040\uffff\u0150\34\u0170\uffff\u0080\34\u0080" + + "\uffff\u092e\34\u10d2\uffff\u5200\34\u5900\uffff\u0200\34", + "", + "" +}; + +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 : ( T28 | T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | Comma | TrueToken | NullToken | DotDot | HexLiteral | DecimalLiteral | OctalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | JavaIdentifier | Identifier | 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 new file mode 100644 index 00000000..5cfab491 --- /dev/null +++ b/src/jvm/clojure/lang/ReaderParser.java @@ -0,0 +1,2072 @@ +// $ANTLR 3.0 /Users/rich/dev/clojure/src/jvm/Reader.g 2007-07-13 12:56:20 + +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", "JavaIdentifier", "DotDot", "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 = 10; +public static final int Exponent = 18; +public static final int OctalLiteral = 14; +public static final int Identifier = 4; +public static final int HexDigit = 17; +public static final int WS = 25; +public static final int CharacterLiteral = 8; +public static final int MethodIdentifier = 15; +public static final int COMMENT = 26; +public static final int StringLiteral = 9; +public static final int LINE_COMMENT = 27; +public static final int DotDot = 6; +public static final int JavaIDDigit = 24; +public static final int Letter = 23; +public static final int UnicodeEscape = 21; +public static final int HexLiteral = 13; +public static final int Comma = 16; +public static final int EscapeSequence = 20; +public static final int EOF = -1; +public static final int NullToken = 11; +public static final int DecimalLiteral = 12; +public static final int OctalEscape = 22; +public static final int FloatingPointLiteral = 7; +public static final int JavaIdentifier = 5; +public static final int FloatTypeSuffix = 19; + +public ReaderParser(TokenStream input){ + super(input); + ruleMemo = new HashMap[47 + 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 = new Symbol(".."); + +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 < 10; 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:106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression ); +public final Object expression() throws RecognitionException{ + Object val = null; + int expression_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 g = null; + + + try + { + if(backtracking > 0 && alreadyParsedRule(input, 1)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:107:4: (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression ) + int alt1 = 8; + switch(input.LA(1)) + { + case FloatingPointLiteral: + case CharacterLiteral: + case StringLiteral: + case TrueToken: + case NullToken: + case DecimalLiteral: + case HexLiteral: + case OctalLiteral: + { + alt1 = 1; + } + break; + case Identifier: + case JavaIdentifier: + { + switch(input.LA(2)) + { + case 34: + { + int LA1_9 = input.LA(3); + + if(((LA1_9 >= Identifier && LA1_9 <= JavaIdentifier))) + { + int LA1_12 = input.LA(4); + + if((LA1_12 == 37)) + { + alt1 = 8; + } + else if((LA1_12 == EOF || (LA1_12 >= Identifier && LA1_12 <= OctalLiteral) || LA1_12 == Comma || + (LA1_12 >= 28 && LA1_12 <= 33) || (LA1_12 >= 35 && LA1_12 <= 36))) + { + alt1 = 2; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression );", + 1, 12, input); + + throw nvae; + } + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression );", + 1, 9, input); + + throw nvae; + } + } + break; + case 37: + { + alt1 = 8; + } + break; + case EOF: + case Identifier: + case JavaIdentifier: + case DotDot: + case FloatingPointLiteral: + case CharacterLiteral: + case StringLiteral: + case TrueToken: + case NullToken: + case DecimalLiteral: + case HexLiteral: + case OctalLiteral: + case Comma: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 35: + case 36: + { + alt1 = 2; + } + break; + default: + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression );", + 1, 2, input); + + throw nvae; + } + + } + break; + case DotDot: + { + int LA1_3 = input.LA(2); + + if((LA1_3 == 37)) + { + alt1 = 8; + } + else if((LA1_3 == EOF || (LA1_3 >= Identifier && LA1_3 <= OctalLiteral) || LA1_3 == Comma || + (LA1_3 >= 28 && LA1_3 <= 33) || (LA1_3 >= 35 && LA1_3 <= 36))) + { + alt1 = 2; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression );", + 1, 3, input); + + throw nvae; + } + } + break; + case 35: + { + alt1 = 3; + } + break; + case 28: + { + alt1 = 4; + } + break; + case 30: + { + alt1 = 5; + } + break; + case 32: + { + alt1 = 6; + } + break; + case 36: + { + alt1 = 7; + } + break; + default: + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "106:1: expression returns [Object val] : (lt= literal | s= symbol | k= keyword | le= listExpression | ve= vectorExpression | me= mapExpression | mx= metaExpression | g= dotExpression );", + 1, 0, input); + + throw nvae; + } + + switch(alt1) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:107:4: lt= literal + { + pushFollow(FOLLOW_literal_in_expression73); + lt = literal(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = lt; + } + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:108:3: s= symbol + { + pushFollow(FOLLOW_symbol_in_expression83); + s = symbol(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = s; + } + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:109:3: k= keyword + { + pushFollow(FOLLOW_keyword_in_expression93); + k = keyword(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = k; + } + + } + break; + case 4: + // /Users/rich/dev/clojure/src/jvm/Reader.g:110:3: le= listExpression + { + pushFollow(FOLLOW_listExpression_in_expression103); + le = listExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = le; + } + + } + break; + case 5: + // /Users/rich/dev/clojure/src/jvm/Reader.g:111:3: ve= vectorExpression + { + pushFollow(FOLLOW_vectorExpression_in_expression113); + ve = vectorExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = ve; + } + + } + break; + case 6: + // /Users/rich/dev/clojure/src/jvm/Reader.g:112:3: me= mapExpression + { + pushFollow(FOLLOW_mapExpression_in_expression123); + me = mapExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = me; + } + + } + break; + case 7: + // /Users/rich/dev/clojure/src/jvm/Reader.g:113:3: mx= metaExpression + { + pushFollow(FOLLOW_metaExpression_in_expression133); + mx = metaExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = mx; + } + + } + break; + case 8: + // /Users/rich/dev/clojure/src/jvm/Reader.g:114:3: g= dotExpression + { + pushFollow(FOLLOW_dotExpression_in_expression143); + g = dotExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = g; + } + + } + break; + + } + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 1, expression_StartIndex); + } + } + return val; +} +// $ANTLR end expression + +// $ANTLR start listExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:117: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, 2)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:118:4: ( '(' es= expressions ')' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:118:4: '(' es= expressions ')' + { + match(input, 28, FOLLOW_28_in_listExpression160); + if(failed) return val; + pushFollow(FOLLOW_expressions_in_listExpression167); + es = expressions(); + _fsp--; + if(failed) return val; + match(input, 29, FOLLOW_29_in_listExpression169); + 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, 2, listExpression_StartIndex); + } + } + return val; +} +// $ANTLR end listExpression + +// $ANTLR start expressions +// /Users/rich/dev/clojure/src/jvm/Reader.g:121: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, 3)) + { + return es; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:122:4: ( (e= expression )* ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:122:4: (e= expression )* + { + // /Users/rich/dev/clojure/src/jvm/Reader.g:122:6: (e= expression )* + loop2: + do + { + int alt2 = 2; + int LA2_0 = input.LA(1); + + if(((LA2_0 >= Identifier && LA2_0 <= OctalLiteral) || LA2_0 == 28 || LA2_0 == 30 || LA2_0 == 32 || + (LA2_0 >= 35 && LA2_0 <= 36))) + { + alt2 = 1; + } + + + switch(alt2) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: e= expression + { + pushFollow(FOLLOW_expression_in_expressions191); + 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 loop2; + } + } while(true); + + + } + + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 3, expressions_StartIndex); + } + } + return es; +} +// $ANTLR end expressions + +// $ANTLR start vectorExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:125: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, 4)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:126:4: ( '[' es= expressions ']' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:126:4: '[' es= expressions ']' + { + match(input, 30, FOLLOW_30_in_vectorExpression208); + if(failed) return val; + pushFollow(FOLLOW_expressions_in_vectorExpression214); + es = expressions(); + _fsp--; + if(failed) return val; + match(input, 31, FOLLOW_31_in_vectorExpression216); + 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, 4, vectorExpression_StartIndex); + } + } + return val; +} +// $ANTLR end vectorExpression + +// $ANTLR start mapExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:129: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, 5)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:133:4: ( '{' (k= expression v= expression )* '}' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:133:4: '{' (k= expression v= expression )* '}' + { + match(input, 32, FOLLOW_32_in_mapExpression236); + if(failed) return val; + // /Users/rich/dev/clojure/src/jvm/Reader.g:133:8: (k= expression v= expression )* + loop3: + do + { + int alt3 = 2; + int LA3_0 = input.LA(1); + + if(((LA3_0 >= Identifier && LA3_0 <= OctalLiteral) || LA3_0 == 28 || LA3_0 == 30 || LA3_0 == 32 || + (LA3_0 >= 35 && LA3_0 <= 36))) + { + alt3 = 1; + } + + + switch(alt3) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:133:9: k= expression v= expression + { + pushFollow(FOLLOW_expression_in_mapExpression241); + k = expression(); + _fsp--; + if(failed) return val; + pushFollow(FOLLOW_expression_in_mapExpression245); + v = expression(); + _fsp--; + if(failed) return val; + //*WARNING- HAND MODIFIED! + val = val.assoc(k, v); + // END HAND MODIFIED*/ + + } + break; + + default: + break loop3; + } + } while(true); + + match(input, 33, FOLLOW_33_in_mapExpression249); + if(failed) return val; + + } + + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 5, mapExpression_StartIndex); + } + } + return val; +} +// $ANTLR end mapExpression + +// $ANTLR start symbol +// /Users/rich/dev/clojure/src/jvm/Reader.g:136:1: symbol returns [Symbol val] : (n= ( Identifier | JavaIdentifier ) | ns= ( Identifier | JavaIdentifier ) '/' nn= ( Identifier | JavaIdentifier ) | dd= DotDot ); + +public final Symbol symbol() throws RecognitionException{ + Symbol val = null; + int symbol_StartIndex = input.index(); + Token n = null; + Token ns = null; + Token nn = null; + Token dd = null; + + try + { + if(backtracking > 0 && alreadyParsedRule(input, 6)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:137:3: (n= ( Identifier | JavaIdentifier ) | ns= ( Identifier | JavaIdentifier ) '/' nn= ( Identifier | JavaIdentifier ) | dd= DotDot ) + int alt4 = 3; + int LA4_0 = input.LA(1); + + if(((LA4_0 >= Identifier && LA4_0 <= JavaIdentifier))) + { + int LA4_1 = input.LA(2); + + if((LA4_1 == 34)) + { + alt4 = 2; + } + else if((LA4_1 == EOF || (LA4_1 >= Identifier && LA4_1 <= OctalLiteral) || LA4_1 == Comma || + (LA4_1 >= 28 && LA4_1 <= 33) || (LA4_1 >= 35 && LA4_1 <= 37))) + { + alt4 = 1; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "136:1: symbol returns [Symbol val] : (n= ( Identifier | JavaIdentifier ) | ns= ( Identifier | JavaIdentifier ) '/' nn= ( Identifier | JavaIdentifier ) | dd= DotDot );", + 4, 1, input); + + throw nvae; + } + } + else if((LA4_0 == DotDot)) + { + alt4 = 3; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "136:1: symbol returns [Symbol val] : (n= ( Identifier | JavaIdentifier ) | ns= ( Identifier | JavaIdentifier ) '/' nn= ( Identifier | JavaIdentifier ) | dd= DotDot );", + 4, 0, input); + + throw nvae; + } + switch(alt4) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:137:3: n= ( Identifier | JavaIdentifier ) + { + n = (Token) input.LT(1); + if((input.LA(1) >= Identifier && input.LA(1) <= JavaIdentifier)) + { + input.consume(); + errorRecovery = false; + failed = false; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + MismatchedSetException mse = + new MismatchedSetException(null, input); + recoverFromMismatchedSet(input, mse, FOLLOW_set_in_symbol266); + throw mse; + } + + if(backtracking == 0) + { + val = new Symbol(n.getText()); + } + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:138:3: ns= ( Identifier | JavaIdentifier ) '/' nn= ( Identifier | JavaIdentifier ) + { + ns = (Token) input.LT(1); + if((input.LA(1) >= Identifier && input.LA(1) <= JavaIdentifier)) + { + input.consume(); + errorRecovery = false; + failed = false; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + MismatchedSetException mse = + new MismatchedSetException(null, input); + recoverFromMismatchedSet(input, mse, FOLLOW_set_in_symbol280); + throw mse; + } + + match(input, 34, FOLLOW_34_in_symbol286); + if(failed) return val; + nn = (Token) input.LT(1); + if((input.LA(1) >= Identifier && input.LA(1) <= JavaIdentifier)) + { + input.consume(); + errorRecovery = false; + failed = false; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + MismatchedSetException mse = + new MismatchedSetException(null, input); + recoverFromMismatchedSet(input, mse, FOLLOW_set_in_symbol292); + throw mse; + } + + if(backtracking == 0) + { + val = new Symbol(ns.getText(), nn.getText()); + } + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:139:3: dd= DotDot + { + dd = (Token) input.LT(1); + match(input, DotDot, FOLLOW_DotDot_in_symbol306); + if(failed) return val; + if(backtracking == 0) + { + val = DOTDOT; + } + + } + break; + + } + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 6, symbol_StartIndex); + } + } + return val; +} +// $ANTLR end symbol + +// $ANTLR start keyword +// /Users/rich/dev/clojure/src/jvm/Reader.g:142:1: keyword returns [Keyword val] : ':' s= symbol ; + +public final Keyword keyword() throws RecognitionException{ + Keyword val = null; + int keyword_StartIndex = input.index(); + Symbol s = null; + + + try + { + if(backtracking > 0 && alreadyParsedRule(input, 7)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:143:3: ( ':' s= symbol ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:143:3: ':' s= symbol + { + match(input, 35, FOLLOW_35_in_keyword322); + if(failed) return val; + pushFollow(FOLLOW_symbol_in_keyword328); + s = symbol(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = new Keyword(s); + } + + } + + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 7, keyword_StartIndex); + } + } + return val; +} +// $ANTLR end keyword + +// $ANTLR start literal +// /Users/rich/dev/clojure/src/jvm/Reader.g:147: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, 8)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:148:6: (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral ) + int alt5 = 7; + switch(input.LA(1)) + { + case HexLiteral: + case OctalLiteral: + { + alt5 = 1; + } + break; + case DecimalLiteral: + { + int LA5_2 = input.LA(2); + + if((LA5_2 == 34)) + { + alt5 = 7; + } + else if((LA5_2 == EOF || (LA5_2 >= Identifier && LA5_2 <= OctalLiteral) || LA5_2 == Comma || + (LA5_2 >= 28 && LA5_2 <= 33) || (LA5_2 >= 35 && LA5_2 <= 36))) + { + alt5 = 1; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "147:1: literal returns [Object val] : (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral );", + 5, 2, input); + + throw nvae; + } + } + break; + case FloatingPointLiteral: + { + alt5 = 2; + } + break; + case CharacterLiteral: + { + alt5 = 3; + } + break; + case StringLiteral: + { + alt5 = 4; + } + break; + case TrueToken: + { + alt5 = 5; + } + break; + case NullToken: + { + alt5 = 6; + } + break; + default: + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "147:1: literal returns [Object val] : (i= integerLiteral | fp= FloatingPointLiteral | c= CharacterLiteral | s= StringLiteral | TrueToken | NullToken | r= ratioLiteral );", + 5, 0, input); + + throw nvae; + } + + switch(alt5) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:148:6: i= integerLiteral + { + pushFollow(FOLLOW_integerLiteral_in_literal355); + i = integerLiteral(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = i; + } + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:149:6: fp= FloatingPointLiteral + { + fp = (Token) input.LT(1); + match(input, FloatingPointLiteral, FOLLOW_FloatingPointLiteral_in_literal368); + 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:150:6: c= CharacterLiteral + { + c = (Token) input.LT(1); + match(input, CharacterLiteral, FOLLOW_CharacterLiteral_in_literal381); + if(failed) return val; + if(backtracking == 0) + { + val = c.getText().charAt(0); + } + + } + break; + case 4: + // /Users/rich/dev/clojure/src/jvm/Reader.g:151:6: s= StringLiteral + { + s = (Token) input.LT(1); + match(input, StringLiteral, FOLLOW_StringLiteral_in_literal394); + 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:152:6: TrueToken + { + match(input, TrueToken, FOLLOW_TrueToken_in_literal403); + if(failed) return val; + if(backtracking == 0) + { + val = Boolean.TRUE; + } + + } + break; + case 6: + // /Users/rich/dev/clojure/src/jvm/Reader.g:153:6: NullToken + { + match(input, NullToken, FOLLOW_NullToken_in_literal412); + if(failed) return val; + if(backtracking == 0) + { + val = null; + } + + } + break; + case 7: + // /Users/rich/dev/clojure/src/jvm/Reader.g:154:6: r= ratioLiteral + { + pushFollow(FOLLOW_ratioLiteral_in_literal425); + r = ratioLiteral(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = r; + } + + } + break; + + } + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 8, literal_StartIndex); + } + } + return val; +} +// $ANTLR end literal + +// $ANTLR start ratioLiteral +// /Users/rich/dev/clojure/src/jvm/Reader.g:157: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, 9)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:158:4: (n= DecimalLiteral '/' d= DecimalLiteral ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:158:4: n= DecimalLiteral '/' d= DecimalLiteral + { + n = (Token) input.LT(1); + match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_ratioLiteral448); + if(failed) return val; + match(input, 34, FOLLOW_34_in_ratioLiteral450); + if(failed) return val; + d = (Token) input.LT(1); + match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_ratioLiteral456); + 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, 9, ratioLiteral_StartIndex); + } + } + return val; +} +// $ANTLR end ratioLiteral + +// $ANTLR start integerLiteral +// /Users/rich/dev/clojure/src/jvm/Reader.g:161: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, 10)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:162:9: (hn= HexLiteral | on= OctalLiteral | nn= DecimalLiteral ) + int alt6 = 3; + switch(input.LA(1)) + { + case HexLiteral: + { + alt6 = 1; + } + break; + case OctalLiteral: + { + alt6 = 2; + } + break; + case DecimalLiteral: + { + alt6 = 3; + } + break; + default: + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "161:1: integerLiteral returns [Num val] : (hn= HexLiteral | on= OctalLiteral | nn= DecimalLiteral );", + 6, 0, input); + + throw nvae; + } + + switch(alt6) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:162:9: hn= HexLiteral + { + hn = (Token) input.LT(1); + match(input, HexLiteral, FOLLOW_HexLiteral_in_integerLiteral482); + 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:163:9: on= OctalLiteral + { + on = (Token) input.LT(1); + match(input, OctalLiteral, FOLLOW_OctalLiteral_in_integerLiteral501); + 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:164:9: nn= DecimalLiteral + { + nn = (Token) input.LT(1); + match(input, DecimalLiteral, FOLLOW_DecimalLiteral_in_integerLiteral519); + 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, 10, integerLiteral_StartIndex); + } + } + return val; +} +// $ANTLR end integerLiteral + +// $ANTLR start metaTag +// /Users/rich/dev/clojure/src/jvm/Reader.g:169: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, 11)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:171:3: ( '#^' s= symbol | '#^' m= mapExpression ) + int alt7 = 2; + int LA7_0 = input.LA(1); + + if((LA7_0 == 36)) + { + int LA7_1 = input.LA(2); + + if((LA7_1 == 32)) + { + alt7 = 2; + } + else if(((LA7_1 >= Identifier && LA7_1 <= DotDot))) + { + alt7 = 1; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "169:1: fragment metaTag returns [IPersistentMap val] : ( '#^' s= symbol | '#^' m= mapExpression );", + 7, 1, input); + + throw nvae; + } + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "169:1: fragment metaTag returns [IPersistentMap val] : ( '#^' s= symbol | '#^' m= mapExpression );", + 7, 0, input); + + throw nvae; + } + switch(alt7) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:171:3: '#^' s= symbol + { + match(input, 36, FOLLOW_36_in_metaTag542); + if(failed) return val; + pushFollow(FOLLOW_symbol_in_metaTag548); + 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:172:3: '#^' m= mapExpression + { + match(input, 36, FOLLOW_36_in_metaTag554); + if(failed) return val; + pushFollow(FOLLOW_mapExpression_in_metaTag560); + m = mapExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = m; + } + + } + break; + + } + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 11, metaTag_StartIndex); + } + } + return val; +} +// $ANTLR end metaTag + +// $ANTLR start objExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:175: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, 12)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:177:3: (s= symbol | le= listExpression | me= mapExpression | ve= vectorExpression ) + int alt8 = 4; + switch(input.LA(1)) + { + case Identifier: + case JavaIdentifier: + case DotDot: + { + alt8 = 1; + } + break; + case 28: + { + alt8 = 2; + } + break; + case 32: + { + alt8 = 3; + } + break; + case 30: + { + alt8 = 4; + } + break; + default: + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "175:1: fragment objExpression returns [Obj val] : (s= symbol | le= listExpression | me= mapExpression | ve= vectorExpression );", + 8, 0, input); + + throw nvae; + } + + switch(alt8) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:177:3: s= symbol + { + pushFollow(FOLLOW_symbol_in_objExpression583); + s = symbol(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = s; + } + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:178:3: le= listExpression + { + pushFollow(FOLLOW_listExpression_in_objExpression593); + le = listExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = (Obj) le; + } + + } + break; + case 3: + // /Users/rich/dev/clojure/src/jvm/Reader.g:179:3: me= mapExpression + { + pushFollow(FOLLOW_mapExpression_in_objExpression603); + me = mapExpression(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = (Obj) me; + } + + } + break; + case 4: + // /Users/rich/dev/clojure/src/jvm/Reader.g:180:3: ve= vectorExpression + { + pushFollow(FOLLOW_vectorExpression_in_objExpression613); + 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, 12, objExpression_StartIndex); + } + } + return val; +} +// $ANTLR end objExpression + +// $ANTLR start metaExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:183: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, 13)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:184:3: (m= metaTag e= objExpression ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:184:3: m= metaTag e= objExpression + { + pushFollow(FOLLOW_metaTag_in_metaExpression635); + m = metaTag(); + _fsp--; + if(failed) return val; + pushFollow(FOLLOW_objExpression_in_metaExpression641); + 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, 13, metaExpression_StartIndex); + } + } + return val; +} +// $ANTLR end metaExpression + +// $ANTLR start member +// /Users/rich/dev/clojure/src/jvm/Reader.g:187:1: fragment member returns [Object val] : ( '.' i= JavaIdentifier | '.' 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, 14)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:189:4: ( '.' i= JavaIdentifier | '.' m= method ) + int alt9 = 2; + int LA9_0 = input.LA(1); + + if((LA9_0 == 37)) + { + int LA9_1 = input.LA(2); + + if((LA9_1 == JavaIdentifier)) + { + alt9 = 1; + } + else if((LA9_1 == MethodIdentifier)) + { + alt9 = 2; + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "187:1: fragment member returns [Object val] : ( '.' i= JavaIdentifier | '.' m= method );", + 9, 1, input); + + throw nvae; + } + } + else + { + if(backtracking > 0) + { + failed = true; + return val; + } + NoViableAltException nvae = + new NoViableAltException( + "187:1: fragment member returns [Object val] : ( '.' i= JavaIdentifier | '.' m= method );", + 9, 0, input); + + throw nvae; + } + switch(alt9) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:189:4: '.' i= JavaIdentifier + { + match(input, 37, FOLLOW_37_in_member661); + if(failed) return val; + i = (Token) input.LT(1); + match(input, JavaIdentifier, FOLLOW_JavaIdentifier_in_member667); + if(failed) return val; + if(backtracking == 0) + { + val = new Symbol(i.getText()); + } + + } + break; + case 2: + // /Users/rich/dev/clojure/src/jvm/Reader.g:190:4: '.' m= method + { + match(input, 37, FOLLOW_37_in_member674); + if(failed) return val; + pushFollow(FOLLOW_method_in_member680); + m = method(); + _fsp--; + if(failed) return val; + if(backtracking == 0) + { + val = m; + } + + } + break; + + } + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 14, member_StartIndex); + } + } + return val; +} +// $ANTLR end member + +// $ANTLR start method +// /Users/rich/dev/clojure/src/jvm/Reader.g:193: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, 15)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:195:4: (i= MethodIdentifier (es= args )? ')' ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:195:4: i= MethodIdentifier (es= args )? ')' + { + i = (Token) input.LT(1); + match(input, MethodIdentifier, FOLLOW_MethodIdentifier_in_method705); + if(failed) return val; + // /Users/rich/dev/clojure/src/jvm/Reader.g:195:28: (es= args )? + int alt10 = 2; + int LA10_0 = input.LA(1); + + if(((LA10_0 >= Identifier && LA10_0 <= OctalLiteral) || LA10_0 == 28 || LA10_0 == 30 || LA10_0 == 32 || + (LA10_0 >= 35 && LA10_0 <= 36))) + { + alt10 = 1; + } + switch(alt10) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: es= args + { + pushFollow(FOLLOW_args_in_method711); + es = args(); + _fsp--; + if(failed) return val; + + } + break; + + } + + match(input, 29, FOLLOW_29_in_method714); + if(failed) return val; + if(backtracking == 0) + { + val = RT.cons(new Symbol(i.getText().substring(0, i.getText().length() - 1)), es); + } + + } + + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 15, method_StartIndex); + } + } + return val; +} +// $ANTLR end method + +// $ANTLR start args +// /Users/rich/dev/clojure/src/jvm/Reader.g:198: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, 16)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:202:4: (e1= expression ( Comma e= expression )* ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:202:4: e1= expression ( Comma e= expression )* + { + pushFollow(FOLLOW_expression_in_args740); + e1 = expression(); + _fsp--; + if(failed) return val; + // /Users/rich/dev/clojure/src/jvm/Reader.g:202:21: ( Comma e= expression )* + loop11: + do + { + int alt11 = 2; + int LA11_0 = input.LA(1); + + if((LA11_0 == Comma)) + { + alt11 = 1; + } + + + switch(alt11) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:202:22: Comma e= expression + { + match(input, Comma, FOLLOW_Comma_in_args744); + if(failed) return val; + pushFollow(FOLLOW_expression_in_args750); + 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 loop11; + } + } 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, 16, args_StartIndex); + } + } + return val; +} +// $ANTLR end args + +// $ANTLR start dotExpression +// /Users/rich/dev/clojure/src/jvm/Reader.g:205:1: dotExpression returns [Object val] : s= symbol (e= member )+ ; + +public final Object dotExpression() throws RecognitionException{ + Object val = null; + int dotExpression_StartIndex = input.index(); + Symbol s = null; + + Object e = null; + + + List es = null; + + try + { + if(backtracking > 0 && alreadyParsedRule(input, 17)) + { + return val; + } + // /Users/rich/dev/clojure/src/jvm/Reader.g:209:3: (s= symbol (e= member )+ ) + // /Users/rich/dev/clojure/src/jvm/Reader.g:209:3: s= symbol (e= member )+ + { + pushFollow(FOLLOW_symbol_in_dotExpression779); + s = symbol(); + _fsp--; + if(failed) return val; + // /Users/rich/dev/clojure/src/jvm/Reader.g:209:16: (e= member )+ + int cnt12 = 0; + loop12: + do + { + int alt12 = 2; + int LA12_0 = input.LA(1); + + if((LA12_0 == 37)) + { + alt12 = 1; + } + + + switch(alt12) + { + case 1: + // /Users/rich/dev/clojure/src/jvm/Reader.g:0:0: e= member + { + pushFollow(FOLLOW_member_in_dotExpression785); + 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(cnt12 >= 1) break loop12; + if(backtracking > 0) + { + failed = true; + return val; + } + EarlyExitException eee = + new EarlyExitException(12, input); + throw eee; + } + cnt12++; + } while(true); + + if(backtracking == 0) + { + val = RT.listStar(DOTDOT, s, RT.seq(es)); + } + + } + + } + + catch(RecognitionException exc) + { + throw exc; + } + finally + { + if(backtracking > 0) + { + memoize(input, 17, dotExpression_StartIndex); + } + } + return val; +} +// $ANTLR end dotExpression + + +public static final BitSet FOLLOW_literal_in_expression73 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_symbol_in_expression83 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_keyword_in_expression93 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_listExpression_in_expression103 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_vectorExpression_in_expression113 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_mapExpression_in_expression123 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_metaExpression_in_expression133 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_dotExpression_in_expression143 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_28_in_listExpression160 = new BitSet(new long[]{0x0000001970007FF0L}); +public static final BitSet FOLLOW_expressions_in_listExpression167 = new BitSet(new long[]{0x0000000020000000L}); +public static final BitSet FOLLOW_29_in_listExpression169 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_expression_in_expressions191 = new BitSet(new long[]{0x0000001950007FF2L}); +public static final BitSet FOLLOW_30_in_vectorExpression208 = new BitSet(new long[]{0x00000019D0007FF0L}); +public static final BitSet FOLLOW_expressions_in_vectorExpression214 = new BitSet(new long[]{0x0000000080000000L}); +public static final BitSet FOLLOW_31_in_vectorExpression216 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_32_in_mapExpression236 = new BitSet(new long[]{0x0000001B50007FF0L}); +public static final BitSet FOLLOW_expression_in_mapExpression241 = new BitSet(new long[]{0x0000001950007FF0L}); +public static final BitSet FOLLOW_expression_in_mapExpression245 = new BitSet(new long[]{0x0000001B50007FF0L}); +public static final BitSet FOLLOW_33_in_mapExpression249 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_set_in_symbol266 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_set_in_symbol280 = new BitSet(new long[]{0x0000000400000000L}); +public static final BitSet FOLLOW_34_in_symbol286 = new BitSet(new long[]{0x0000000000000030L}); +public static final BitSet FOLLOW_set_in_symbol292 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_DotDot_in_symbol306 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_35_in_keyword322 = new BitSet(new long[]{0x0000000000000070L}); +public static final BitSet FOLLOW_symbol_in_keyword328 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_integerLiteral_in_literal355 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_FloatingPointLiteral_in_literal368 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_CharacterLiteral_in_literal381 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_StringLiteral_in_literal394 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_TrueToken_in_literal403 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_NullToken_in_literal412 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_ratioLiteral_in_literal425 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_DecimalLiteral_in_ratioLiteral448 = new BitSet(new long[]{0x0000000400000000L}); +public static final BitSet FOLLOW_34_in_ratioLiteral450 = new BitSet(new long[]{0x0000000000001000L}); +public static final BitSet FOLLOW_DecimalLiteral_in_ratioLiteral456 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_HexLiteral_in_integerLiteral482 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_OctalLiteral_in_integerLiteral501 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_DecimalLiteral_in_integerLiteral519 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_36_in_metaTag542 = new BitSet(new long[]{0x0000000000000070L}); +public static final BitSet FOLLOW_symbol_in_metaTag548 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_36_in_metaTag554 = new BitSet(new long[]{0x0000000100000000L}); +public static final BitSet FOLLOW_mapExpression_in_metaTag560 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_symbol_in_objExpression583 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_listExpression_in_objExpression593 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_mapExpression_in_objExpression603 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_vectorExpression_in_objExpression613 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_metaTag_in_metaExpression635 = new BitSet(new long[]{0x0000000150000070L}); +public static final BitSet FOLLOW_objExpression_in_metaExpression641 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_37_in_member661 = new BitSet(new long[]{0x0000000000000020L}); +public static final BitSet FOLLOW_JavaIdentifier_in_member667 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_37_in_member674 = new BitSet(new long[]{0x0000000000008000L}); +public static final BitSet FOLLOW_method_in_member680 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_MethodIdentifier_in_method705 = new BitSet(new long[]{0x0000001970007FF0L}); +public static final BitSet FOLLOW_args_in_method711 = new BitSet(new long[]{0x0000000020000000L}); +public static final BitSet FOLLOW_29_in_method714 = new BitSet(new long[]{0x0000000000000002L}); +public static final BitSet FOLLOW_expression_in_args740 = new BitSet(new long[]{0x0000000000010002L}); +public static final BitSet FOLLOW_Comma_in_args744 = new BitSet(new long[]{0x0000001950007FF0L}); +public static final BitSet FOLLOW_expression_in_args750 = new BitSet(new long[]{0x0000000000010002L}); +public static final BitSet FOLLOW_symbol_in_dotExpression779 = new BitSet(new long[]{0x0000002000000000L}); +public static final BitSet FOLLOW_member_in_dotExpression785 = new BitSet(new long[]{0x0000002000000002L}); + +}
\ No newline at end of file |