3 package com
.google
.appengine
.api
.search
;
5 import org
.antlr
.runtime
.*;
7 import org
.antlr
.runtime
.tree
.*;
9 public class ExpressionParser
extends Parser
{
10 public static final String
[] tokenNames
= new String
[] {
11 "<invalid>", "<EOR>", "<DOWN>", "<UP>", "NEG", "INDEX", "FN", "LT", "LE", "GT", "GE", "EQ", "NE", "PLUS", "MINUS", "TIMES", "DIV", "LPAREN", "RPAREN", "LSQUARE", "INT", "RSQUARE", "NAME", "FLOAT", "PHRASE", "DIGIT", "QUOTE", "ESC_SEQ", "EXPONENT", "NAME_START", "WS", "ASCII_LETTER", "UNDERSCORE", "DOLLAR", "HEX_DIGIT", "UNICODE_ESC", "OCTAL_ESC", "'.'", "','", "'abs'", "'count'", "'distance'", "'geopoint'", "'if'", "'len'", "'log'", "'max'", "'min'", "'pow'", "'snippet'"
13 public static final int DOLLAR
=33;
14 public static final int LT
=7;
15 public static final int EXPONENT
=28;
16 public static final int LSQUARE
=19;
17 public static final int ASCII_LETTER
=31;
18 public static final int OCTAL_ESC
=36;
19 public static final int FLOAT
=23;
20 public static final int NAME_START
=29;
21 public static final int EOF
=-1;
22 public static final int LPAREN
=17;
23 public static final int INDEX
=5;
24 public static final int RPAREN
=18;
25 public static final int QUOTE
=26;
26 public static final int NAME
=22;
27 public static final int ESC_SEQ
=27;
28 public static final int PLUS
=13;
29 public static final int DIGIT
=25;
30 public static final int EQ
=11;
31 public static final int NE
=12;
32 public static final int T__42
=42;
33 public static final int T__43
=43;
34 public static final int T__40
=40;
35 public static final int GE
=10;
36 public static final int T__41
=41;
37 public static final int T__46
=46;
38 public static final int T__47
=47;
39 public static final int T__44
=44;
40 public static final int T__45
=45;
41 public static final int T__48
=48;
42 public static final int T__49
=49;
43 public static final int UNICODE_ESC
=35;
44 public static final int HEX_DIGIT
=34;
45 public static final int UNDERSCORE
=32;
46 public static final int INT
=20;
47 public static final int FN
=6;
48 public static final int MINUS
=14;
49 public static final int RSQUARE
=21;
50 public static final int PHRASE
=24;
51 public static final int WS
=30;
52 public static final int T__37
=37;
53 public static final int T__38
=38;
54 public static final int T__39
=39;
55 public static final int NEG
=4;
56 public static final int GT
=9;
57 public static final int DIV
=16;
58 public static final int TIMES
=15;
59 public static final int LE
=8;
61 public ExpressionParser(TokenStream input
) {
62 this(input
, new RecognizerSharedState());
64 public ExpressionParser(TokenStream input
, RecognizerSharedState state
) {
69 protected TreeAdaptor adaptor
= new CommonTreeAdaptor();
71 public void setTreeAdaptor(TreeAdaptor adaptor
) {
72 this.adaptor
= adaptor
;
74 public TreeAdaptor
getTreeAdaptor() {
78 public String
[] getTokenNames() { return ExpressionParser
.tokenNames
; }
79 public String
getGrammarFileName() { return "java/com/google/appengine/api/search/Expression.g"; }
82 public Object
recoverFromMismatchedSet(IntStream input
,
83 RecognitionException e
, BitSet follow
) throws RecognitionException
{
88 protected Object
recoverFromMismatchedToken(
89 IntStream input
, int ttype
, BitSet follow
) throws RecognitionException
{
90 throw new MismatchedTokenException(ttype
, input
);
93 public static class expression_return
extends ParserRuleReturnScope
{
95 public Object
getTree() { return tree
; }
98 public final ExpressionParser
.expression_return
expression() throws RecognitionException
{
99 ExpressionParser
.expression_return retval
= new ExpressionParser
.expression_return();
100 retval
.start
= input
.LT(1);
102 CommonTree root_0
= null;
105 ExpressionParser
.cmpExpr_return cmpExpr1
= null;
107 CommonTree EOF2_tree
=null;
111 root_0
= (CommonTree
)adaptor
.nil();
113 pushFollow(FOLLOW_cmpExpr_in_expression87
);
118 adaptor
.addChild(root_0
, cmpExpr1
.getTree());
119 EOF2
=(Token
)match(input
,EOF
,FOLLOW_EOF_in_expression89
);
120 EOF2_tree
= (CommonTree
)adaptor
.create(EOF2
);
121 adaptor
.addChild(root_0
, EOF2_tree
);
125 retval
.stop
= input
.LT(-1);
127 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
128 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
132 catch (RecognitionException e
) {
141 public static class cmpExpr_return
extends ParserRuleReturnScope
{
143 public Object
getTree() { return tree
; }
146 public final ExpressionParser
.cmpExpr_return
cmpExpr() throws RecognitionException
{
147 ExpressionParser
.cmpExpr_return retval
= new ExpressionParser
.cmpExpr_return();
148 retval
.start
= input
.LT(1);
150 CommonTree root_0
= null;
152 ExpressionParser
.addExpr_return addExpr3
= null;
154 ExpressionParser
.cmpOp_return cmpOp4
= null;
156 ExpressionParser
.addExpr_return addExpr5
= null;
160 root_0
= (CommonTree
)adaptor
.nil();
162 pushFollow(FOLLOW_addExpr_in_cmpExpr102
);
167 adaptor
.addChild(root_0
, addExpr3
.getTree());
169 int LA1_0
= input
.LA(1);
171 if ( ((LA1_0
>=LT
&& LA1_0
<=NE
)) ) {
177 pushFollow(FOLLOW_cmpOp_in_cmpExpr105
);
182 root_0
= (CommonTree
)adaptor
.becomeRoot(cmpOp4
.getTree(), root_0
);
183 pushFollow(FOLLOW_addExpr_in_cmpExpr108
);
188 adaptor
.addChild(root_0
, addExpr5
.getTree());
197 retval
.stop
= input
.LT(-1);
199 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
200 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
204 catch (RecognitionException e
) {
213 public static class cmpOp_return
extends ParserRuleReturnScope
{
215 public Object
getTree() { return tree
; }
218 public final ExpressionParser
.cmpOp_return
cmpOp() throws RecognitionException
{
219 ExpressionParser
.cmpOp_return retval
= new ExpressionParser
.cmpOp_return();
220 retval
.start
= input
.LT(1);
222 CommonTree root_0
= null;
226 CommonTree set6_tree
=null;
230 root_0
= (CommonTree
)adaptor
.nil();
232 set6
=(Token
)input
.LT(1);
233 if ( (input
.LA(1)>=LT
&& input
.LA(1)<=NE
) ) {
235 adaptor
.addChild(root_0
, (CommonTree
)adaptor
.create(set6
));
236 state
.errorRecovery
=false;
239 MismatchedSetException mse
= new MismatchedSetException(null,input
);
245 retval
.stop
= input
.LT(-1);
247 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
248 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
252 catch (RecognitionException e
) {
261 public static class addExpr_return
extends ParserRuleReturnScope
{
263 public Object
getTree() { return tree
; }
266 public final ExpressionParser
.addExpr_return
addExpr() throws RecognitionException
{
267 ExpressionParser
.addExpr_return retval
= new ExpressionParser
.addExpr_return();
268 retval
.start
= input
.LT(1);
270 CommonTree root_0
= null;
272 ExpressionParser
.multExpr_return multExpr7
= null;
274 ExpressionParser
.addOp_return addOp8
= null;
276 ExpressionParser
.multExpr_return multExpr9
= null;
280 root_0
= (CommonTree
)adaptor
.nil();
282 pushFollow(FOLLOW_multExpr_in_addExpr166
);
283 multExpr7
=multExpr();
287 adaptor
.addChild(root_0
, multExpr7
.getTree());
291 int LA2_0
= input
.LA(1);
293 if ( ((LA2_0
>=PLUS
&& LA2_0
<=MINUS
)) ) {
300 pushFollow(FOLLOW_addOp_in_addExpr169
);
305 root_0
= (CommonTree
)adaptor
.becomeRoot(addOp8
.getTree(), root_0
);
306 pushFollow(FOLLOW_multExpr_in_addExpr172
);
307 multExpr9
=multExpr();
311 adaptor
.addChild(root_0
, multExpr9
.getTree());
323 retval
.stop
= input
.LT(-1);
325 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
326 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
330 catch (RecognitionException e
) {
339 public static class addOp_return
extends ParserRuleReturnScope
{
341 public Object
getTree() { return tree
; }
344 public final ExpressionParser
.addOp_return
addOp() throws RecognitionException
{
345 ExpressionParser
.addOp_return retval
= new ExpressionParser
.addOp_return();
346 retval
.start
= input
.LT(1);
348 CommonTree root_0
= null;
352 CommonTree set10_tree
=null;
356 root_0
= (CommonTree
)adaptor
.nil();
358 set10
=(Token
)input
.LT(1);
359 if ( (input
.LA(1)>=PLUS
&& input
.LA(1)<=MINUS
) ) {
361 adaptor
.addChild(root_0
, (CommonTree
)adaptor
.create(set10
));
362 state
.errorRecovery
=false;
365 MismatchedSetException mse
= new MismatchedSetException(null,input
);
371 retval
.stop
= input
.LT(-1);
373 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
374 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
378 catch (RecognitionException e
) {
387 public static class multExpr_return
extends ParserRuleReturnScope
{
389 public Object
getTree() { return tree
; }
392 public final ExpressionParser
.multExpr_return
multExpr() throws RecognitionException
{
393 ExpressionParser
.multExpr_return retval
= new ExpressionParser
.multExpr_return();
394 retval
.start
= input
.LT(1);
396 CommonTree root_0
= null;
398 ExpressionParser
.unary_return unary11
= null;
400 ExpressionParser
.multOp_return multOp12
= null;
402 ExpressionParser
.unary_return unary13
= null;
406 root_0
= (CommonTree
)adaptor
.nil();
408 pushFollow(FOLLOW_unary_in_multExpr206
);
413 adaptor
.addChild(root_0
, unary11
.getTree());
417 int LA3_0
= input
.LA(1);
419 if ( ((LA3_0
>=TIMES
&& LA3_0
<=DIV
)) ) {
426 pushFollow(FOLLOW_multOp_in_multExpr209
);
431 root_0
= (CommonTree
)adaptor
.becomeRoot(multOp12
.getTree(), root_0
);
432 pushFollow(FOLLOW_unary_in_multExpr212
);
437 adaptor
.addChild(root_0
, unary13
.getTree());
449 retval
.stop
= input
.LT(-1);
451 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
452 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
456 catch (RecognitionException e
) {
465 public static class multOp_return
extends ParserRuleReturnScope
{
467 public Object
getTree() { return tree
; }
470 public final ExpressionParser
.multOp_return
multOp() throws RecognitionException
{
471 ExpressionParser
.multOp_return retval
= new ExpressionParser
.multOp_return();
472 retval
.start
= input
.LT(1);
474 CommonTree root_0
= null;
478 CommonTree set14_tree
=null;
482 root_0
= (CommonTree
)adaptor
.nil();
484 set14
=(Token
)input
.LT(1);
485 if ( (input
.LA(1)>=TIMES
&& input
.LA(1)<=DIV
) ) {
487 adaptor
.addChild(root_0
, (CommonTree
)adaptor
.create(set14
));
488 state
.errorRecovery
=false;
491 MismatchedSetException mse
= new MismatchedSetException(null,input
);
497 retval
.stop
= input
.LT(-1);
499 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
500 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
504 catch (RecognitionException e
) {
513 public static class unary_return
extends ParserRuleReturnScope
{
515 public Object
getTree() { return tree
; }
518 public final ExpressionParser
.unary_return
unary() throws RecognitionException
{
519 ExpressionParser
.unary_return retval
= new ExpressionParser
.unary_return();
520 retval
.start
= input
.LT(1);
522 CommonTree root_0
= null;
525 ExpressionParser
.atom_return atom16
= null;
527 ExpressionParser
.atom_return atom17
= null;
529 CommonTree MINUS15_tree
=null;
530 RewriteRuleTokenStream stream_MINUS
=new RewriteRuleTokenStream(adaptor
,"token MINUS");
531 RewriteRuleSubtreeStream stream_atom
=new RewriteRuleSubtreeStream(adaptor
,"rule atom");
534 int LA4_0
= input
.LA(1);
536 if ( (LA4_0
==MINUS
) ) {
539 else if ( (LA4_0
==LPAREN
||LA4_0
==INT
||(LA4_0
>=NAME
&& LA4_0
<=PHRASE
)||(LA4_0
>=39 && LA4_0
<=49)) ) {
543 NoViableAltException nvae
=
544 new NoViableAltException("", 4, 0, input
);
551 MINUS15
=(Token
)match(input
,MINUS
,FOLLOW_MINUS_in_unary246
);
552 stream_MINUS
.add(MINUS15
);
554 pushFollow(FOLLOW_atom_in_unary248
);
559 stream_atom
.add(atom16
.getTree());
561 retval
.tree
= root_0
;
562 RewriteRuleSubtreeStream stream_retval
=new RewriteRuleSubtreeStream(adaptor
,"rule retval",retval
!=null?retval
.tree
:null);
564 root_0
= (CommonTree
)adaptor
.nil();
567 CommonTree root_1
= (CommonTree
)adaptor
.nil();
568 root_1
= (CommonTree
)adaptor
.becomeRoot((CommonTree
)adaptor
.create(NEG
, "-"), root_1
);
570 adaptor
.addChild(root_1
, stream_atom
.nextTree());
572 adaptor
.addChild(root_0
, root_1
);
577 retval
.tree
= root_0
;
582 root_0
= (CommonTree
)adaptor
.nil();
584 pushFollow(FOLLOW_atom_in_unary263
);
589 adaptor
.addChild(root_0
, atom17
.getTree());
595 retval
.stop
= input
.LT(-1);
597 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
598 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
602 catch (RecognitionException e
) {
611 public static class atom_return
extends ParserRuleReturnScope
{
613 public Object
getTree() { return tree
; }
616 public final ExpressionParser
.atom_return
atom() throws RecognitionException
{
617 ExpressionParser
.atom_return retval
= new ExpressionParser
.atom_return();
618 retval
.start
= input
.LT(1);
620 CommonTree root_0
= null;
624 ExpressionParser
.var_return var18
= null;
626 ExpressionParser
.num_return num19
= null;
628 ExpressionParser
.str_return str20
= null;
630 ExpressionParser
.fn_return fn21
= null;
632 ExpressionParser
.addExpr_return addExpr23
= null;
634 CommonTree LPAREN22_tree
=null;
635 CommonTree RPAREN24_tree
=null;
636 RewriteRuleTokenStream stream_RPAREN
=new RewriteRuleTokenStream(adaptor
,"token RPAREN");
637 RewriteRuleTokenStream stream_LPAREN
=new RewriteRuleTokenStream(adaptor
,"token LPAREN");
638 RewriteRuleSubtreeStream stream_addExpr
=new RewriteRuleSubtreeStream(adaptor
,"rule addExpr");
641 switch ( input
.LA(1) ) {
679 NoViableAltException nvae
=
680 new NoViableAltException("", 5, 0, input
);
688 root_0
= (CommonTree
)adaptor
.nil();
690 pushFollow(FOLLOW_var_in_atom276
);
695 adaptor
.addChild(root_0
, var18
.getTree());
701 root_0
= (CommonTree
)adaptor
.nil();
703 pushFollow(FOLLOW_num_in_atom282
);
708 adaptor
.addChild(root_0
, num19
.getTree());
714 root_0
= (CommonTree
)adaptor
.nil();
716 pushFollow(FOLLOW_str_in_atom288
);
721 adaptor
.addChild(root_0
, str20
.getTree());
727 root_0
= (CommonTree
)adaptor
.nil();
729 pushFollow(FOLLOW_fn_in_atom294
);
734 adaptor
.addChild(root_0
, fn21
.getTree());
740 LPAREN22
=(Token
)match(input
,LPAREN
,FOLLOW_LPAREN_in_atom300
);
741 stream_LPAREN
.add(LPAREN22
);
743 pushFollow(FOLLOW_addExpr_in_atom302
);
748 stream_addExpr
.add(addExpr23
.getTree());
749 RPAREN24
=(Token
)match(input
,RPAREN
,FOLLOW_RPAREN_in_atom304
);
750 stream_RPAREN
.add(RPAREN24
);
752 retval
.tree
= root_0
;
753 RewriteRuleSubtreeStream stream_retval
=new RewriteRuleSubtreeStream(adaptor
,"rule retval",retval
!=null?retval
.tree
:null);
755 root_0
= (CommonTree
)adaptor
.nil();
757 adaptor
.addChild(root_0
, stream_addExpr
.nextTree());
761 retval
.tree
= root_0
;
766 retval
.stop
= input
.LT(-1);
768 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
769 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
773 catch (RecognitionException e
) {
782 public static class var_return
extends ParserRuleReturnScope
{
784 public Object
getTree() { return tree
; }
787 public final ExpressionParser
.var_return
var() throws RecognitionException
{
788 ExpressionParser
.var_return retval
= new ExpressionParser
.var_return();
789 retval
.start
= input
.LT(1);
791 CommonTree root_0
= null;
793 ExpressionParser
.name_return name25
= null;
795 ExpressionParser
.name_return name26
= null;
797 ExpressionParser
.index_return index27
= null;
799 RewriteRuleSubtreeStream stream_index
=new RewriteRuleSubtreeStream(adaptor
,"rule index");
800 RewriteRuleSubtreeStream stream_name
=new RewriteRuleSubtreeStream(adaptor
,"rule name");
803 alt6
= dfa6
.predict(input
);
807 root_0
= (CommonTree
)adaptor
.nil();
809 pushFollow(FOLLOW_name_in_var321
);
814 adaptor
.addChild(root_0
, name25
.getTree());
820 pushFollow(FOLLOW_name_in_var327
);
825 stream_name
.add(name26
.getTree());
826 pushFollow(FOLLOW_index_in_var329
);
831 stream_index
.add(index27
.getTree());
833 retval
.tree
= root_0
;
834 RewriteRuleSubtreeStream stream_retval
=new RewriteRuleSubtreeStream(adaptor
,"rule retval",retval
!=null?retval
.tree
:null);
836 root_0
= (CommonTree
)adaptor
.nil();
839 CommonTree root_1
= (CommonTree
)adaptor
.nil();
840 root_1
= (CommonTree
)adaptor
.becomeRoot((CommonTree
)adaptor
.create(INDEX
, (index27
!=null?input
.toString(index27
.start
,index27
.stop
):null)), root_1
);
842 adaptor
.addChild(root_1
, stream_name
.nextTree());
844 adaptor
.addChild(root_0
, root_1
);
849 retval
.tree
= root_0
;
854 retval
.stop
= input
.LT(-1);
856 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
857 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
861 catch (RecognitionException e
) {
870 public static class index_return
extends ParserRuleReturnScope
{
872 public Object
getTree() { return tree
; }
875 public final ExpressionParser
.index_return
index() throws RecognitionException
{
876 ExpressionParser
.index_return retval
= new ExpressionParser
.index_return();
877 retval
.start
= input
.LT(1);
879 CommonTree root_0
= null;
882 Token LSQUARE28
=null;
883 Token RSQUARE29
=null;
885 CommonTree x_tree
=null;
886 CommonTree LSQUARE28_tree
=null;
887 CommonTree RSQUARE29_tree
=null;
888 RewriteRuleTokenStream stream_INT
=new RewriteRuleTokenStream(adaptor
,"token INT");
889 RewriteRuleTokenStream stream_LSQUARE
=new RewriteRuleTokenStream(adaptor
,"token LSQUARE");
890 RewriteRuleTokenStream stream_RSQUARE
=new RewriteRuleTokenStream(adaptor
,"token RSQUARE");
894 LSQUARE28
=(Token
)match(input
,LSQUARE
,FOLLOW_LSQUARE_in_index351
);
895 stream_LSQUARE
.add(LSQUARE28
);
897 x
=(Token
)match(input
,INT
,FOLLOW_INT_in_index355
);
900 RSQUARE29
=(Token
)match(input
,RSQUARE
,FOLLOW_RSQUARE_in_index357
);
901 stream_RSQUARE
.add(RSQUARE29
);
903 retval
.tree
= root_0
;
904 RewriteRuleTokenStream stream_x
=new RewriteRuleTokenStream(adaptor
,"token x",x
);
905 RewriteRuleSubtreeStream stream_retval
=new RewriteRuleSubtreeStream(adaptor
,"rule retval",retval
!=null?retval
.tree
:null);
907 root_0
= (CommonTree
)adaptor
.nil();
909 adaptor
.addChild(root_0
, stream_x
.nextNode());
913 retval
.tree
= root_0
;
916 retval
.stop
= input
.LT(-1);
918 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
919 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
923 catch (RecognitionException e
) {
932 public static class name_return
extends ParserRuleReturnScope
{
934 public Object
getTree() { return tree
; }
937 public final ExpressionParser
.name_return
name() throws RecognitionException
{
938 ExpressionParser
.name_return retval
= new ExpressionParser
.name_return();
939 retval
.start
= input
.LT(1);
941 CommonTree root_0
= null;
944 Token char_literal31
=null;
947 CommonTree NAME30_tree
=null;
948 CommonTree char_literal31_tree
=null;
949 CommonTree NAME32_tree
=null;
953 root_0
= (CommonTree
)adaptor
.nil();
955 NAME30
=(Token
)match(input
,NAME
,FOLLOW_NAME_in_name375
);
956 NAME30_tree
= (CommonTree
)adaptor
.create(NAME30
);
957 adaptor
.addChild(root_0
, NAME30_tree
);
962 int LA7_0
= input
.LA(1);
971 char_literal31
=(Token
)match(input
,37,FOLLOW_37_in_name378
);
972 char_literal31_tree
= (CommonTree
)adaptor
.create(char_literal31
);
973 root_0
= (CommonTree
)adaptor
.becomeRoot(char_literal31_tree
, root_0
);
975 NAME32
=(Token
)match(input
,NAME
,FOLLOW_NAME_in_name381
);
976 NAME32_tree
= (CommonTree
)adaptor
.create(NAME32
);
977 adaptor
.addChild(root_0
, NAME32_tree
);
989 retval
.stop
= input
.LT(-1);
991 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
992 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
996 catch (RecognitionException e
) {
1005 public static class num_return
extends ParserRuleReturnScope
{
1007 public Object
getTree() { return tree
; }
1010 public final ExpressionParser
.num_return
num() throws RecognitionException
{
1011 ExpressionParser
.num_return retval
= new ExpressionParser
.num_return();
1012 retval
.start
= input
.LT(1);
1014 CommonTree root_0
= null;
1018 CommonTree set33_tree
=null;
1022 root_0
= (CommonTree
)adaptor
.nil();
1024 set33
=(Token
)input
.LT(1);
1025 if ( input
.LA(1)==INT
||input
.LA(1)==FLOAT
) {
1027 adaptor
.addChild(root_0
, (CommonTree
)adaptor
.create(set33
));
1028 state
.errorRecovery
=false;
1031 MismatchedSetException mse
= new MismatchedSetException(null,input
);
1037 retval
.stop
= input
.LT(-1);
1039 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
1040 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
1044 catch (RecognitionException e
) {
1053 public static class str_return
extends ParserRuleReturnScope
{
1055 public Object
getTree() { return tree
; }
1058 public final ExpressionParser
.str_return
str() throws RecognitionException
{
1059 ExpressionParser
.str_return retval
= new ExpressionParser
.str_return();
1060 retval
.start
= input
.LT(1);
1062 CommonTree root_0
= null;
1064 Token PHRASE34
=null;
1066 CommonTree PHRASE34_tree
=null;
1070 root_0
= (CommonTree
)adaptor
.nil();
1072 PHRASE34
=(Token
)match(input
,PHRASE
,FOLLOW_PHRASE_in_str415
);
1073 PHRASE34_tree
= (CommonTree
)adaptor
.create(PHRASE34
);
1074 adaptor
.addChild(root_0
, PHRASE34_tree
);
1078 retval
.stop
= input
.LT(-1);
1080 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
1081 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
1085 catch (RecognitionException e
) {
1094 public static class fn_return
extends ParserRuleReturnScope
{
1096 public Object
getTree() { return tree
; }
1099 public final ExpressionParser
.fn_return
fn() throws RecognitionException
{
1100 ExpressionParser
.fn_return retval
= new ExpressionParser
.fn_return();
1101 retval
.start
= input
.LT(1);
1103 CommonTree root_0
= null;
1105 Token LPAREN36
=null;
1106 Token char_literal38
=null;
1107 Token RPAREN40
=null;
1108 ExpressionParser
.fnName_return fnName35
= null;
1110 ExpressionParser
.cmpExpr_return cmpExpr37
= null;
1112 ExpressionParser
.cmpExpr_return cmpExpr39
= null;
1114 CommonTree LPAREN36_tree
=null;
1115 CommonTree char_literal38_tree
=null;
1116 CommonTree RPAREN40_tree
=null;
1117 RewriteRuleTokenStream stream_RPAREN
=new RewriteRuleTokenStream(adaptor
,"token RPAREN");
1118 RewriteRuleTokenStream stream_LPAREN
=new RewriteRuleTokenStream(adaptor
,"token LPAREN");
1119 RewriteRuleTokenStream stream_38
=new RewriteRuleTokenStream(adaptor
,"token 38");
1120 RewriteRuleSubtreeStream stream_fnName
=new RewriteRuleSubtreeStream(adaptor
,"rule fnName");
1121 RewriteRuleSubtreeStream stream_cmpExpr
=new RewriteRuleSubtreeStream(adaptor
,"rule cmpExpr");
1124 pushFollow(FOLLOW_fnName_in_fn428
);
1129 stream_fnName
.add(fnName35
.getTree());
1130 LPAREN36
=(Token
)match(input
,LPAREN
,FOLLOW_LPAREN_in_fn430
);
1131 stream_LPAREN
.add(LPAREN36
);
1133 pushFollow(FOLLOW_cmpExpr_in_fn432
);
1134 cmpExpr37
=cmpExpr();
1138 stream_cmpExpr
.add(cmpExpr37
.getTree());
1142 int LA8_0
= input
.LA(1);
1144 if ( (LA8_0
==38) ) {
1151 char_literal38
=(Token
)match(input
,38,FOLLOW_38_in_fn435
);
1152 stream_38
.add(char_literal38
);
1154 pushFollow(FOLLOW_cmpExpr_in_fn437
);
1155 cmpExpr39
=cmpExpr();
1159 stream_cmpExpr
.add(cmpExpr39
.getTree());
1169 RPAREN40
=(Token
)match(input
,RPAREN
,FOLLOW_RPAREN_in_fn441
);
1170 stream_RPAREN
.add(RPAREN40
);
1172 retval
.tree
= root_0
;
1173 RewriteRuleSubtreeStream stream_retval
=new RewriteRuleSubtreeStream(adaptor
,"rule retval",retval
!=null?retval
.tree
:null);
1175 root_0
= (CommonTree
)adaptor
.nil();
1178 CommonTree root_1
= (CommonTree
)adaptor
.nil();
1179 root_1
= (CommonTree
)adaptor
.becomeRoot((CommonTree
)adaptor
.create(FN
, (fnName35
!=null?input
.toString(fnName35
.start
,fnName35
.stop
):null)), root_1
);
1181 if ( !(stream_cmpExpr
.hasNext()) ) {
1182 throw new RewriteEarlyExitException();
1184 while ( stream_cmpExpr
.hasNext() ) {
1185 adaptor
.addChild(root_1
, stream_cmpExpr
.nextTree());
1188 stream_cmpExpr
.reset();
1190 adaptor
.addChild(root_0
, root_1
);
1195 retval
.tree
= root_0
;
1198 retval
.stop
= input
.LT(-1);
1200 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
1201 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
1205 catch (RecognitionException e
) {
1214 public static class fnName_return
extends ParserRuleReturnScope
{
1216 public Object
getTree() { return tree
; }
1219 public final ExpressionParser
.fnName_return
fnName() throws RecognitionException
{
1220 ExpressionParser
.fnName_return retval
= new ExpressionParser
.fnName_return();
1221 retval
.start
= input
.LT(1);
1223 CommonTree root_0
= null;
1227 CommonTree set41_tree
=null;
1231 root_0
= (CommonTree
)adaptor
.nil();
1233 set41
=(Token
)input
.LT(1);
1234 if ( (input
.LA(1)>=39 && input
.LA(1)<=49) ) {
1236 adaptor
.addChild(root_0
, (CommonTree
)adaptor
.create(set41
));
1237 state
.errorRecovery
=false;
1240 MismatchedSetException mse
= new MismatchedSetException(null,input
);
1246 retval
.stop
= input
.LT(-1);
1248 retval
.tree
= (CommonTree
)adaptor
.rulePostProcessing(root_0
);
1249 adaptor
.setTokenBoundaries(retval
.tree
, retval
.start
, retval
.stop
);
1253 catch (RecognitionException e
) {
1262 protected DFA6 dfa6
= new DFA6(this);
1263 static final String DFA6_eotS
=
1265 static final String DFA6_eofS
=
1266 "\1\uffff\1\3\3\uffff\1\3";
1267 static final String DFA6_minS
=
1268 "\1\26\1\7\1\26\2\uffff\1\7";
1269 static final String DFA6_maxS
=
1270 "\1\26\1\46\1\26\2\uffff\1\46";
1271 static final String DFA6_acceptS
=
1272 "\3\uffff\1\1\1\2\1\uffff";
1273 static final String DFA6_specialS
=
1275 static final String
[] DFA6_transitionS
= {
1277 "\12\3\1\uffff\1\3\1\4\21\uffff\1\2\1\3",
1281 "\12\3\1\uffff\1\3\1\4\21\uffff\1\2\1\3"
1284 static final short[] DFA6_eot
= DFA
.unpackEncodedString(DFA6_eotS
);
1285 static final short[] DFA6_eof
= DFA
.unpackEncodedString(DFA6_eofS
);
1286 static final char[] DFA6_min
= DFA
.unpackEncodedStringToUnsignedChars(DFA6_minS
);
1287 static final char[] DFA6_max
= DFA
.unpackEncodedStringToUnsignedChars(DFA6_maxS
);
1288 static final short[] DFA6_accept
= DFA
.unpackEncodedString(DFA6_acceptS
);
1289 static final short[] DFA6_special
= DFA
.unpackEncodedString(DFA6_specialS
);
1290 static final short[][] DFA6_transition
;
1293 int numStates
= DFA6_transitionS
.length
;
1294 DFA6_transition
= new short[numStates
][];
1295 for (int i
=0; i
<numStates
; i
++) {
1296 DFA6_transition
[i
] = DFA
.unpackEncodedString(DFA6_transitionS
[i
]);
1300 class DFA6
extends DFA
{
1302 public DFA6(BaseRecognizer recognizer
) {
1303 this.recognizer
= recognizer
;
1304 this.decisionNumber
= 6;
1305 this.eot
= DFA6_eot
;
1306 this.eof
= DFA6_eof
;
1307 this.min
= DFA6_min
;
1308 this.max
= DFA6_max
;
1309 this.accept
= DFA6_accept
;
1310 this.special
= DFA6_special
;
1311 this.transition
= DFA6_transition
;
1313 public String
getDescription() {
1314 return "100:1: var : ( name | name index -> ^( INDEX[$index.text] name ) );";
1318 public static final BitSet FOLLOW_cmpExpr_in_expression87
= new BitSet(new long[]{0x0000000000000000L
});
1319 public static final BitSet FOLLOW_EOF_in_expression89
= new BitSet(new long[]{0x0000000000000002L
});
1320 public static final BitSet FOLLOW_addExpr_in_cmpExpr102
= new BitSet(new long[]{0x0000000000001F82L
});
1321 public static final BitSet FOLLOW_cmpOp_in_cmpExpr105
= new BitSet(new long[]{0x0003FF8001D24000L
});
1322 public static final BitSet FOLLOW_addExpr_in_cmpExpr108
= new BitSet(new long[]{0x0000000000000002L
});
1323 public static final BitSet FOLLOW_set_in_cmpOp0
= new BitSet(new long[]{0x0000000000000002L
});
1324 public static final BitSet FOLLOW_multExpr_in_addExpr166
= new BitSet(new long[]{0x0000000000006002L
});
1325 public static final BitSet FOLLOW_addOp_in_addExpr169
= new BitSet(new long[]{0x0003FF8001D24000L
});
1326 public static final BitSet FOLLOW_multExpr_in_addExpr172
= new BitSet(new long[]{0x0000000000006002L
});
1327 public static final BitSet FOLLOW_set_in_addOp0
= new BitSet(new long[]{0x0000000000000002L
});
1328 public static final BitSet FOLLOW_unary_in_multExpr206
= new BitSet(new long[]{0x0000000000018002L
});
1329 public static final BitSet FOLLOW_multOp_in_multExpr209
= new BitSet(new long[]{0x0003FF8001D24000L
});
1330 public static final BitSet FOLLOW_unary_in_multExpr212
= new BitSet(new long[]{0x0000000000018002L
});
1331 public static final BitSet FOLLOW_set_in_multOp0
= new BitSet(new long[]{0x0000000000000002L
});
1332 public static final BitSet FOLLOW_MINUS_in_unary246
= new BitSet(new long[]{0x0003FF8001D24000L
});
1333 public static final BitSet FOLLOW_atom_in_unary248
= new BitSet(new long[]{0x0000000000000002L
});
1334 public static final BitSet FOLLOW_atom_in_unary263
= new BitSet(new long[]{0x0000000000000002L
});
1335 public static final BitSet FOLLOW_var_in_atom276
= new BitSet(new long[]{0x0000000000000002L
});
1336 public static final BitSet FOLLOW_num_in_atom282
= new BitSet(new long[]{0x0000000000000002L
});
1337 public static final BitSet FOLLOW_str_in_atom288
= new BitSet(new long[]{0x0000000000000002L
});
1338 public static final BitSet FOLLOW_fn_in_atom294
= new BitSet(new long[]{0x0000000000000002L
});
1339 public static final BitSet FOLLOW_LPAREN_in_atom300
= new BitSet(new long[]{0x0003FF8001D24000L
});
1340 public static final BitSet FOLLOW_addExpr_in_atom302
= new BitSet(new long[]{0x0000000000040000L
});
1341 public static final BitSet FOLLOW_RPAREN_in_atom304
= new BitSet(new long[]{0x0000000000000002L
});
1342 public static final BitSet FOLLOW_name_in_var321
= new BitSet(new long[]{0x0000000000000002L
});
1343 public static final BitSet FOLLOW_name_in_var327
= new BitSet(new long[]{0x0000000000080000L
});
1344 public static final BitSet FOLLOW_index_in_var329
= new BitSet(new long[]{0x0000000000000002L
});
1345 public static final BitSet FOLLOW_LSQUARE_in_index351
= new BitSet(new long[]{0x0000000000100000L
});
1346 public static final BitSet FOLLOW_INT_in_index355
= new BitSet(new long[]{0x0000000000200000L
});
1347 public static final BitSet FOLLOW_RSQUARE_in_index357
= new BitSet(new long[]{0x0000000000000002L
});
1348 public static final BitSet FOLLOW_NAME_in_name375
= new BitSet(new long[]{0x0000002000000002L
});
1349 public static final BitSet FOLLOW_37_in_name378
= new BitSet(new long[]{0x0000000000400000L
});
1350 public static final BitSet FOLLOW_NAME_in_name381
= new BitSet(new long[]{0x0000002000000002L
});
1351 public static final BitSet FOLLOW_set_in_num0
= new BitSet(new long[]{0x0000000000000002L
});
1352 public static final BitSet FOLLOW_PHRASE_in_str415
= new BitSet(new long[]{0x0000000000000002L
});
1353 public static final BitSet FOLLOW_fnName_in_fn428
= new BitSet(new long[]{0x0000000000020000L
});
1354 public static final BitSet FOLLOW_LPAREN_in_fn430
= new BitSet(new long[]{0x0003FF8001D24000L
});
1355 public static final BitSet FOLLOW_cmpExpr_in_fn432
= new BitSet(new long[]{0x0000004000040000L
});
1356 public static final BitSet FOLLOW_38_in_fn435
= new BitSet(new long[]{0x0003FF8001D24000L
});
1357 public static final BitSet FOLLOW_cmpExpr_in_fn437
= new BitSet(new long[]{0x0000004000040000L
});
1358 public static final BitSet FOLLOW_RPAREN_in_fn441
= new BitSet(new long[]{0x0000000000000002L
});
1359 public static final BitSet FOLLOW_set_in_fnName0
= new BitSet(new long[]{0x0000000000000002L
});