You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by tw...@apache.org on 2009/08/12 11:59:18 UTC
svn commit: r803428 - in /labs/esqueranto/trunk:
src/org/apache/labs/esqueranto/ src/org/apache/labs/esqueranto/lucene/
test/org/apache/labs/esqueranto/lucene/test/
test/org/apache/labs/esqueranto/test/
Author: twilliams
Date: Wed Aug 12 09:59:18 2009
New Revision: 803428
URL: http://svn.apache.org/viewvc?rev=803428&view=rev
Log:
Add compound statements
Removed:
labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoLexer.java
Modified:
labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esqueranto.g
labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoParser.java
labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.g
labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.java
labs/esqueranto/trunk/test/org/apache/labs/esqueranto/lucene/test/BasicLuceneParserTest.java
labs/esqueranto/trunk/test/org/apache/labs/esqueranto/test/BasicParserTest.java
Modified: labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esqueranto.g
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esqueranto.g?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esqueranto.g (original)
+++ labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esqueranto.g Wed Aug 12 09:59:18 2009
@@ -14,13 +14,63 @@
}
@header {
- package org.apache.labs.esqueranto;
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
+
+package org.apache.labs.esqueranto;
+
+import java.io.ByteArrayInputStream;
+
+/**
+ NOTE: This is a generated file. To make changes, modify the corresponding
+ grammar file and recreate this file with antlr.
+**/
- import java.io.ByteArrayInputStream;
}
@lexer::header {
- package org.apache.labs.esqueranto;
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
+
+
+package org.apache.labs.esqueranto;
+
+/**
+ NOTE: This is a generated file. To make changes, modify the corresponding
+ grammar file and recreate this file with antlr.
+**/
}
@members {
@@ -48,9 +98,9 @@
;
scopedClause:
- LPAREN (s1=scopedClause) ((OR_TOKEN s2=scopedClause) -> ^(OR $s1 $s2))+ RPAREN
- | LPAREN (s1=scopedClause) ((AND_TOKEN s2=scopedClause) -> ^(AND $s1 $s2))+ RPAREN
- | LPAREN (s1=scopedClause) ((NOT_TOKEN s2=scopedClause) -> ^(NOT $s1 $s2))+ RPAREN
+ LPAREN (scopedClause->scopedClause) ((OR_TOKEN s2=scopedClause) -> ^(OR $scopedClause $s2))+ RPAREN
+ | LPAREN (scopedClause->scopedClause) ((AND_TOKEN s2=scopedClause) -> ^(AND $scopedClause $s2))+ RPAREN
+ | LPAREN (scopedClause->scopedClause) ((NOT_TOKEN s2=scopedClause) -> ^(NOT $scopedClause $s2))+ RPAREN
| searchClause
-> searchClause
;
Modified: labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoParser.java
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoParser.java?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoParser.java (original)
+++ labs/esqueranto/trunk/src/org/apache/labs/esqueranto/esquerantoParser.java Wed Aug 12 09:59:18 2009
@@ -1,8 +1,33 @@
-// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 esqueranto.g 2009-08-10 20:48:57
+// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 esqueranto.g 2009-08-11 21:41:07
- package org.apache.labs.esqueranto;
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
+
+package org.apache.labs.esqueranto;
+
+import java.io.ByteArrayInputStream;
+
+/**
+ NOTE: This is a generated file. To make changes, modify the corresponding
+ grammar file and recreate this file with antlr.
+**/
- import java.io.ByteArrayInputStream;
import org.antlr.runtime.*;
@@ -81,7 +106,7 @@
};
// $ANTLR start "cqlQuery"
- // esqueranto.g:46:1: cqlQuery : scopedClause ;
+ // esqueranto.g:95:1: cqlQuery : scopedClause ;
public final esquerantoParser.cqlQuery_return cqlQuery() throws RecognitionException {
esquerantoParser.cqlQuery_return retval = new esquerantoParser.cqlQuery_return();
retval.start = input.LT(1);
@@ -93,12 +118,12 @@
try {
- // esqueranto.g:46:9: ( scopedClause )
- // esqueranto.g:47:2: scopedClause
+ // esqueranto.g:96:9: ( scopedClause )
+ // esqueranto.g:97:2: scopedClause
{
root_0 = (CommonTree)adaptor.nil();
- pushFollow(FOLLOW_scopedClause_in_cqlQuery77);
+ pushFollow(FOLLOW_scopedClause_in_cqlQuery78);
scopedClause1=scopedClause();
state._fsp--;
@@ -133,7 +158,7 @@
};
// $ANTLR start "scopedClause"
- // esqueranto.g:50:1: scopedClause : ( LPAREN (s1= scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $s1 $s2) )+ RPAREN | LPAREN (s1= scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $s1 $s2) )+ RPAREN | LPAREN (s1= scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $s1 $s2) )+ RPAREN | searchClause -> searchClause );
+ // esqueranto.g:100:1: scopedClause : ( LPAREN ( scopedClause -> scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $scopedClause $s2) )+ RPAREN | LPAREN ( scopedClause -> scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $scopedClause $s2) )+ RPAREN | LPAREN ( scopedClause -> scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $scopedClause $s2) )+ RPAREN | searchClause -> searchClause );
public final esquerantoParser.scopedClause_return scopedClause() throws RecognitionException {
esquerantoParser.scopedClause_return retval = new esquerantoParser.scopedClause_return();
retval.start = input.LT(1);
@@ -141,30 +166,34 @@
CommonTree root_0 = null;
Token LPAREN2=null;
- Token OR_TOKEN3=null;
- Token RPAREN4=null;
- Token LPAREN5=null;
- Token AND_TOKEN6=null;
- Token RPAREN7=null;
- Token LPAREN8=null;
- Token NOT_TOKEN9=null;
- Token RPAREN10=null;
- esquerantoParser.scopedClause_return s1 = null;
-
+ Token OR_TOKEN4=null;
+ Token RPAREN5=null;
+ Token LPAREN6=null;
+ Token AND_TOKEN8=null;
+ Token RPAREN9=null;
+ Token LPAREN10=null;
+ Token NOT_TOKEN12=null;
+ Token RPAREN13=null;
esquerantoParser.scopedClause_return s2 = null;
- esquerantoParser.searchClause_return searchClause11 = null;
+ esquerantoParser.scopedClause_return scopedClause3 = null;
+
+ esquerantoParser.scopedClause_return scopedClause7 = null;
+
+ esquerantoParser.scopedClause_return scopedClause11 = null;
+
+ esquerantoParser.searchClause_return searchClause14 = null;
CommonTree LPAREN2_tree=null;
- CommonTree OR_TOKEN3_tree=null;
- CommonTree RPAREN4_tree=null;
- CommonTree LPAREN5_tree=null;
- CommonTree AND_TOKEN6_tree=null;
- CommonTree RPAREN7_tree=null;
- CommonTree LPAREN8_tree=null;
- CommonTree NOT_TOKEN9_tree=null;
- CommonTree RPAREN10_tree=null;
+ CommonTree OR_TOKEN4_tree=null;
+ CommonTree RPAREN5_tree=null;
+ CommonTree LPAREN6_tree=null;
+ CommonTree AND_TOKEN8_tree=null;
+ CommonTree RPAREN9_tree=null;
+ CommonTree LPAREN10_tree=null;
+ CommonTree NOT_TOKEN12_tree=null;
+ CommonTree RPAREN13_tree=null;
RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
RewriteRuleTokenStream stream_AND_TOKEN=new RewriteRuleTokenStream(adaptor,"token AND_TOKEN");
RewriteRuleTokenStream stream_OR_TOKEN=new RewriteRuleTokenStream(adaptor,"token OR_TOKEN");
@@ -173,7 +202,7 @@
RewriteRuleSubtreeStream stream_searchClause=new RewriteRuleSubtreeStream(adaptor,"rule searchClause");
RewriteRuleSubtreeStream stream_scopedClause=new RewriteRuleSubtreeStream(adaptor,"rule scopedClause");
try {
- // esqueranto.g:50:13: ( LPAREN (s1= scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $s1 $s2) )+ RPAREN | LPAREN (s1= scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $s1 $s2) )+ RPAREN | LPAREN (s1= scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $s1 $s2) )+ RPAREN | searchClause -> searchClause )
+ // esqueranto.g:100:13: ( LPAREN ( scopedClause -> scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $scopedClause $s2) )+ RPAREN | LPAREN ( scopedClause -> scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $scopedClause $s2) )+ RPAREN | LPAREN ( scopedClause -> scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $scopedClause $s2) )+ RPAREN | searchClause -> searchClause )
int alt4=4;
int LA4_0 = input.LA(1);
@@ -212,24 +241,44 @@
}
switch (alt4) {
case 1 :
- // esqueranto.g:51:2: LPAREN (s1= scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $s1 $s2) )+ RPAREN
+ // esqueranto.g:101:2: LPAREN ( scopedClause -> scopedClause ) ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $scopedClause $s2) )+ RPAREN
{
- LPAREN2=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause88); if (state.failed) return retval;
+ LPAREN2=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause89); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN2);
- // esqueranto.g:51:9: (s1= scopedClause )
- // esqueranto.g:51:10: s1= scopedClause
+ // esqueranto.g:101:9: ( scopedClause -> scopedClause )
+ // esqueranto.g:101:10: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_scopedClause93);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_scopedClause92);
+ scopedClause3=scopedClause();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_scopedClause.add(s1.getTree());
+ if ( state.backtracking==0 ) stream_scopedClause.add(scopedClause3.getTree());
+
+
+ // AST REWRITE
+ // elements: scopedClause
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ // wildcard labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
+
+ root_0 = (CommonTree)adaptor.nil();
+ // 101:22: -> scopedClause
+ {
+ adaptor.addChild(root_0, stream_scopedClause.nextTree());
}
- // esqueranto.g:51:27: ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $s1 $s2) )+
+ retval.tree = root_0;}
+ }
+
+ // esqueranto.g:101:38: ( ( OR_TOKEN s2= scopedClause ) -> ^( OR $scopedClause $s2) )+
int cnt1=0;
loop1:
do {
@@ -243,15 +292,15 @@
switch (alt1) {
case 1 :
- // esqueranto.g:51:28: ( OR_TOKEN s2= scopedClause )
+ // esqueranto.g:101:39: ( OR_TOKEN s2= scopedClause )
{
- // esqueranto.g:51:28: ( OR_TOKEN s2= scopedClause )
- // esqueranto.g:51:29: OR_TOKEN s2= scopedClause
+ // esqueranto.g:101:39: ( OR_TOKEN s2= scopedClause )
+ // esqueranto.g:101:40: OR_TOKEN s2= scopedClause
{
- OR_TOKEN3=(Token)match(input,OR_TOKEN,FOLLOW_OR_TOKEN_in_scopedClause98); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_OR_TOKEN.add(OR_TOKEN3);
+ OR_TOKEN4=(Token)match(input,OR_TOKEN,FOLLOW_OR_TOKEN_in_scopedClause99); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_OR_TOKEN.add(OR_TOKEN4);
- pushFollow(FOLLOW_scopedClause_in_scopedClause102);
+ pushFollow(FOLLOW_scopedClause_in_scopedClause103);
s2=scopedClause();
state._fsp--;
@@ -263,9 +312,9 @@
// AST REWRITE
- // elements: s2, s1
+ // elements: s2, scopedClause
// token labels:
- // rule labels: s2, retval, s1
+ // rule labels: s2, retval
// token list labels:
// rule list labels:
// wildcard labels:
@@ -273,17 +322,16 @@
retval.tree = root_0;
RewriteRuleSubtreeStream stream_s2=new RewriteRuleSubtreeStream(adaptor,"rule s2",s2!=null?s2.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
- RewriteRuleSubtreeStream stream_s1=new RewriteRuleSubtreeStream(adaptor,"rule s1",s1!=null?s1.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 51:55: -> ^( OR $s1 $s2)
+ // 101:66: -> ^( OR $scopedClause $s2)
{
- // esqueranto.g:51:58: ^( OR $s1 $s2)
+ // esqueranto.g:101:69: ^( OR $scopedClause $s2)
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(OR, "OR"), root_1);
- adaptor.addChild(root_1, stream_s1.nextTree());
+ adaptor.addChild(root_1, stream_retval.nextTree());
adaptor.addChild(root_1, stream_s2.nextTree());
adaptor.addChild(root_0, root_1);
@@ -305,31 +353,51 @@
cnt1++;
} while (true);
- RPAREN4=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause119); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN4);
+ RPAREN5=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause120); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN5);
}
break;
case 2 :
- // esqueranto.g:52:7: LPAREN (s1= scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $s1 $s2) )+ RPAREN
+ // esqueranto.g:102:7: LPAREN ( scopedClause -> scopedClause ) ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $scopedClause $s2) )+ RPAREN
{
- LPAREN5=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause127); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN5);
+ LPAREN6=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause128); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN6);
- // esqueranto.g:52:14: (s1= scopedClause )
- // esqueranto.g:52:15: s1= scopedClause
+ // esqueranto.g:102:14: ( scopedClause -> scopedClause )
+ // esqueranto.g:102:15: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_scopedClause132);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_scopedClause131);
+ scopedClause7=scopedClause();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_scopedClause.add(s1.getTree());
+ if ( state.backtracking==0 ) stream_scopedClause.add(scopedClause7.getTree());
+
+
+ // AST REWRITE
+ // elements: scopedClause
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ // wildcard labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
+
+ root_0 = (CommonTree)adaptor.nil();
+ // 102:27: -> scopedClause
+ {
+ adaptor.addChild(root_0, stream_scopedClause.nextTree());
}
- // esqueranto.g:52:32: ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $s1 $s2) )+
+ retval.tree = root_0;}
+ }
+
+ // esqueranto.g:102:43: ( ( AND_TOKEN s2= scopedClause ) -> ^( AND $scopedClause $s2) )+
int cnt2=0;
loop2:
do {
@@ -343,15 +411,15 @@
switch (alt2) {
case 1 :
- // esqueranto.g:52:33: ( AND_TOKEN s2= scopedClause )
+ // esqueranto.g:102:44: ( AND_TOKEN s2= scopedClause )
{
- // esqueranto.g:52:33: ( AND_TOKEN s2= scopedClause )
- // esqueranto.g:52:34: AND_TOKEN s2= scopedClause
+ // esqueranto.g:102:44: ( AND_TOKEN s2= scopedClause )
+ // esqueranto.g:102:45: AND_TOKEN s2= scopedClause
{
- AND_TOKEN6=(Token)match(input,AND_TOKEN,FOLLOW_AND_TOKEN_in_scopedClause137); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_AND_TOKEN.add(AND_TOKEN6);
+ AND_TOKEN8=(Token)match(input,AND_TOKEN,FOLLOW_AND_TOKEN_in_scopedClause138); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_AND_TOKEN.add(AND_TOKEN8);
- pushFollow(FOLLOW_scopedClause_in_scopedClause141);
+ pushFollow(FOLLOW_scopedClause_in_scopedClause142);
s2=scopedClause();
state._fsp--;
@@ -363,9 +431,9 @@
// AST REWRITE
- // elements: s2, s1
+ // elements: s2, scopedClause
// token labels:
- // rule labels: s2, retval, s1
+ // rule labels: s2, retval
// token list labels:
// rule list labels:
// wildcard labels:
@@ -373,17 +441,16 @@
retval.tree = root_0;
RewriteRuleSubtreeStream stream_s2=new RewriteRuleSubtreeStream(adaptor,"rule s2",s2!=null?s2.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
- RewriteRuleSubtreeStream stream_s1=new RewriteRuleSubtreeStream(adaptor,"rule s1",s1!=null?s1.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 52:61: -> ^( AND $s1 $s2)
+ // 102:72: -> ^( AND $scopedClause $s2)
{
- // esqueranto.g:52:64: ^( AND $s1 $s2)
+ // esqueranto.g:102:75: ^( AND $scopedClause $s2)
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(AND, "AND"), root_1);
- adaptor.addChild(root_1, stream_s1.nextTree());
+ adaptor.addChild(root_1, stream_retval.nextTree());
adaptor.addChild(root_1, stream_s2.nextTree());
adaptor.addChild(root_0, root_1);
@@ -405,31 +472,51 @@
cnt2++;
} while (true);
- RPAREN7=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause158); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN7);
+ RPAREN9=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause159); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN9);
}
break;
case 3 :
- // esqueranto.g:53:7: LPAREN (s1= scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $s1 $s2) )+ RPAREN
+ // esqueranto.g:103:7: LPAREN ( scopedClause -> scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $scopedClause $s2) )+ RPAREN
{
- LPAREN8=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause166); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN8);
+ LPAREN10=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scopedClause167); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN10);
- // esqueranto.g:53:14: (s1= scopedClause )
- // esqueranto.g:53:15: s1= scopedClause
+ // esqueranto.g:103:14: ( scopedClause -> scopedClause )
+ // esqueranto.g:103:15: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_scopedClause171);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_scopedClause170);
+ scopedClause11=scopedClause();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_scopedClause.add(s1.getTree());
+ if ( state.backtracking==0 ) stream_scopedClause.add(scopedClause11.getTree());
+
+ // AST REWRITE
+ // elements: scopedClause
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ // wildcard labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
+
+ root_0 = (CommonTree)adaptor.nil();
+ // 103:27: -> scopedClause
+ {
+ adaptor.addChild(root_0, stream_scopedClause.nextTree());
+
+ }
+
+ retval.tree = root_0;}
}
- // esqueranto.g:53:32: ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $s1 $s2) )+
+ // esqueranto.g:103:43: ( ( NOT_TOKEN s2= scopedClause ) -> ^( NOT $scopedClause $s2) )+
int cnt3=0;
loop3:
do {
@@ -443,15 +530,15 @@
switch (alt3) {
case 1 :
- // esqueranto.g:53:33: ( NOT_TOKEN s2= scopedClause )
+ // esqueranto.g:103:44: ( NOT_TOKEN s2= scopedClause )
{
- // esqueranto.g:53:33: ( NOT_TOKEN s2= scopedClause )
- // esqueranto.g:53:34: NOT_TOKEN s2= scopedClause
+ // esqueranto.g:103:44: ( NOT_TOKEN s2= scopedClause )
+ // esqueranto.g:103:45: NOT_TOKEN s2= scopedClause
{
- NOT_TOKEN9=(Token)match(input,NOT_TOKEN,FOLLOW_NOT_TOKEN_in_scopedClause176); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_NOT_TOKEN.add(NOT_TOKEN9);
+ NOT_TOKEN12=(Token)match(input,NOT_TOKEN,FOLLOW_NOT_TOKEN_in_scopedClause177); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT_TOKEN.add(NOT_TOKEN12);
- pushFollow(FOLLOW_scopedClause_in_scopedClause180);
+ pushFollow(FOLLOW_scopedClause_in_scopedClause181);
s2=scopedClause();
state._fsp--;
@@ -463,9 +550,9 @@
// AST REWRITE
- // elements: s2, s1
+ // elements: scopedClause, s2
// token labels:
- // rule labels: s2, retval, s1
+ // rule labels: s2, retval
// token list labels:
// rule list labels:
// wildcard labels:
@@ -473,17 +560,16 @@
retval.tree = root_0;
RewriteRuleSubtreeStream stream_s2=new RewriteRuleSubtreeStream(adaptor,"rule s2",s2!=null?s2.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
- RewriteRuleSubtreeStream stream_s1=new RewriteRuleSubtreeStream(adaptor,"rule s1",s1!=null?s1.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 53:61: -> ^( NOT $s1 $s2)
+ // 103:72: -> ^( NOT $scopedClause $s2)
{
- // esqueranto.g:53:64: ^( NOT $s1 $s2)
+ // esqueranto.g:103:75: ^( NOT $scopedClause $s2)
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(NOT, "NOT"), root_1);
- adaptor.addChild(root_1, stream_s1.nextTree());
+ adaptor.addChild(root_1, stream_retval.nextTree());
adaptor.addChild(root_1, stream_s2.nextTree());
adaptor.addChild(root_0, root_1);
@@ -505,21 +591,21 @@
cnt3++;
} while (true);
- RPAREN10=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause197); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN10);
+ RPAREN13=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scopedClause198); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN13);
}
break;
case 4 :
- // esqueranto.g:54:4: searchClause
+ // esqueranto.g:104:4: searchClause
{
- pushFollow(FOLLOW_searchClause_in_scopedClause202);
- searchClause11=searchClause();
+ pushFollow(FOLLOW_searchClause_in_scopedClause203);
+ searchClause14=searchClause();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_searchClause.add(searchClause11.getTree());
+ if ( state.backtracking==0 ) stream_searchClause.add(searchClause14.getTree());
// AST REWRITE
@@ -534,7 +620,7 @@
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 55:3: -> searchClause
+ // 105:3: -> searchClause
{
adaptor.addChild(root_0, stream_searchClause.nextTree());
@@ -571,27 +657,27 @@
};
// $ANTLR start "searchClause"
- // esqueranto.g:57:1: searchClause : ( LPAREN cqlQuery RPAREN -> cqlQuery | searchTerm );
+ // esqueranto.g:107:1: searchClause : ( LPAREN cqlQuery RPAREN -> cqlQuery | searchTerm );
public final esquerantoParser.searchClause_return searchClause() throws RecognitionException {
esquerantoParser.searchClause_return retval = new esquerantoParser.searchClause_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- Token LPAREN12=null;
- Token RPAREN14=null;
- esquerantoParser.cqlQuery_return cqlQuery13 = null;
+ Token LPAREN15=null;
+ Token RPAREN17=null;
+ esquerantoParser.cqlQuery_return cqlQuery16 = null;
- esquerantoParser.searchTerm_return searchTerm15 = null;
+ esquerantoParser.searchTerm_return searchTerm18 = null;
- CommonTree LPAREN12_tree=null;
- CommonTree RPAREN14_tree=null;
+ CommonTree LPAREN15_tree=null;
+ CommonTree RPAREN17_tree=null;
RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
RewriteRuleSubtreeStream stream_cqlQuery=new RewriteRuleSubtreeStream(adaptor,"rule cqlQuery");
try {
- // esqueranto.g:58:2: ( LPAREN cqlQuery RPAREN -> cqlQuery | searchTerm )
+ // esqueranto.g:108:2: ( LPAREN cqlQuery RPAREN -> cqlQuery | searchTerm )
int alt5=2;
int LA5_0 = input.LA(1);
@@ -610,19 +696,19 @@
}
switch (alt5) {
case 1 :
- // esqueranto.g:59:2: LPAREN cqlQuery RPAREN
+ // esqueranto.g:109:2: LPAREN cqlQuery RPAREN
{
- LPAREN12=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_searchClause220); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN12);
+ LPAREN15=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_searchClause221); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN15);
- pushFollow(FOLLOW_cqlQuery_in_searchClause222);
- cqlQuery13=cqlQuery();
+ pushFollow(FOLLOW_cqlQuery_in_searchClause223);
+ cqlQuery16=cqlQuery();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_cqlQuery.add(cqlQuery13.getTree());
- RPAREN14=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_searchClause224); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN14);
+ if ( state.backtracking==0 ) stream_cqlQuery.add(cqlQuery16.getTree());
+ RPAREN17=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_searchClause225); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN17);
@@ -638,7 +724,7 @@
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 59:25: -> cqlQuery
+ // 109:25: -> cqlQuery
{
adaptor.addChild(root_0, stream_cqlQuery.nextTree());
@@ -648,16 +734,16 @@
}
break;
case 2 :
- // esqueranto.g:60:4: searchTerm
+ // esqueranto.g:110:4: searchTerm
{
root_0 = (CommonTree)adaptor.nil();
- pushFollow(FOLLOW_searchTerm_in_searchClause233);
- searchTerm15=searchTerm();
+ pushFollow(FOLLOW_searchTerm_in_searchClause234);
+ searchTerm18=searchTerm();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) adaptor.addChild(root_0, searchTerm15.getTree());
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, searchTerm18.getTree());
}
break;
@@ -689,29 +775,29 @@
};
// $ANTLR start "searchTerm"
- // esqueranto.g:62:1: searchTerm : term ;
+ // esqueranto.g:112:1: searchTerm : term ;
public final esquerantoParser.searchTerm_return searchTerm() throws RecognitionException {
esquerantoParser.searchTerm_return retval = new esquerantoParser.searchTerm_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- esquerantoParser.term_return term16 = null;
+ esquerantoParser.term_return term19 = null;
try {
- // esqueranto.g:63:2: ( term )
- // esqueranto.g:64:2: term
+ // esqueranto.g:113:2: ( term )
+ // esqueranto.g:114:2: term
{
root_0 = (CommonTree)adaptor.nil();
- pushFollow(FOLLOW_term_in_searchTerm245);
- term16=term();
+ pushFollow(FOLLOW_term_in_searchTerm246);
+ term19=term();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) adaptor.addChild(root_0, term16.getTree());
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, term19.getTree());
}
@@ -741,29 +827,29 @@
};
// $ANTLR start "term"
- // esqueranto.g:66:1: term : token ;
+ // esqueranto.g:116:1: term : token ;
public final esquerantoParser.term_return term() throws RecognitionException {
esquerantoParser.term_return retval = new esquerantoParser.term_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- esquerantoParser.token_return token17 = null;
+ esquerantoParser.token_return token20 = null;
try {
- // esqueranto.g:66:7: ( token )
- // esqueranto.g:67:2: token
+ // esqueranto.g:116:7: ( token )
+ // esqueranto.g:117:2: token
{
root_0 = (CommonTree)adaptor.nil();
- pushFollow(FOLLOW_token_in_term256);
- token17=token();
+ pushFollow(FOLLOW_token_in_term257);
+ token20=token();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) adaptor.addChild(root_0, token17.getTree());
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, token20.getTree());
}
@@ -793,27 +879,27 @@
};
// $ANTLR start "token"
- // esqueranto.g:69:1: token : CHAR_STRING1 ;
+ // esqueranto.g:119:1: token : CHAR_STRING1 ;
public final esquerantoParser.token_return token() throws RecognitionException {
esquerantoParser.token_return retval = new esquerantoParser.token_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- Token CHAR_STRING118=null;
+ Token CHAR_STRING121=null;
- CommonTree CHAR_STRING118_tree=null;
+ CommonTree CHAR_STRING121_tree=null;
try {
- // esqueranto.g:69:7: ( CHAR_STRING1 )
- // esqueranto.g:70:2: CHAR_STRING1
+ // esqueranto.g:119:7: ( CHAR_STRING1 )
+ // esqueranto.g:120:2: CHAR_STRING1
{
root_0 = (CommonTree)adaptor.nil();
- CHAR_STRING118=(Token)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_token266); if (state.failed) return retval;
+ CHAR_STRING121=(Token)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_token267); if (state.failed) return retval;
if ( state.backtracking==0 ) {
- CHAR_STRING118_tree = (CommonTree)adaptor.create(CHAR_STRING118);
- adaptor.addChild(root_0, CHAR_STRING118_tree);
+ CHAR_STRING121_tree = (CommonTree)adaptor.create(CHAR_STRING121);
+ adaptor.addChild(root_0, CHAR_STRING121_tree);
}
}
@@ -844,27 +930,27 @@
};
// $ANTLR start "identifier"
- // esqueranto.g:74:1: identifier : CHAR_STRING1 ;
+ // esqueranto.g:124:1: identifier : CHAR_STRING1 ;
public final esquerantoParser.identifier_return identifier() throws RecognitionException {
esquerantoParser.identifier_return retval = new esquerantoParser.identifier_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- Token CHAR_STRING119=null;
+ Token CHAR_STRING122=null;
- CommonTree CHAR_STRING119_tree=null;
+ CommonTree CHAR_STRING122_tree=null;
try {
- // esqueranto.g:74:11: ( CHAR_STRING1 )
- // esqueranto.g:74:13: CHAR_STRING1
+ // esqueranto.g:124:11: ( CHAR_STRING1 )
+ // esqueranto.g:124:13: CHAR_STRING1
{
root_0 = (CommonTree)adaptor.nil();
- CHAR_STRING119=(Token)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_identifier277); if (state.failed) return retval;
+ CHAR_STRING122=(Token)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_identifier278); if (state.failed) return retval;
if ( state.backtracking==0 ) {
- CHAR_STRING119_tree = (CommonTree)adaptor.create(CHAR_STRING119);
- adaptor.addChild(root_0, CHAR_STRING119_tree);
+ CHAR_STRING122_tree = (CommonTree)adaptor.create(CHAR_STRING122);
+ adaptor.addChild(root_0, CHAR_STRING122_tree);
}
}
@@ -895,24 +981,24 @@
};
// $ANTLR start "prog"
- // esqueranto.g:77:1: prog : ( stat )+ ;
+ // esqueranto.g:127:1: prog : ( stat )+ ;
public final esquerantoParser.prog_return prog() throws RecognitionException {
esquerantoParser.prog_return retval = new esquerantoParser.prog_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- esquerantoParser.stat_return stat20 = null;
+ esquerantoParser.stat_return stat23 = null;
try {
- // esqueranto.g:77:5: ( ( stat )+ )
- // esqueranto.g:77:9: ( stat )+
+ // esqueranto.g:127:5: ( ( stat )+ )
+ // esqueranto.g:127:9: ( stat )+
{
root_0 = (CommonTree)adaptor.nil();
- // esqueranto.g:77:9: ( stat )+
+ // esqueranto.g:127:9: ( stat )+
int cnt6=0;
loop6:
do {
@@ -926,16 +1012,16 @@
switch (alt6) {
case 1 :
- // esqueranto.g:77:10: stat
+ // esqueranto.g:127:10: stat
{
- pushFollow(FOLLOW_stat_in_prog289);
- stat20=stat();
+ pushFollow(FOLLOW_stat_in_prog290);
+ stat23=stat();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) adaptor.addChild(root_0, stat20.getTree());
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, stat23.getTree());
if ( state.backtracking==0 ) {
- System.out.println((stat20!=null?((CommonTree)stat20.tree):null)==null?"null":(stat20!=null?((CommonTree)stat20.tree):null).toStringTree());
+ System.out.println((stat23!=null?((CommonTree)stat23.tree):null)==null?"null":(stat23!=null?((CommonTree)stat23.tree):null).toStringTree());
}
}
@@ -980,22 +1066,22 @@
};
// $ANTLR start "stat"
- // esqueranto.g:80:1: stat : ( cqlQuery -> cqlQuery | NEWLINE ->);
+ // esqueranto.g:130:1: stat : ( cqlQuery -> cqlQuery | NEWLINE ->);
public final esquerantoParser.stat_return stat() throws RecognitionException {
esquerantoParser.stat_return retval = new esquerantoParser.stat_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
- Token NEWLINE22=null;
- esquerantoParser.cqlQuery_return cqlQuery21 = null;
+ Token NEWLINE25=null;
+ esquerantoParser.cqlQuery_return cqlQuery24 = null;
- CommonTree NEWLINE22_tree=null;
+ CommonTree NEWLINE25_tree=null;
RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE");
RewriteRuleSubtreeStream stream_cqlQuery=new RewriteRuleSubtreeStream(adaptor,"rule cqlQuery");
try {
- // esqueranto.g:81:5: ( cqlQuery -> cqlQuery | NEWLINE ->)
+ // esqueranto.g:131:5: ( cqlQuery -> cqlQuery | NEWLINE ->)
int alt7=2;
int LA7_0 = input.LA(1);
@@ -1014,14 +1100,14 @@
}
switch (alt7) {
case 1 :
- // esqueranto.g:81:7: cqlQuery
+ // esqueranto.g:131:7: cqlQuery
{
- pushFollow(FOLLOW_cqlQuery_in_stat310);
- cqlQuery21=cqlQuery();
+ pushFollow(FOLLOW_cqlQuery_in_stat311);
+ cqlQuery24=cqlQuery();
state._fsp--;
if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_cqlQuery.add(cqlQuery21.getTree());
+ if ( state.backtracking==0 ) stream_cqlQuery.add(cqlQuery24.getTree());
// AST REWRITE
@@ -1036,7 +1122,7 @@
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 81:16: -> cqlQuery
+ // 131:16: -> cqlQuery
{
adaptor.addChild(root_0, stream_cqlQuery.nextTree());
@@ -1046,10 +1132,10 @@
}
break;
case 2 :
- // esqueranto.g:82:7: NEWLINE
+ // esqueranto.g:132:7: NEWLINE
{
- NEWLINE22=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_stat322); if (state.failed) return retval;
- if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE22);
+ NEWLINE25=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_stat323); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE25);
@@ -1065,7 +1151,7 @@
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
- // 82:17: ->
+ // 132:17: ->
{
root_0 = null;
}
@@ -1097,27 +1183,25 @@
// $ANTLR start synpred2_esqueranto
public final void synpred2_esqueranto_fragment() throws RecognitionException {
- esquerantoParser.scopedClause_return s1 = null;
-
esquerantoParser.scopedClause_return s2 = null;
- // esqueranto.g:51:2: ( LPAREN (s1= scopedClause ) ( ( OR_TOKEN s2= scopedClause ) )+ RPAREN )
- // esqueranto.g:51:2: LPAREN (s1= scopedClause ) ( ( OR_TOKEN s2= scopedClause ) )+ RPAREN
+ // esqueranto.g:101:2: ( LPAREN ( scopedClause ) ( ( OR_TOKEN s2= scopedClause ) )+ RPAREN )
+ // esqueranto.g:101:2: LPAREN ( scopedClause ) ( ( OR_TOKEN s2= scopedClause ) )+ RPAREN
{
- match(input,LPAREN,FOLLOW_LPAREN_in_synpred2_esqueranto88); if (state.failed) return ;
- // esqueranto.g:51:9: (s1= scopedClause )
- // esqueranto.g:51:10: s1= scopedClause
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred2_esqueranto89); if (state.failed) return ;
+ // esqueranto.g:101:9: ( scopedClause )
+ // esqueranto.g:101:10: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_synpred2_esqueranto93);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_synpred2_esqueranto92);
+ scopedClause();
state._fsp--;
if (state.failed) return ;
}
- // esqueranto.g:51:27: ( ( OR_TOKEN s2= scopedClause ) )+
+ // esqueranto.g:101:38: ( ( OR_TOKEN s2= scopedClause ) )+
int cnt8=0;
loop8:
do {
@@ -1131,13 +1215,13 @@
switch (alt8) {
case 1 :
- // esqueranto.g:51:28: ( OR_TOKEN s2= scopedClause )
+ // esqueranto.g:101:39: ( OR_TOKEN s2= scopedClause )
{
- // esqueranto.g:51:28: ( OR_TOKEN s2= scopedClause )
- // esqueranto.g:51:29: OR_TOKEN s2= scopedClause
+ // esqueranto.g:101:39: ( OR_TOKEN s2= scopedClause )
+ // esqueranto.g:101:40: OR_TOKEN s2= scopedClause
{
- match(input,OR_TOKEN,FOLLOW_OR_TOKEN_in_synpred2_esqueranto98); if (state.failed) return ;
- pushFollow(FOLLOW_scopedClause_in_synpred2_esqueranto102);
+ match(input,OR_TOKEN,FOLLOW_OR_TOKEN_in_synpred2_esqueranto99); if (state.failed) return ;
+ pushFollow(FOLLOW_scopedClause_in_synpred2_esqueranto103);
s2=scopedClause();
state._fsp--;
@@ -1159,7 +1243,7 @@
cnt8++;
} while (true);
- match(input,RPAREN,FOLLOW_RPAREN_in_synpred2_esqueranto119); if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred2_esqueranto120); if (state.failed) return ;
}
}
@@ -1167,27 +1251,25 @@
// $ANTLR start synpred4_esqueranto
public final void synpred4_esqueranto_fragment() throws RecognitionException {
- esquerantoParser.scopedClause_return s1 = null;
-
esquerantoParser.scopedClause_return s2 = null;
- // esqueranto.g:52:7: ( LPAREN (s1= scopedClause ) ( ( AND_TOKEN s2= scopedClause ) )+ RPAREN )
- // esqueranto.g:52:7: LPAREN (s1= scopedClause ) ( ( AND_TOKEN s2= scopedClause ) )+ RPAREN
+ // esqueranto.g:102:7: ( LPAREN ( scopedClause ) ( ( AND_TOKEN s2= scopedClause ) )+ RPAREN )
+ // esqueranto.g:102:7: LPAREN ( scopedClause ) ( ( AND_TOKEN s2= scopedClause ) )+ RPAREN
{
- match(input,LPAREN,FOLLOW_LPAREN_in_synpred4_esqueranto127); if (state.failed) return ;
- // esqueranto.g:52:14: (s1= scopedClause )
- // esqueranto.g:52:15: s1= scopedClause
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred4_esqueranto128); if (state.failed) return ;
+ // esqueranto.g:102:14: ( scopedClause )
+ // esqueranto.g:102:15: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_synpred4_esqueranto132);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_synpred4_esqueranto131);
+ scopedClause();
state._fsp--;
if (state.failed) return ;
}
- // esqueranto.g:52:32: ( ( AND_TOKEN s2= scopedClause ) )+
+ // esqueranto.g:102:43: ( ( AND_TOKEN s2= scopedClause ) )+
int cnt9=0;
loop9:
do {
@@ -1201,13 +1283,13 @@
switch (alt9) {
case 1 :
- // esqueranto.g:52:33: ( AND_TOKEN s2= scopedClause )
+ // esqueranto.g:102:44: ( AND_TOKEN s2= scopedClause )
{
- // esqueranto.g:52:33: ( AND_TOKEN s2= scopedClause )
- // esqueranto.g:52:34: AND_TOKEN s2= scopedClause
+ // esqueranto.g:102:44: ( AND_TOKEN s2= scopedClause )
+ // esqueranto.g:102:45: AND_TOKEN s2= scopedClause
{
- match(input,AND_TOKEN,FOLLOW_AND_TOKEN_in_synpred4_esqueranto137); if (state.failed) return ;
- pushFollow(FOLLOW_scopedClause_in_synpred4_esqueranto141);
+ match(input,AND_TOKEN,FOLLOW_AND_TOKEN_in_synpred4_esqueranto138); if (state.failed) return ;
+ pushFollow(FOLLOW_scopedClause_in_synpred4_esqueranto142);
s2=scopedClause();
state._fsp--;
@@ -1229,7 +1311,7 @@
cnt9++;
} while (true);
- match(input,RPAREN,FOLLOW_RPAREN_in_synpred4_esqueranto158); if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred4_esqueranto159); if (state.failed) return ;
}
}
@@ -1237,27 +1319,25 @@
// $ANTLR start synpred6_esqueranto
public final void synpred6_esqueranto_fragment() throws RecognitionException {
- esquerantoParser.scopedClause_return s1 = null;
-
esquerantoParser.scopedClause_return s2 = null;
- // esqueranto.g:53:7: ( LPAREN (s1= scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) )+ RPAREN )
- // esqueranto.g:53:7: LPAREN (s1= scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) )+ RPAREN
+ // esqueranto.g:103:7: ( LPAREN ( scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) )+ RPAREN )
+ // esqueranto.g:103:7: LPAREN ( scopedClause ) ( ( NOT_TOKEN s2= scopedClause ) )+ RPAREN
{
- match(input,LPAREN,FOLLOW_LPAREN_in_synpred6_esqueranto166); if (state.failed) return ;
- // esqueranto.g:53:14: (s1= scopedClause )
- // esqueranto.g:53:15: s1= scopedClause
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred6_esqueranto167); if (state.failed) return ;
+ // esqueranto.g:103:14: ( scopedClause )
+ // esqueranto.g:103:15: scopedClause
{
- pushFollow(FOLLOW_scopedClause_in_synpred6_esqueranto171);
- s1=scopedClause();
+ pushFollow(FOLLOW_scopedClause_in_synpred6_esqueranto170);
+ scopedClause();
state._fsp--;
if (state.failed) return ;
}
- // esqueranto.g:53:32: ( ( NOT_TOKEN s2= scopedClause ) )+
+ // esqueranto.g:103:43: ( ( NOT_TOKEN s2= scopedClause ) )+
int cnt10=0;
loop10:
do {
@@ -1271,13 +1351,13 @@
switch (alt10) {
case 1 :
- // esqueranto.g:53:33: ( NOT_TOKEN s2= scopedClause )
+ // esqueranto.g:103:44: ( NOT_TOKEN s2= scopedClause )
{
- // esqueranto.g:53:33: ( NOT_TOKEN s2= scopedClause )
- // esqueranto.g:53:34: NOT_TOKEN s2= scopedClause
+ // esqueranto.g:103:44: ( NOT_TOKEN s2= scopedClause )
+ // esqueranto.g:103:45: NOT_TOKEN s2= scopedClause
{
- match(input,NOT_TOKEN,FOLLOW_NOT_TOKEN_in_synpred6_esqueranto176); if (state.failed) return ;
- pushFollow(FOLLOW_scopedClause_in_synpred6_esqueranto180);
+ match(input,NOT_TOKEN,FOLLOW_NOT_TOKEN_in_synpred6_esqueranto177); if (state.failed) return ;
+ pushFollow(FOLLOW_scopedClause_in_synpred6_esqueranto181);
s2=scopedClause();
state._fsp--;
@@ -1299,7 +1379,7 @@
cnt10++;
} while (true);
- match(input,RPAREN,FOLLOW_RPAREN_in_synpred6_esqueranto197); if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred6_esqueranto198); if (state.failed) return ;
}
}
@@ -1353,48 +1433,48 @@
- public static final BitSet FOLLOW_scopedClause_in_cqlQuery77 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_scopedClause88 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause93 = new BitSet(new long[]{0x0000000000000200L});
- public static final BitSet FOLLOW_OR_TOKEN_in_scopedClause98 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause102 = new BitSet(new long[]{0x0000000000000600L});
- public static final BitSet FOLLOW_RPAREN_in_scopedClause119 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_scopedClause127 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause132 = new BitSet(new long[]{0x0000000000000800L});
- public static final BitSet FOLLOW_AND_TOKEN_in_scopedClause137 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause141 = new BitSet(new long[]{0x0000000000000C00L});
- public static final BitSet FOLLOW_RPAREN_in_scopedClause158 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_scopedClause166 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause171 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_NOT_TOKEN_in_scopedClause176 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_scopedClause180 = new BitSet(new long[]{0x0000000000001400L});
- public static final BitSet FOLLOW_RPAREN_in_scopedClause197 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_searchClause_in_scopedClause202 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_searchClause220 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_cqlQuery_in_searchClause222 = new BitSet(new long[]{0x0000000000000400L});
- public static final BitSet FOLLOW_RPAREN_in_searchClause224 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_searchTerm_in_searchClause233 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_term_in_searchTerm245 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_token_in_term256 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_CHAR_STRING1_in_token266 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_CHAR_STRING1_in_identifier277 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_stat_in_prog289 = new BitSet(new long[]{0x0000000000006102L});
- public static final BitSet FOLLOW_cqlQuery_in_stat310 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NEWLINE_in_stat322 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_synpred2_esqueranto88 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred2_esqueranto93 = new BitSet(new long[]{0x0000000000000200L});
- public static final BitSet FOLLOW_OR_TOKEN_in_synpred2_esqueranto98 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred2_esqueranto102 = new BitSet(new long[]{0x0000000000000600L});
- public static final BitSet FOLLOW_RPAREN_in_synpred2_esqueranto119 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_synpred4_esqueranto127 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred4_esqueranto132 = new BitSet(new long[]{0x0000000000000800L});
- public static final BitSet FOLLOW_AND_TOKEN_in_synpred4_esqueranto137 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred4_esqueranto141 = new BitSet(new long[]{0x0000000000000C00L});
- public static final BitSet FOLLOW_RPAREN_in_synpred4_esqueranto158 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_synpred6_esqueranto166 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred6_esqueranto171 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_NOT_TOKEN_in_synpred6_esqueranto176 = new BitSet(new long[]{0x0000000000002100L});
- public static final BitSet FOLLOW_scopedClause_in_synpred6_esqueranto180 = new BitSet(new long[]{0x0000000000001400L});
- public static final BitSet FOLLOW_RPAREN_in_synpred6_esqueranto197 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scopedClause_in_cqlQuery78 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_scopedClause89 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause92 = new BitSet(new long[]{0x0000000000000200L});
+ public static final BitSet FOLLOW_OR_TOKEN_in_scopedClause99 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause103 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_RPAREN_in_scopedClause120 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_scopedClause128 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause131 = new BitSet(new long[]{0x0000000000000800L});
+ public static final BitSet FOLLOW_AND_TOKEN_in_scopedClause138 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause142 = new BitSet(new long[]{0x0000000000000C00L});
+ public static final BitSet FOLLOW_RPAREN_in_scopedClause159 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_scopedClause167 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause170 = new BitSet(new long[]{0x0000000000001000L});
+ public static final BitSet FOLLOW_NOT_TOKEN_in_scopedClause177 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_scopedClause181 = new BitSet(new long[]{0x0000000000001400L});
+ public static final BitSet FOLLOW_RPAREN_in_scopedClause198 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_searchClause_in_scopedClause203 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_searchClause221 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_cqlQuery_in_searchClause223 = new BitSet(new long[]{0x0000000000000400L});
+ public static final BitSet FOLLOW_RPAREN_in_searchClause225 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_searchTerm_in_searchClause234 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_term_in_searchTerm246 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_token_in_term257 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CHAR_STRING1_in_token267 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CHAR_STRING1_in_identifier278 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stat_in_prog290 = new BitSet(new long[]{0x0000000000006102L});
+ public static final BitSet FOLLOW_cqlQuery_in_stat311 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NEWLINE_in_stat323 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred2_esqueranto89 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred2_esqueranto92 = new BitSet(new long[]{0x0000000000000200L});
+ public static final BitSet FOLLOW_OR_TOKEN_in_synpred2_esqueranto99 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred2_esqueranto103 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred2_esqueranto120 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred4_esqueranto128 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred4_esqueranto131 = new BitSet(new long[]{0x0000000000000800L});
+ public static final BitSet FOLLOW_AND_TOKEN_in_synpred4_esqueranto138 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred4_esqueranto142 = new BitSet(new long[]{0x0000000000000C00L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred4_esqueranto159 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred6_esqueranto167 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred6_esqueranto170 = new BitSet(new long[]{0x0000000000001000L});
+ public static final BitSet FOLLOW_NOT_TOKEN_in_synpred6_esqueranto177 = new BitSet(new long[]{0x0000000000002100L});
+ public static final BitSet FOLLOW_scopedClause_in_synpred6_esqueranto181 = new BitSet(new long[]{0x0000000000001400L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred6_esqueranto198 = new BitSet(new long[]{0x0000000000000002L});
}
\ No newline at end of file
Modified: labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.g
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.g?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.g (original)
+++ labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.g Wed Aug 12 09:59:18 2009
@@ -9,13 +9,37 @@
}
@header {
- package org.apache.labs.esqueranto.lucene;
-
- import org.apache.lucene.search.BooleanClause;
- import org.apache.lucene.search.BooleanQuery;
- import org.apache.lucene.search.Query;
- import org.apache.lucene.search.TermQuery;
- import org.apache.lucene.index.Term;
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
+
+package org.apache.labs.esqueranto.lucene;
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.index.Term;
+
+/**
+ NOTE: This is a generated file. To make changes, modify the corresponding
+ grammar file and recreate this file with antlr.
+**/
}
@members {
Modified: labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.java
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.java?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.java (original)
+++ labs/esqueranto/trunk/src/org/apache/labs/esqueranto/lucene/LuceneWalker.java Wed Aug 12 09:59:18 2009
@@ -1,12 +1,36 @@
-// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 LuceneWalker.g 2009-08-11 20:55:46
+// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 LuceneWalker.g 2009-08-11 21:32:08
- package org.apache.labs.esqueranto.lucene;
-
- import org.apache.lucene.search.BooleanClause;
- import org.apache.lucene.search.BooleanQuery;
- import org.apache.lucene.search.Query;
- import org.apache.lucene.search.TermQuery;
- import org.apache.lucene.index.Term;
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
+
+package org.apache.labs.esqueranto.lucene;
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.index.Term;
+
+/**
+ NOTE: This is a generated file. To make changes, modify the corresponding
+ grammar file and recreate this file with antlr.
+**/
import org.antlr.runtime.*;
@@ -59,7 +83,7 @@
};
// $ANTLR start "expr"
- // LuceneWalker.g:25:1: expr returns [Query value, String orig] : ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( NOT a= expr b= expr ) | CHAR_STRING1 );
+ // LuceneWalker.g:49:1: expr returns [Query value, String orig] : ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( NOT a= expr b= expr ) | CHAR_STRING1 );
public final LuceneWalker.expr_return expr() throws RecognitionException {
LuceneWalker.expr_return retval = new LuceneWalker.expr_return();
retval.start = input.LT(1);
@@ -71,7 +95,7 @@
try {
- // LuceneWalker.g:26:5: ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( NOT a= expr b= expr ) | CHAR_STRING1 )
+ // LuceneWalker.g:50:5: ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( NOT a= expr b= expr ) | CHAR_STRING1 )
int alt1=4;
switch ( input.LA(1) ) {
case AND:
@@ -104,7 +128,7 @@
switch (alt1) {
case 1 :
- // LuceneWalker.g:26:7: ^( AND a= expr b= expr )
+ // LuceneWalker.g:50:7: ^( AND a= expr b= expr )
{
match(input,AND,FOLLOW_AND_in_expr67); if (state.failed) return retval;
@@ -133,7 +157,7 @@
}
break;
case 2 :
- // LuceneWalker.g:32:7: ^( OR a= expr b= expr )
+ // LuceneWalker.g:56:7: ^( OR a= expr b= expr )
{
match(input,OR,FOLLOW_OR_in_expr87); if (state.failed) return retval;
@@ -162,7 +186,7 @@
}
break;
case 3 :
- // LuceneWalker.g:38:7: ^( NOT a= expr b= expr )
+ // LuceneWalker.g:62:7: ^( NOT a= expr b= expr )
{
match(input,NOT,FOLLOW_NOT_in_expr107); if (state.failed) return retval;
@@ -191,7 +215,7 @@
}
break;
case 4 :
- // LuceneWalker.g:44:7: CHAR_STRING1
+ // LuceneWalker.g:68:7: CHAR_STRING1
{
CHAR_STRING11=(CommonTree)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_expr126); if (state.failed) return retval;
if ( state.backtracking==0 ) {
@@ -218,13 +242,13 @@
// $ANTLR start "prog"
- // LuceneWalker.g:50:1: prog : ( stat )+ ;
+ // LuceneWalker.g:74:1: prog : ( stat )+ ;
public final void prog() throws RecognitionException {
try {
- // LuceneWalker.g:50:5: ( ( stat )+ )
- // LuceneWalker.g:50:7: ( stat )+
+ // LuceneWalker.g:74:5: ( ( stat )+ )
+ // LuceneWalker.g:74:7: ( stat )+
{
- // LuceneWalker.g:50:7: ( stat )+
+ // LuceneWalker.g:74:7: ( stat )+
int cnt2=0;
loop2:
do {
@@ -275,14 +299,14 @@
// $ANTLR start "stat"
- // LuceneWalker.g:52:1: stat : expr ;
+ // LuceneWalker.g:76:1: stat : expr ;
public final void stat() throws RecognitionException {
LuceneWalker.expr_return expr2 = null;
try {
- // LuceneWalker.g:52:5: ( expr )
- // LuceneWalker.g:53:5: expr
+ // LuceneWalker.g:76:5: ( expr )
+ // LuceneWalker.g:77:5: expr
{
pushFollow(FOLLOW_expr_in_stat155);
expr2=expr();
@@ -308,15 +332,15 @@
// $ANTLR start "token"
- // LuceneWalker.g:56:1: token returns [String value] : CHAR_STRING1 ;
+ // LuceneWalker.g:80:1: token returns [String value] : CHAR_STRING1 ;
public final String token() throws RecognitionException {
String value = null;
CommonTree CHAR_STRING13=null;
try {
- // LuceneWalker.g:57:5: ( CHAR_STRING1 )
- // LuceneWalker.g:58:5: CHAR_STRING1
+ // LuceneWalker.g:81:5: ( CHAR_STRING1 )
+ // LuceneWalker.g:82:5: CHAR_STRING1
{
CHAR_STRING13=(CommonTree)match(input,CHAR_STRING1,FOLLOW_CHAR_STRING1_in_token182); if (state.failed) return value;
if ( state.backtracking==0 ) {
Modified: labs/esqueranto/trunk/test/org/apache/labs/esqueranto/lucene/test/BasicLuceneParserTest.java
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/test/org/apache/labs/esqueranto/lucene/test/BasicLuceneParserTest.java?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/test/org/apache/labs/esqueranto/lucene/test/BasicLuceneParserTest.java (original)
+++ labs/esqueranto/trunk/test/org/apache/labs/esqueranto/lucene/test/BasicLuceneParserTest.java Wed Aug 12 09:59:18 2009
@@ -1,3 +1,21 @@
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
package org.apache.labs.esqueranto.lucene.test;
Modified: labs/esqueranto/trunk/test/org/apache/labs/esqueranto/test/BasicParserTest.java
URL: http://svn.apache.org/viewvc/labs/esqueranto/trunk/test/org/apache/labs/esqueranto/test/BasicParserTest.java?rev=803428&r1=803427&r2=803428&view=diff
==============================================================================
--- labs/esqueranto/trunk/test/org/apache/labs/esqueranto/test/BasicParserTest.java (original)
+++ labs/esqueranto/trunk/test/org/apache/labs/esqueranto/test/BasicParserTest.java Wed Aug 12 09:59:18 2009
@@ -1,3 +1,21 @@
+/****************************************************************
+* Licensed to the Apache Software Foundation (ASF) under one *
+* or more contributor license agreements. See the NOTICE file *
+* distributed with this work for additional information *
+* regarding copyright ownership. The ASF licenses this file *
+* to you under the Apache License, Version 2.0 (the *
+* "License"); you may not use this file except in compliance *
+* with the License. You may obtain a copy of the License at *
+* *
+* http://www.apache.org/licenses/LICENSE-2.0 *
+* *
+* Unless required by applicable law or agreed to in writing, *
+* software distributed under the License is distributed on an *
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+* KIND, either express or implied. See the License for the *
+* specific language governing permissions and limitations *
+* under the License. *
+****************************************************************/
package org.apache.labs.esqueranto.test;
@@ -69,6 +87,26 @@
};
test(q,t);
}
+
+ //Test some compound boolean operators.
+ @Test
+ public void compoundBooleanExpressions() throws Exception {
+ String[] q = {
+ "(cat or dog or squirrel)",
+ "(cat or (dog and squirrel))",
+ "(cat or dog or (squirrel and chipmunk and tree))"
+ };
+ String[] t = {
+ "(OR (OR cat dog) squirrel)",
+ "(OR cat (AND dog squirrel))",
+ "(OR (OR cat dog) (AND (AND squirrel chipmunk) tree))"
+
+ };
+ test(q,t);
+
+ }
+
+
private void test(String[] queries, String[] tree) throws Exception {
if(queries == null || tree == null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org