testautoa 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +7 -7
- data/bin/calabash-android +8 -1
- data/bin/calabash-android-build.rb +1 -1
- data/bin/calabash-android-console.rb +4 -4
- data/bin/calabash-android-run.rb +2 -10
- data/bin/testautoa +461 -0
- data/calabash-android.gemspec +3 -1
- data/features-skeleton/support/app_life_cycle_hooks.rb +0 -1
- data/irbrc +3 -1
- data/lib/calabash-android/helpers.rb +45 -17
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/lib/unsign.jar +0 -0
- data/lib/calabash-android/operations.rb +150 -66
- data/lib/calabash-android/steps/list_steps.rb +1 -1
- data/lib/calabash-android/steps/time_picker_steps.rb +1 -1
- data/lib/calabash-android/touch_helpers.rb +9 -0
- data/lib/calabash-android/version.rb +1 -1
- data/lib/calabash-android/wait_helpers.rb +93 -0
- data/test-server/AndroidManifest.xml +2 -0
- data/test-server/build.xml +1 -0
- data/test-server/instrumentation-backend/.classpath +0 -1
- data/test-server/instrumentation-backend/AndroidManifest.xml +1 -1
- data/test-server/instrumentation-backend/antlr/UIQuery.g +48 -5
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/Command.java +4 -3
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/FranklyResult.java +95 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/Result.java +7 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java +14 -29
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/activity/FinishOpenedActivities.java +19 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/activity/GetOpenedActivities.java +31 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/activity/GoBackToActivity.java +67 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/DragCoordinates.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java +11 -5
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/location/FakeGPSLocation.java +13 -10
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/LeftKey.java +24 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/RightKey.java +24 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/UpKey.java +24 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/version/Version.java +31 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/CalabashChromeClient.java +131 -36
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java +38 -18
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java +38 -16
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/EnterTextByCssSelector.java +94 -66
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ExecuteAsyncJavascript.java +55 -33
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ExecuteJavascript.java +53 -31
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/JavaScriptOperation.java +44 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/PressByCssSelector.java +52 -27
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/QueryHelper.java +39 -32
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ScrollTo.java +56 -41
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetPropertyByCssSelector.java +50 -25
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetText.java +19 -22
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/CompletedFuture.java +40 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/InvocationOperation.java +222 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/Operation.java +7 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/PropertyOperation.java +56 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/Query.java +151 -43
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/UIQuery.tokens +19 -12
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/UIQueryResultVoid.java +22 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ViewMapper.java +41 -11
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/antlr/UIQueryLexer.java +1010 -242
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/antlr/UIQueryParser.java +406 -98
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/BeginsWithRelation.java +45 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java +54 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ContainsRelation.java +41 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/EndsWithRelation.java +42 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/LikeRelation.java +79 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/PartialFutureList.java +100 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryAST.java +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTClassName.java +54 -25
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTPredicate.java +147 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTPredicateRelation.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTWith.java +153 -89
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryDirection.java +12 -2
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryEvaluator.java +58 -141
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryUtils.java +162 -7
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryVisibility.java +32 -0
- metadata +130 -97
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/Query.java +0 -24
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/Touch.java +0 -44
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/antlr/UIQuery.tokens +0 -10
- data/test-server/instrumentation-backend/tests/sh/calaba/instrumentationbackend/query/tests/UIQueryTest.java +0 -134
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// $ANTLR 3.4 antlr/UIQuery.g
|
|
1
|
+
// $ANTLR 3.4 antlr/UIQuery.g 2013-02-02 18:08:56
|
|
2
2
|
|
|
3
3
|
package sh.calaba.instrumentationbackend.query.antlr;
|
|
4
4
|
|
|
@@ -14,22 +14,29 @@ import org.antlr.runtime.tree.*;
|
|
|
14
14
|
@SuppressWarnings({"all", "warnings", "unchecked"})
|
|
15
15
|
public class UIQueryParser extends Parser {
|
|
16
16
|
public static final String[] tokenNames = new String[] {
|
|
17
|
-
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "BOOL", "ESC_SEQ", "FILTER_COLON", "HEX_DIGIT", "INT", "NAME", "NIL", "OCTAL_ESC", "QUALIFIED_NAME", "STRING", "UNICODE_ESC", "WHITE"
|
|
17
|
+
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "ALL", "BEGINPRED", "BOOL", "DIRECTION", "ENDPRED", "ESC_SEQ", "FILTER_COLON", "HEX_DIGIT", "INT", "NAME", "NIL", "OCTAL_ESC", "QUALIFIED_NAME", "RELATION", "STRING", "UNICODE_ESC", "VISIBLE", "WHITE", "WILDCARD"
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
public static final int EOF=-1;
|
|
21
|
-
public static final int
|
|
22
|
-
public static final int
|
|
23
|
-
public static final int
|
|
24
|
-
public static final int
|
|
25
|
-
public static final int
|
|
26
|
-
public static final int
|
|
27
|
-
public static final int
|
|
28
|
-
public static final int
|
|
29
|
-
public static final int
|
|
30
|
-
public static final int
|
|
31
|
-
public static final int
|
|
32
|
-
public static final int
|
|
21
|
+
public static final int ALL=4;
|
|
22
|
+
public static final int BEGINPRED=5;
|
|
23
|
+
public static final int BOOL=6;
|
|
24
|
+
public static final int DIRECTION=7;
|
|
25
|
+
public static final int ENDPRED=8;
|
|
26
|
+
public static final int ESC_SEQ=9;
|
|
27
|
+
public static final int FILTER_COLON=10;
|
|
28
|
+
public static final int HEX_DIGIT=11;
|
|
29
|
+
public static final int INT=12;
|
|
30
|
+
public static final int NAME=13;
|
|
31
|
+
public static final int NIL=14;
|
|
32
|
+
public static final int OCTAL_ESC=15;
|
|
33
|
+
public static final int QUALIFIED_NAME=16;
|
|
34
|
+
public static final int RELATION=17;
|
|
35
|
+
public static final int STRING=18;
|
|
36
|
+
public static final int UNICODE_ESC=19;
|
|
37
|
+
public static final int VISIBLE=20;
|
|
38
|
+
public static final int WHITE=21;
|
|
39
|
+
public static final int WILDCARD=22;
|
|
33
40
|
|
|
34
41
|
// delegates
|
|
35
42
|
public Parser[] getDelegates() {
|
|
@@ -65,7 +72,7 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
65
72
|
|
|
66
73
|
|
|
67
74
|
// $ANTLR start "query"
|
|
68
|
-
// antlr/UIQuery.g:
|
|
75
|
+
// antlr/UIQuery.g:35:1: query : expr ( WHITE ! expr )* ;
|
|
69
76
|
public final UIQueryParser.query_return query() throws RecognitionException {
|
|
70
77
|
UIQueryParser.query_return retval = new UIQueryParser.query_return();
|
|
71
78
|
retval.start = input.LT(1);
|
|
@@ -82,20 +89,20 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
82
89
|
CommonTree WHITE2_tree=null;
|
|
83
90
|
|
|
84
91
|
try {
|
|
85
|
-
// antlr/UIQuery.g:
|
|
86
|
-
// antlr/UIQuery.g:
|
|
92
|
+
// antlr/UIQuery.g:35:7: ( expr ( WHITE ! expr )* )
|
|
93
|
+
// antlr/UIQuery.g:35:9: expr ( WHITE ! expr )*
|
|
87
94
|
{
|
|
88
95
|
root_0 = (CommonTree)adaptor.nil();
|
|
89
96
|
|
|
90
97
|
|
|
91
|
-
pushFollow(
|
|
98
|
+
pushFollow(FOLLOW_expr_in_query56);
|
|
92
99
|
expr1=expr();
|
|
93
100
|
|
|
94
101
|
state._fsp--;
|
|
95
102
|
|
|
96
103
|
adaptor.addChild(root_0, expr1.getTree());
|
|
97
104
|
|
|
98
|
-
// antlr/UIQuery.g:
|
|
105
|
+
// antlr/UIQuery.g:35:14: ( WHITE ! expr )*
|
|
99
106
|
loop1:
|
|
100
107
|
do {
|
|
101
108
|
int alt1=2;
|
|
@@ -108,11 +115,11 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
108
115
|
|
|
109
116
|
switch (alt1) {
|
|
110
117
|
case 1 :
|
|
111
|
-
// antlr/UIQuery.g:
|
|
118
|
+
// antlr/UIQuery.g:35:15: WHITE ! expr
|
|
112
119
|
{
|
|
113
|
-
WHITE2=(Token)match(input,WHITE,
|
|
120
|
+
WHITE2=(Token)match(input,WHITE,FOLLOW_WHITE_in_query59);
|
|
114
121
|
|
|
115
|
-
pushFollow(
|
|
122
|
+
pushFollow(FOLLOW_expr_in_query62);
|
|
116
123
|
expr3=expr();
|
|
117
124
|
|
|
118
125
|
state._fsp--;
|
|
@@ -159,7 +166,7 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
159
166
|
|
|
160
167
|
|
|
161
168
|
// $ANTLR start "expr"
|
|
162
|
-
// antlr/UIQuery.g:
|
|
169
|
+
// antlr/UIQuery.g:39:1: expr : ( className | filter | visibility | predicate | DIRECTION ^) ;
|
|
163
170
|
public final UIQueryParser.expr_return expr() throws RecognitionException {
|
|
164
171
|
UIQueryParser.expr_return retval = new UIQueryParser.expr_return();
|
|
165
172
|
retval.start = input.LT(1);
|
|
@@ -167,55 +174,82 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
167
174
|
|
|
168
175
|
CommonTree root_0 = null;
|
|
169
176
|
|
|
177
|
+
Token DIRECTION8=null;
|
|
170
178
|
UIQueryParser.className_return className4 =null;
|
|
171
179
|
|
|
172
180
|
UIQueryParser.filter_return filter5 =null;
|
|
173
181
|
|
|
182
|
+
UIQueryParser.visibility_return visibility6 =null;
|
|
174
183
|
|
|
184
|
+
UIQueryParser.predicate_return predicate7 =null;
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
CommonTree DIRECTION8_tree=null;
|
|
175
188
|
|
|
176
189
|
try {
|
|
177
|
-
// antlr/UIQuery.g:
|
|
178
|
-
// antlr/UIQuery.g:
|
|
190
|
+
// antlr/UIQuery.g:39:6: ( ( className | filter | visibility | predicate | DIRECTION ^) )
|
|
191
|
+
// antlr/UIQuery.g:39:8: ( className | filter | visibility | predicate | DIRECTION ^)
|
|
179
192
|
{
|
|
180
193
|
root_0 = (CommonTree)adaptor.nil();
|
|
181
194
|
|
|
182
195
|
|
|
183
|
-
// antlr/UIQuery.g:
|
|
184
|
-
int alt2=
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
196
|
+
// antlr/UIQuery.g:39:8: ( className | filter | visibility | predicate | DIRECTION ^)
|
|
197
|
+
int alt2=5;
|
|
198
|
+
switch ( input.LA(1) ) {
|
|
199
|
+
case QUALIFIED_NAME:
|
|
200
|
+
case WILDCARD:
|
|
201
|
+
{
|
|
202
|
+
alt2=1;
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case NAME:
|
|
206
|
+
{
|
|
207
|
+
int LA2_2 = input.LA(2);
|
|
189
208
|
|
|
190
|
-
if ( (
|
|
209
|
+
if ( (LA2_2==FILTER_COLON) ) {
|
|
191
210
|
alt2=2;
|
|
192
211
|
}
|
|
193
|
-
else if ( (
|
|
212
|
+
else if ( (LA2_2==EOF||LA2_2==WHITE) ) {
|
|
194
213
|
alt2=1;
|
|
195
214
|
}
|
|
196
215
|
else {
|
|
197
216
|
NoViableAltException nvae =
|
|
198
|
-
new NoViableAltException("", 2,
|
|
217
|
+
new NoViableAltException("", 2, 2, input);
|
|
199
218
|
|
|
200
219
|
throw nvae;
|
|
201
220
|
|
|
202
221
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case ALL:
|
|
225
|
+
case VISIBLE:
|
|
226
|
+
{
|
|
227
|
+
alt2=3;
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case BEGINPRED:
|
|
231
|
+
{
|
|
232
|
+
alt2=4;
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
case DIRECTION:
|
|
236
|
+
{
|
|
237
|
+
alt2=5;
|
|
238
|
+
}
|
|
239
|
+
break;
|
|
240
|
+
default:
|
|
208
241
|
NoViableAltException nvae =
|
|
209
242
|
new NoViableAltException("", 2, 0, input);
|
|
210
243
|
|
|
211
244
|
throw nvae;
|
|
212
245
|
|
|
213
246
|
}
|
|
247
|
+
|
|
214
248
|
switch (alt2) {
|
|
215
249
|
case 1 :
|
|
216
|
-
// antlr/UIQuery.g:
|
|
250
|
+
// antlr/UIQuery.g:39:9: className
|
|
217
251
|
{
|
|
218
|
-
pushFollow(
|
|
252
|
+
pushFollow(FOLLOW_className_in_expr80);
|
|
219
253
|
className4=className();
|
|
220
254
|
|
|
221
255
|
state._fsp--;
|
|
@@ -225,15 +259,51 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
225
259
|
}
|
|
226
260
|
break;
|
|
227
261
|
case 2 :
|
|
228
|
-
// antlr/UIQuery.g:
|
|
262
|
+
// antlr/UIQuery.g:39:21: filter
|
|
229
263
|
{
|
|
230
|
-
pushFollow(
|
|
264
|
+
pushFollow(FOLLOW_filter_in_expr84);
|
|
231
265
|
filter5=filter();
|
|
232
266
|
|
|
233
267
|
state._fsp--;
|
|
234
268
|
|
|
235
269
|
adaptor.addChild(root_0, filter5.getTree());
|
|
236
270
|
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
case 3 :
|
|
274
|
+
// antlr/UIQuery.g:39:30: visibility
|
|
275
|
+
{
|
|
276
|
+
pushFollow(FOLLOW_visibility_in_expr88);
|
|
277
|
+
visibility6=visibility();
|
|
278
|
+
|
|
279
|
+
state._fsp--;
|
|
280
|
+
|
|
281
|
+
adaptor.addChild(root_0, visibility6.getTree());
|
|
282
|
+
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
case 4 :
|
|
286
|
+
// antlr/UIQuery.g:39:43: predicate
|
|
287
|
+
{
|
|
288
|
+
pushFollow(FOLLOW_predicate_in_expr92);
|
|
289
|
+
predicate7=predicate();
|
|
290
|
+
|
|
291
|
+
state._fsp--;
|
|
292
|
+
|
|
293
|
+
adaptor.addChild(root_0, predicate7.getTree());
|
|
294
|
+
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
case 5 :
|
|
298
|
+
// antlr/UIQuery.g:39:55: DIRECTION ^
|
|
299
|
+
{
|
|
300
|
+
DIRECTION8=(Token)match(input,DIRECTION,FOLLOW_DIRECTION_in_expr96);
|
|
301
|
+
DIRECTION8_tree =
|
|
302
|
+
(CommonTree)adaptor.create(DIRECTION8)
|
|
303
|
+
;
|
|
304
|
+
root_0 = (CommonTree)adaptor.becomeRoot(DIRECTION8_tree, root_0);
|
|
305
|
+
|
|
306
|
+
|
|
237
307
|
}
|
|
238
308
|
break;
|
|
239
309
|
|
|
@@ -271,7 +341,7 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
271
341
|
|
|
272
342
|
|
|
273
343
|
// $ANTLR start "className"
|
|
274
|
-
// antlr/UIQuery.g:
|
|
344
|
+
// antlr/UIQuery.g:45:1: className : ( WILDCARD ^| NAME ^| QUALIFIED_NAME ^) ;
|
|
275
345
|
public final UIQueryParser.className_return className() throws RecognitionException {
|
|
276
346
|
UIQueryParser.className_return retval = new UIQueryParser.className_return();
|
|
277
347
|
retval.start = input.LT(1);
|
|
@@ -279,57 +349,80 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
279
349
|
|
|
280
350
|
CommonTree root_0 = null;
|
|
281
351
|
|
|
282
|
-
Token
|
|
283
|
-
Token
|
|
352
|
+
Token WILDCARD9=null;
|
|
353
|
+
Token NAME10=null;
|
|
354
|
+
Token QUALIFIED_NAME11=null;
|
|
284
355
|
|
|
285
|
-
CommonTree
|
|
286
|
-
CommonTree
|
|
356
|
+
CommonTree WILDCARD9_tree=null;
|
|
357
|
+
CommonTree NAME10_tree=null;
|
|
358
|
+
CommonTree QUALIFIED_NAME11_tree=null;
|
|
287
359
|
|
|
288
360
|
try {
|
|
289
|
-
// antlr/UIQuery.g:
|
|
290
|
-
// antlr/UIQuery.g:
|
|
361
|
+
// antlr/UIQuery.g:45:13: ( ( WILDCARD ^| NAME ^| QUALIFIED_NAME ^) )
|
|
362
|
+
// antlr/UIQuery.g:45:17: ( WILDCARD ^| NAME ^| QUALIFIED_NAME ^)
|
|
291
363
|
{
|
|
292
364
|
root_0 = (CommonTree)adaptor.nil();
|
|
293
365
|
|
|
294
366
|
|
|
295
|
-
// antlr/UIQuery.g:
|
|
296
|
-
int alt3=
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
367
|
+
// antlr/UIQuery.g:45:17: ( WILDCARD ^| NAME ^| QUALIFIED_NAME ^)
|
|
368
|
+
int alt3=3;
|
|
369
|
+
switch ( input.LA(1) ) {
|
|
370
|
+
case WILDCARD:
|
|
371
|
+
{
|
|
300
372
|
alt3=1;
|
|
301
|
-
|
|
302
|
-
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
case NAME:
|
|
376
|
+
{
|
|
303
377
|
alt3=2;
|
|
304
|
-
|
|
305
|
-
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
case QUALIFIED_NAME:
|
|
381
|
+
{
|
|
382
|
+
alt3=3;
|
|
383
|
+
}
|
|
384
|
+
break;
|
|
385
|
+
default:
|
|
306
386
|
NoViableAltException nvae =
|
|
307
387
|
new NoViableAltException("", 3, 0, input);
|
|
308
388
|
|
|
309
389
|
throw nvae;
|
|
310
390
|
|
|
311
391
|
}
|
|
392
|
+
|
|
312
393
|
switch (alt3) {
|
|
313
394
|
case 1 :
|
|
314
|
-
// antlr/UIQuery.g:
|
|
395
|
+
// antlr/UIQuery.g:45:18: WILDCARD ^
|
|
315
396
|
{
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
(CommonTree)adaptor.create(
|
|
397
|
+
WILDCARD9=(Token)match(input,WILDCARD,FOLLOW_WILDCARD_in_className140);
|
|
398
|
+
WILDCARD9_tree =
|
|
399
|
+
(CommonTree)adaptor.create(WILDCARD9)
|
|
319
400
|
;
|
|
320
|
-
root_0 = (CommonTree)adaptor.becomeRoot(
|
|
401
|
+
root_0 = (CommonTree)adaptor.becomeRoot(WILDCARD9_tree, root_0);
|
|
321
402
|
|
|
322
403
|
|
|
323
404
|
}
|
|
324
405
|
break;
|
|
325
406
|
case 2 :
|
|
326
|
-
// antlr/UIQuery.g:
|
|
407
|
+
// antlr/UIQuery.g:45:30: NAME ^
|
|
408
|
+
{
|
|
409
|
+
NAME10=(Token)match(input,NAME,FOLLOW_NAME_in_className145);
|
|
410
|
+
NAME10_tree =
|
|
411
|
+
(CommonTree)adaptor.create(NAME10)
|
|
412
|
+
;
|
|
413
|
+
root_0 = (CommonTree)adaptor.becomeRoot(NAME10_tree, root_0);
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
}
|
|
417
|
+
break;
|
|
418
|
+
case 3 :
|
|
419
|
+
// antlr/UIQuery.g:45:38: QUALIFIED_NAME ^
|
|
327
420
|
{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
(CommonTree)adaptor.create(
|
|
421
|
+
QUALIFIED_NAME11=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_className150);
|
|
422
|
+
QUALIFIED_NAME11_tree =
|
|
423
|
+
(CommonTree)adaptor.create(QUALIFIED_NAME11)
|
|
331
424
|
;
|
|
332
|
-
root_0 = (CommonTree)adaptor.becomeRoot(
|
|
425
|
+
root_0 = (CommonTree)adaptor.becomeRoot(QUALIFIED_NAME11_tree, root_0);
|
|
333
426
|
|
|
334
427
|
|
|
335
428
|
}
|
|
@@ -362,6 +455,104 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
362
455
|
// $ANTLR end "className"
|
|
363
456
|
|
|
364
457
|
|
|
458
|
+
public static class visibility_return extends ParserRuleReturnScope {
|
|
459
|
+
CommonTree tree;
|
|
460
|
+
public Object getTree() { return tree; }
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
// $ANTLR start "visibility"
|
|
465
|
+
// antlr/UIQuery.g:51:1: visibility : ( ALL ^| VISIBLE ^) ;
|
|
466
|
+
public final UIQueryParser.visibility_return visibility() throws RecognitionException {
|
|
467
|
+
UIQueryParser.visibility_return retval = new UIQueryParser.visibility_return();
|
|
468
|
+
retval.start = input.LT(1);
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
CommonTree root_0 = null;
|
|
472
|
+
|
|
473
|
+
Token ALL12=null;
|
|
474
|
+
Token VISIBLE13=null;
|
|
475
|
+
|
|
476
|
+
CommonTree ALL12_tree=null;
|
|
477
|
+
CommonTree VISIBLE13_tree=null;
|
|
478
|
+
|
|
479
|
+
try {
|
|
480
|
+
// antlr/UIQuery.g:51:14: ( ( ALL ^| VISIBLE ^) )
|
|
481
|
+
// antlr/UIQuery.g:51:18: ( ALL ^| VISIBLE ^)
|
|
482
|
+
{
|
|
483
|
+
root_0 = (CommonTree)adaptor.nil();
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
// antlr/UIQuery.g:51:18: ( ALL ^| VISIBLE ^)
|
|
487
|
+
int alt4=2;
|
|
488
|
+
int LA4_0 = input.LA(1);
|
|
489
|
+
|
|
490
|
+
if ( (LA4_0==ALL) ) {
|
|
491
|
+
alt4=1;
|
|
492
|
+
}
|
|
493
|
+
else if ( (LA4_0==VISIBLE) ) {
|
|
494
|
+
alt4=2;
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
NoViableAltException nvae =
|
|
498
|
+
new NoViableAltException("", 4, 0, input);
|
|
499
|
+
|
|
500
|
+
throw nvae;
|
|
501
|
+
|
|
502
|
+
}
|
|
503
|
+
switch (alt4) {
|
|
504
|
+
case 1 :
|
|
505
|
+
// antlr/UIQuery.g:51:19: ALL ^
|
|
506
|
+
{
|
|
507
|
+
ALL12=(Token)match(input,ALL,FOLLOW_ALL_in_visibility188);
|
|
508
|
+
ALL12_tree =
|
|
509
|
+
(CommonTree)adaptor.create(ALL12)
|
|
510
|
+
;
|
|
511
|
+
root_0 = (CommonTree)adaptor.becomeRoot(ALL12_tree, root_0);
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
}
|
|
515
|
+
break;
|
|
516
|
+
case 2 :
|
|
517
|
+
// antlr/UIQuery.g:51:26: VISIBLE ^
|
|
518
|
+
{
|
|
519
|
+
VISIBLE13=(Token)match(input,VISIBLE,FOLLOW_VISIBLE_in_visibility193);
|
|
520
|
+
VISIBLE13_tree =
|
|
521
|
+
(CommonTree)adaptor.create(VISIBLE13)
|
|
522
|
+
;
|
|
523
|
+
root_0 = (CommonTree)adaptor.becomeRoot(VISIBLE13_tree, root_0);
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
}
|
|
527
|
+
break;
|
|
528
|
+
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
retval.stop = input.LT(-1);
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
538
|
+
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
539
|
+
|
|
540
|
+
}
|
|
541
|
+
catch (RecognitionException re) {
|
|
542
|
+
reportError(re);
|
|
543
|
+
recover(input,re);
|
|
544
|
+
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
545
|
+
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
finally {
|
|
549
|
+
// do for sure before leaving
|
|
550
|
+
}
|
|
551
|
+
return retval;
|
|
552
|
+
}
|
|
553
|
+
// $ANTLR end "visibility"
|
|
554
|
+
|
|
555
|
+
|
|
365
556
|
public static class filter_return extends ParserRuleReturnScope {
|
|
366
557
|
CommonTree tree;
|
|
367
558
|
public Object getTree() { return tree; }
|
|
@@ -369,7 +560,7 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
369
560
|
|
|
370
561
|
|
|
371
562
|
// $ANTLR start "filter"
|
|
372
|
-
// antlr/UIQuery.g:
|
|
563
|
+
// antlr/UIQuery.g:58:1: filter : NAME FILTER_COLON ^ ( INT | STRING | BOOL | NIL ) ;
|
|
373
564
|
public final UIQueryParser.filter_return filter() throws RecognitionException {
|
|
374
565
|
UIQueryParser.filter_return retval = new UIQueryParser.filter_return();
|
|
375
566
|
retval.start = input.LT(1);
|
|
@@ -377,41 +568,41 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
377
568
|
|
|
378
569
|
CommonTree root_0 = null;
|
|
379
570
|
|
|
380
|
-
Token
|
|
381
|
-
Token
|
|
382
|
-
Token
|
|
571
|
+
Token NAME14=null;
|
|
572
|
+
Token FILTER_COLON15=null;
|
|
573
|
+
Token set16=null;
|
|
383
574
|
|
|
384
|
-
CommonTree
|
|
385
|
-
CommonTree
|
|
386
|
-
CommonTree
|
|
575
|
+
CommonTree NAME14_tree=null;
|
|
576
|
+
CommonTree FILTER_COLON15_tree=null;
|
|
577
|
+
CommonTree set16_tree=null;
|
|
387
578
|
|
|
388
579
|
try {
|
|
389
|
-
// antlr/UIQuery.g:
|
|
390
|
-
// antlr/UIQuery.g:
|
|
580
|
+
// antlr/UIQuery.g:58:8: ( NAME FILTER_COLON ^ ( INT | STRING | BOOL | NIL ) )
|
|
581
|
+
// antlr/UIQuery.g:58:10: NAME FILTER_COLON ^ ( INT | STRING | BOOL | NIL )
|
|
391
582
|
{
|
|
392
583
|
root_0 = (CommonTree)adaptor.nil();
|
|
393
584
|
|
|
394
585
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
(CommonTree)adaptor.create(
|
|
586
|
+
NAME14=(Token)match(input,NAME,FOLLOW_NAME_in_filter220);
|
|
587
|
+
NAME14_tree =
|
|
588
|
+
(CommonTree)adaptor.create(NAME14)
|
|
398
589
|
;
|
|
399
|
-
adaptor.addChild(root_0,
|
|
590
|
+
adaptor.addChild(root_0, NAME14_tree);
|
|
400
591
|
|
|
401
592
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
(CommonTree)adaptor.create(
|
|
593
|
+
FILTER_COLON15=(Token)match(input,FILTER_COLON,FOLLOW_FILTER_COLON_in_filter222);
|
|
594
|
+
FILTER_COLON15_tree =
|
|
595
|
+
(CommonTree)adaptor.create(FILTER_COLON15)
|
|
405
596
|
;
|
|
406
|
-
root_0 = (CommonTree)adaptor.becomeRoot(
|
|
597
|
+
root_0 = (CommonTree)adaptor.becomeRoot(FILTER_COLON15_tree, root_0);
|
|
407
598
|
|
|
408
599
|
|
|
409
|
-
|
|
600
|
+
set16=(Token)input.LT(1);
|
|
410
601
|
|
|
411
602
|
if ( input.LA(1)==BOOL||input.LA(1)==INT||input.LA(1)==NIL||input.LA(1)==STRING ) {
|
|
412
603
|
input.consume();
|
|
413
604
|
adaptor.addChild(root_0,
|
|
414
|
-
(CommonTree)adaptor.create(
|
|
605
|
+
(CommonTree)adaptor.create(set16)
|
|
415
606
|
);
|
|
416
607
|
state.errorRecovery=false;
|
|
417
608
|
}
|
|
@@ -444,20 +635,137 @@ public TreeAdaptor getTreeAdaptor() {
|
|
|
444
635
|
}
|
|
445
636
|
// $ANTLR end "filter"
|
|
446
637
|
|
|
638
|
+
|
|
639
|
+
public static class predicate_return extends ParserRuleReturnScope {
|
|
640
|
+
CommonTree tree;
|
|
641
|
+
public Object getTree() { return tree; }
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
// $ANTLR start "predicate"
|
|
646
|
+
// antlr/UIQuery.g:63:1: predicate : BEGINPRED ^ NAME WHITE ! RELATION WHITE ! ( INT | STRING | BOOL | NIL ) ENDPRED !;
|
|
647
|
+
public final UIQueryParser.predicate_return predicate() throws RecognitionException {
|
|
648
|
+
UIQueryParser.predicate_return retval = new UIQueryParser.predicate_return();
|
|
649
|
+
retval.start = input.LT(1);
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
CommonTree root_0 = null;
|
|
653
|
+
|
|
654
|
+
Token BEGINPRED17=null;
|
|
655
|
+
Token NAME18=null;
|
|
656
|
+
Token WHITE19=null;
|
|
657
|
+
Token RELATION20=null;
|
|
658
|
+
Token WHITE21=null;
|
|
659
|
+
Token set22=null;
|
|
660
|
+
Token ENDPRED23=null;
|
|
661
|
+
|
|
662
|
+
CommonTree BEGINPRED17_tree=null;
|
|
663
|
+
CommonTree NAME18_tree=null;
|
|
664
|
+
CommonTree WHITE19_tree=null;
|
|
665
|
+
CommonTree RELATION20_tree=null;
|
|
666
|
+
CommonTree WHITE21_tree=null;
|
|
667
|
+
CommonTree set22_tree=null;
|
|
668
|
+
CommonTree ENDPRED23_tree=null;
|
|
669
|
+
|
|
670
|
+
try {
|
|
671
|
+
// antlr/UIQuery.g:63:11: ( BEGINPRED ^ NAME WHITE ! RELATION WHITE ! ( INT | STRING | BOOL | NIL ) ENDPRED !)
|
|
672
|
+
// antlr/UIQuery.g:63:13: BEGINPRED ^ NAME WHITE ! RELATION WHITE ! ( INT | STRING | BOOL | NIL ) ENDPRED !
|
|
673
|
+
{
|
|
674
|
+
root_0 = (CommonTree)adaptor.nil();
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
BEGINPRED17=(Token)match(input,BEGINPRED,FOLLOW_BEGINPRED_in_predicate258);
|
|
678
|
+
BEGINPRED17_tree =
|
|
679
|
+
(CommonTree)adaptor.create(BEGINPRED17)
|
|
680
|
+
;
|
|
681
|
+
root_0 = (CommonTree)adaptor.becomeRoot(BEGINPRED17_tree, root_0);
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
NAME18=(Token)match(input,NAME,FOLLOW_NAME_in_predicate261);
|
|
685
|
+
NAME18_tree =
|
|
686
|
+
(CommonTree)adaptor.create(NAME18)
|
|
687
|
+
;
|
|
688
|
+
adaptor.addChild(root_0, NAME18_tree);
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
WHITE19=(Token)match(input,WHITE,FOLLOW_WHITE_in_predicate263);
|
|
692
|
+
|
|
693
|
+
RELATION20=(Token)match(input,RELATION,FOLLOW_RELATION_in_predicate266);
|
|
694
|
+
RELATION20_tree =
|
|
695
|
+
(CommonTree)adaptor.create(RELATION20)
|
|
696
|
+
;
|
|
697
|
+
adaptor.addChild(root_0, RELATION20_tree);
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
WHITE21=(Token)match(input,WHITE,FOLLOW_WHITE_in_predicate268);
|
|
701
|
+
|
|
702
|
+
set22=(Token)input.LT(1);
|
|
703
|
+
|
|
704
|
+
if ( input.LA(1)==BOOL||input.LA(1)==INT||input.LA(1)==NIL||input.LA(1)==STRING ) {
|
|
705
|
+
input.consume();
|
|
706
|
+
adaptor.addChild(root_0,
|
|
707
|
+
(CommonTree)adaptor.create(set22)
|
|
708
|
+
);
|
|
709
|
+
state.errorRecovery=false;
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
713
|
+
throw mse;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
ENDPRED23=(Token)match(input,ENDPRED,FOLLOW_ENDPRED_in_predicate287);
|
|
718
|
+
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
retval.stop = input.LT(-1);
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
725
|
+
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
726
|
+
|
|
727
|
+
}
|
|
728
|
+
catch (RecognitionException re) {
|
|
729
|
+
reportError(re);
|
|
730
|
+
recover(input,re);
|
|
731
|
+
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
732
|
+
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
finally {
|
|
736
|
+
// do for sure before leaving
|
|
737
|
+
}
|
|
738
|
+
return retval;
|
|
739
|
+
}
|
|
740
|
+
// $ANTLR end "predicate"
|
|
741
|
+
|
|
447
742
|
// Delegated rules
|
|
448
743
|
|
|
449
744
|
|
|
450
745
|
|
|
451
746
|
|
|
452
|
-
public static final BitSet
|
|
453
|
-
public static final BitSet
|
|
454
|
-
public static final BitSet
|
|
455
|
-
public static final BitSet
|
|
456
|
-
public static final BitSet
|
|
457
|
-
public static final BitSet
|
|
458
|
-
public static final BitSet
|
|
459
|
-
public static final BitSet
|
|
460
|
-
public static final BitSet
|
|
461
|
-
public static final BitSet
|
|
747
|
+
public static final BitSet FOLLOW_expr_in_query56 = new BitSet(new long[]{0x0000000000200002L});
|
|
748
|
+
public static final BitSet FOLLOW_WHITE_in_query59 = new BitSet(new long[]{0x00000000005120B0L});
|
|
749
|
+
public static final BitSet FOLLOW_expr_in_query62 = new BitSet(new long[]{0x0000000000200002L});
|
|
750
|
+
public static final BitSet FOLLOW_className_in_expr80 = new BitSet(new long[]{0x0000000000000002L});
|
|
751
|
+
public static final BitSet FOLLOW_filter_in_expr84 = new BitSet(new long[]{0x0000000000000002L});
|
|
752
|
+
public static final BitSet FOLLOW_visibility_in_expr88 = new BitSet(new long[]{0x0000000000000002L});
|
|
753
|
+
public static final BitSet FOLLOW_predicate_in_expr92 = new BitSet(new long[]{0x0000000000000002L});
|
|
754
|
+
public static final BitSet FOLLOW_DIRECTION_in_expr96 = new BitSet(new long[]{0x0000000000000002L});
|
|
755
|
+
public static final BitSet FOLLOW_WILDCARD_in_className140 = new BitSet(new long[]{0x0000000000000002L});
|
|
756
|
+
public static final BitSet FOLLOW_NAME_in_className145 = new BitSet(new long[]{0x0000000000000002L});
|
|
757
|
+
public static final BitSet FOLLOW_QUALIFIED_NAME_in_className150 = new BitSet(new long[]{0x0000000000000002L});
|
|
758
|
+
public static final BitSet FOLLOW_ALL_in_visibility188 = new BitSet(new long[]{0x0000000000000002L});
|
|
759
|
+
public static final BitSet FOLLOW_VISIBLE_in_visibility193 = new BitSet(new long[]{0x0000000000000002L});
|
|
760
|
+
public static final BitSet FOLLOW_NAME_in_filter220 = new BitSet(new long[]{0x0000000000000400L});
|
|
761
|
+
public static final BitSet FOLLOW_FILTER_COLON_in_filter222 = new BitSet(new long[]{0x0000000000045040L});
|
|
762
|
+
public static final BitSet FOLLOW_set_in_filter225 = new BitSet(new long[]{0x0000000000000002L});
|
|
763
|
+
public static final BitSet FOLLOW_BEGINPRED_in_predicate258 = new BitSet(new long[]{0x0000000000002000L});
|
|
764
|
+
public static final BitSet FOLLOW_NAME_in_predicate261 = new BitSet(new long[]{0x0000000000200000L});
|
|
765
|
+
public static final BitSet FOLLOW_WHITE_in_predicate263 = new BitSet(new long[]{0x0000000000020000L});
|
|
766
|
+
public static final BitSet FOLLOW_RELATION_in_predicate266 = new BitSet(new long[]{0x0000000000200000L});
|
|
767
|
+
public static final BitSet FOLLOW_WHITE_in_predicate268 = new BitSet(new long[]{0x0000000000045040L});
|
|
768
|
+
public static final BitSet FOLLOW_set_in_predicate271 = new BitSet(new long[]{0x0000000000000100L});
|
|
769
|
+
public static final BitSet FOLLOW_ENDPRED_in_predicate287 = new BitSet(new long[]{0x0000000000000002L});
|
|
462
770
|
|
|
463
771
|
}
|