[jboss-svn-commits] JBL Code SVN: r10524 - in labs/jbossrules/trunk/drools-compiler/src: main/java/org/drools/clp/functions and 3 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Mar 24 22:44:35 EDT 2007
Author: mark.proctor at jboss.com
Date: 2007-03-24 22:44:34 -0400 (Sat, 24 Mar 2007)
New Revision: 10524
Modified:
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BlockExecutionEngine.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BuiltinFunctions.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPEval.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPLexer.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPParser.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPPredicate.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPReturnValue.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Deffunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionBuildContext.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionEngine.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExpressionExecutionEngine.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Function.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionDelegator.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionRegistry.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/GeneralParseException.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispData.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispForm.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispList.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/VariableValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/AddFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BaseFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BindFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/CreateListFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/IfFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/LessThanFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/ModifyFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/MultiplyFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/WhileFunction.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BaseValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BooleanValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPGlobalVariable.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPLocalDeclarationVariable.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPPreviousDeclarationVariable.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/DoubleValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/FunctionCaller.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ListValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LocalVariableValue.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LongValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ObjectValueHandler.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/TempTokenVariable.java
labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/clp/CLP.g
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/AddFunctionTest.java
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/BlockExecutionTest.java
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ClpParserTest.java
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/CompiledParserTest.java
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/DeffunctionTest.java
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ModifyFunctionTest.java
Log:
JBRULES-720 Clips Parser
-refactored to have getValue and getObject, the first always returns a ValueHandler and the later always resolves to a none ValueHandler
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BlockExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BlockExecutionEngine.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BlockExecutionEngine.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -17,27 +17,31 @@
private FunctionCaller[] functions;
- private int index;
+ private int index;
public void addFunction(FunctionCaller function) {
- if (this.functions == null) {
- this.functions = new FunctionCaller[] { function };
+ if ( this.functions == null ) {
+ this.functions = new FunctionCaller[]{function};
} else {
- FunctionCaller[] temp = new FunctionCaller[ functions.length + 1 ];
- System.arraycopy( this.functions, 0, temp, 0, this.functions.length );
- temp[ temp.length - 1] = function;
- this.functions = temp;
- }
- }
-
+ FunctionCaller[] temp = new FunctionCaller[functions.length + 1];
+ System.arraycopy( this.functions,
+ 0,
+ temp,
+ 0,
+ this.functions.length );
+ temp[temp.length - 1] = function;
+ this.functions = temp;
+ }
+ }
+
public FunctionCaller[] getFunctions() {
return this.functions;
- }
+ }
public int getNextIndex() {
- return this.index++;
- }
-
+ return this.index++;
+ }
+
public void execute(InternalWorkingMemory workingMemory,
ReteTuple tuple,
Object object) {
@@ -58,7 +62,7 @@
if ( this.functions == null ) {
return;
}
-
+
for ( int i = 0, length = functions.length; i < length; i++ ) {
this.functions[i].getValue( context );
}
@@ -68,7 +72,7 @@
WorkingMemory workingMemory) throws Exception {
ExecutionContext context = new ExecutionContext( (InternalWorkingMemory) workingMemory,
(ReteTuple) knowledgeHelper.getTuple(),
- this.index -1 );
+ this.index - 1 );
execute( context );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BuiltinFunctions.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BuiltinFunctions.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/BuiltinFunctions.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -8,16 +8,16 @@
public class BuiltinFunctions {
public static final BuiltinFunctions instance = new BuiltinFunctions();
-
+
public static BuiltinFunctions getInstance() {
return instance;
}
-
+
public Map functions;
-
+
private BuiltinFunctions() {
this.functions = new HashMap();
-
+
try {
loadFunctions();
} catch ( IOException e ) {
@@ -25,30 +25,33 @@
} catch ( ClassNotFoundException e ) {
throw new RuntimeException( e );
}
- }
-
- public void loadFunctions() throws IOException, ClassNotFoundException {
+ }
+
+ public void loadFunctions() throws IOException,
+ ClassNotFoundException {
BufferedReader reader = new BufferedReader( new InputStreamReader( getClass().getResourceAsStream( "functions.conf" ) ) );
loadFunctions( reader );
}
-
- public void loadFunctions(BufferedReader reader) throws IOException, ClassNotFoundException {
- String line = null;
-
+
+ public void loadFunctions(BufferedReader reader) throws IOException,
+ ClassNotFoundException {
+ String line = null;
+
try {
- while( (line = reader.readLine() ) != null ) {
+ while ( (line = reader.readLine()) != null ) {
Class clazz = getClass().getClassLoader().loadClass( line );
- Function function = ( Function) clazz.newInstance();
- this.functions.put( function.getName(), function );
+ Function function = (Function) clazz.newInstance();
+ this.functions.put( function.getName(),
+ function );
}
- } catch(IllegalAccessException e) {
- throw new RuntimeException( e );
- } catch(InstantiationException e) {
+ } catch ( IllegalAccessException e ) {
throw new RuntimeException( e );
+ } catch ( InstantiationException e ) {
+ throw new RuntimeException( e );
}
}
-
+
public Function getFunction(String name) {
- return ( Function ) this.functions.get( name );
+ return (Function) this.functions.get( name );
}
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPEval.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPEval.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPEval.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -18,12 +18,12 @@
EvalExpression,
ExecutionEngine {
private FunctionCaller function;
- private int index;
-
+ private int index;
+
public CLPEval() {
-
+
}
-
+
public CLPEval(FunctionCaller function) {
this.function = function;
}
@@ -33,28 +33,28 @@
}
public void addFunction(FunctionCaller function) {
- setFunction( function );
+ setFunction( function );
}
-
+
public FunctionCaller[] getFunctions() {
- return new FunctionCaller[] { this.function };
- }
-
+ return new FunctionCaller[]{this.function};
+ }
+
public int getNextIndex() {
- return this.index++;
- }
-
+ return this.index++;
+ }
+
public boolean evaluate(Tuple tuple,
Declaration[] requiredDeclarations,
WorkingMemory workingMemory) throws Exception {
ExecutionContext context = new ExecutionContext( (InternalWorkingMemory) workingMemory,
(ReteTuple) tuple,
- this.index-1 );
+ this.index - 1 );
return this.function.getBooleanValue( context );
}
-
+
public void replaceTempTokens(Map variables) {
this.function.replaceTempTokens( variables );
- }
+ }
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPLexer.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPLexer.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPLexer.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,62 +1,74 @@
-// $ANTLR 3.0b7 C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2007-03-24 19:53:23
-
- package org.drools.clp;
+// $ANTLR 3.0b7 C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2007-03-24 20:05:52
+package org.drools.clp;
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
import java.util.HashMap;
+
+import org.antlr.runtime.BaseRecognizer;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.DFA;
+import org.antlr.runtime.EarlyExitException;
+import org.antlr.runtime.Lexer;
+import org.antlr.runtime.MismatchedSetException;
+import org.antlr.runtime.NoViableAltException;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.Token;
+
public class CLPLexer extends Lexer {
- public static final int EXISTS=14;
- public static final int LEFT_PAREN=4;
- public static final int RIGHT_CURLY=39;
- public static final int BOOL=24;
- public static final int DEFRULE=5;
- public static final int HexDigit=30;
- public static final int WS=27;
- public static final int STRING=7;
- public static final int FLOAT=23;
- public static final int TILDE=20;
- public static final int OR=12;
- public static final int PIPE=19;
- public static final int EQUALS=22;
- public static final int VAR=16;
- public static final int ASSIGN_OP=17;
- public static final int AND=11;
- public static final int UnicodeEscape=31;
- public static final int EscapeSequence=29;
- public static final int INT=10;
- public static final int EOF=-1;
- public static final int NULL=25;
- public static final int EOL=26;
- public static final int SYMBOL=33;
- public static final int LEFT_SQUARE=36;
- public static final int Tokens=42;
- public static final int COLON=21;
- public static final int SALIENCE=9;
- public static final int OctalEscape=32;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=34;
- public static final int MULTI_LINE_COMMENT=40;
- public static final int AMPERSAND=18;
- public static final int TEST=15;
- public static final int NAME=6;
- public static final int T41=41;
- public static final int NOT=13;
- public static final int RIGHT_PAREN=8;
- public static final int DECLARE=28;
- public static final int LEFT_CURLY=38;
- public static final int RIGHT_SQUARE=37;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=35;
- public CLPLexer() {;}
+ public static final int EXISTS = 14;
+ public static final int LEFT_PAREN = 4;
+ public static final int RIGHT_CURLY = 39;
+ public static final int BOOL = 24;
+ public static final int DEFRULE = 5;
+ public static final int HexDigit = 30;
+ public static final int WS = 27;
+ public static final int STRING = 7;
+ public static final int FLOAT = 23;
+ public static final int TILDE = 20;
+ public static final int OR = 12;
+ public static final int PIPE = 19;
+ public static final int EQUALS = 22;
+ public static final int VAR = 16;
+ public static final int ASSIGN_OP = 17;
+ public static final int AND = 11;
+ public static final int UnicodeEscape = 31;
+ public static final int EscapeSequence = 29;
+ public static final int INT = 10;
+ public static final int EOF = -1;
+ public static final int NULL = 25;
+ public static final int EOL = 26;
+ public static final int SYMBOL = 33;
+ public static final int LEFT_SQUARE = 36;
+ public static final int Tokens = 42;
+ public static final int COLON = 21;
+ public static final int SALIENCE = 9;
+ public static final int OctalEscape = 32;
+ public static final int SH_STYLE_SINGLE_LINE_COMMENT = 34;
+ public static final int MULTI_LINE_COMMENT = 40;
+ public static final int AMPERSAND = 18;
+ public static final int TEST = 15;
+ public static final int NAME = 6;
+ public static final int T41 = 41;
+ public static final int NOT = 13;
+ public static final int RIGHT_PAREN = 8;
+ public static final int DECLARE = 28;
+ public static final int LEFT_CURLY = 38;
+ public static final int RIGHT_SQUARE = 37;
+ public static final int C_STYLE_SINGLE_LINE_COMMENT = 35;
+
+ public CLPLexer() {
+ ;
+ }
+
public CLPLexer(CharStream input) {
- super(input);
- ruleMemo = new HashMap[40+1];
- }
- public String getGrammarFileName() { return "C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g"; }
+ super( input );
+ ruleMemo = new HashMap[40 + 1];
+ }
+ public String getGrammarFileName() {
+ return "C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g";
+ }
+
// $ANTLR start T41
public void mT41() throws RecognitionException {
try {
@@ -69,25 +81,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:6:7: ( '=>' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:6:7: '=>'
{
- match("=>"); if (failed) return ;
+ match( "=>" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end T41
// $ANTLR start WS
@@ -102,82 +117,94 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:17: ( ( ' ' | '\\t' | '\\f' | EOL ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:17: ( ' ' | '\\t' | '\\f' | EOL )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:17: ( ' ' | '\\t' | '\\f' | EOL )
- int alt1=4;
- switch ( input.LA(1) ) {
- case ' ':
- alt1=1;
- break;
- case '\t':
- alt1=2;
- break;
- case '\f':
- alt1=3;
- break;
- case '\n':
- case '\r':
- alt1=4;
- break;
- default:
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("554:17: ( ' ' | '\\t' | '\\f' | EOL )", 1, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:17: ( ' ' | '\\t' | '\\f' | EOL )
+ int alt1 = 4;
+ switch ( input.LA( 1 ) ) {
+ case ' ' :
+ alt1 = 1;
+ break;
+ case '\t' :
+ alt1 = 2;
+ break;
+ case '\f' :
+ alt1 = 3;
+ break;
+ case '\n' :
+ case '\r' :
+ alt1 = 4;
+ break;
+ default :
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "554:17: ( ' ' | '\\t' | '\\f' | EOL )",
+ 1,
+ 0,
+ input );
- throw nvae;
- }
+ throw nvae;
+ }
- switch (alt1) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:19: ' '
+ switch ( alt1 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:19: ' '
{
- match(' '); if (failed) return ;
+ match( ' ' );
+ if ( failed ) return;
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:555:19: '\\t'
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:555:19: '\\t'
{
- match('\t'); if (failed) return ;
+ match( '\t' );
+ if ( failed ) return;
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:556:19: '\\f'
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:556:19: '\\f'
{
- match('\f'); if (failed) return ;
+ match( '\f' );
+ if ( failed ) return;
}
- break;
- case 4 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:557:19: EOL
+ break;
+ case 4 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:557:19: EOL
{
- mEOL(); if (failed) return ;
+ mEOL();
+ if ( failed ) return;
}
- break;
+ break;
- }
+ }
- if ( backtracking==0 ) {
- _channel=HIDDEN;
- }
+ if ( backtracking == 0 ) {
+ _channel = HIDDEN;
+ }
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end WS
// $ANTLR start DEFRULE
@@ -192,25 +219,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:562:11: ( 'defrule' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:562:11: 'defrule'
{
- match("defrule"); if (failed) return ;
+ match( "defrule" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end DEFRULE
// $ANTLR start OR
@@ -225,25 +255,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:563:7: ( 'or' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:563:7: 'or'
{
- match("or"); if (failed) return ;
+ match( "or" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end OR
// $ANTLR start AND
@@ -258,25 +291,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:564:8: ( 'and' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:564:8: 'and'
{
- match("and"); if (failed) return ;
+ match( "and" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end AND
// $ANTLR start NOT
@@ -291,25 +327,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:565:8: ( 'not' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:565:8: 'not'
{
- match("not"); if (failed) return ;
+ match( "not" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end NOT
// $ANTLR start EXISTS
@@ -324,25 +363,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:566:11: ( 'exists' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:566:11: 'exists'
{
- match("exists"); if (failed) return ;
+ match( "exists" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end EXISTS
// $ANTLR start TEST
@@ -357,25 +399,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:567:9: ( 'test' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:567:9: 'test'
{
- match("test"); if (failed) return ;
+ match( "test" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end TEST
// $ANTLR start NULL
@@ -390,25 +435,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:569:8: ( 'null' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:569:8: 'null'
{
- match("null"); if (failed) return ;
+ match( "null" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end NULL
// $ANTLR start DECLARE
@@ -423,25 +471,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:571:11: ( 'declare' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:571:11: 'declare'
{
- match("declare"); if (failed) return ;
+ match( "declare" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end DECLARE
// $ANTLR start SALIENCE
@@ -456,25 +507,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:573:11: ( 'salience' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:573:11: 'salience'
{
- match("salience"); if (failed) return ;
+ match( "salience" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end SALIENCE
// $ANTLR start EOL
@@ -484,61 +538,65 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
- int alt2=3;
- int LA2_0 = input.LA(1);
- if ( (LA2_0=='\r') ) {
- int LA2_1 = input.LA(2);
- if ( (LA2_1=='\n') ) {
- alt2=1;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
+ int alt2 = 3;
+ int LA2_0 = input.LA( 1 );
+ if ( (LA2_0 == '\r') ) {
+ int LA2_1 = input.LA( 2 );
+ if ( (LA2_1 == '\n') ) {
+ alt2 = 1;
+ } else {
+ alt2 = 2;
+ }
+ } else if ( (LA2_0 == '\n') ) {
+ alt2 = 3;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "579:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )",
+ 2,
+ 0,
+ input );
+
+ throw nvae;
}
- else {
- alt2=2;}
- }
- else if ( (LA2_0=='\n') ) {
- alt2=3;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("579:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
-
- throw nvae;
- }
- switch (alt2) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:14: ( '\\r\\n' )=> '\\r\\n'
+ switch ( alt2 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:14: ( '\\r\\n' )=> '\\r\\n'
{
- match("\r\n"); if (failed) return ;
+ match( "\r\n" );
+ if ( failed ) return;
-
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:580:25: '\\r'
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:580:25: '\\r'
{
- match('\r'); if (failed) return ;
+ match( '\r' );
+ if ( failed ) return;
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:581:25: '\\n'
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:581:25: '\\n'
{
- match('\n'); if (failed) return ;
+ match( '\n' );
+ if ( failed ) return;
}
- break;
+ break;
- }
+ }
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end EOL
// $ANTLR start INT
@@ -553,70 +611,76 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:4: ( ( '-' )? ( '0' .. '9' )+ )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:4: ( '-' )? ( '0' .. '9' )+
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:4: ( '-' )?
- int alt3=2;
- int LA3_0 = input.LA(1);
- if ( (LA3_0=='-') ) {
- alt3=1;
- }
- switch (alt3) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:5: '-'
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:4: ( '-' )?
+ int alt3 = 2;
+ int LA3_0 = input.LA( 1 );
+ if ( (LA3_0 == '-') ) {
+ alt3 = 1;
+ }
+ switch ( alt3 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:5: '-'
{
- match('-'); if (failed) return ;
+ match( '-' );
+ if ( failed ) return;
}
- break;
+ break;
- }
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:10: ( '0' .. '9' )+
- int cnt4=0;
- loop4:
- do {
- int alt4=2;
- int LA4_0 = input.LA(1);
- if ( ((LA4_0>='0' && LA4_0<='9')) ) {
- alt4=1;
}
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:10: ( '0' .. '9' )+
+ int cnt4 = 0;
+ loop4 : do {
+ int alt4 = 2;
+ int LA4_0 = input.LA( 1 );
+ if ( ((LA4_0 >= '0' && LA4_0 <= '9')) ) {
+ alt4 = 1;
+ }
- switch (alt4) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:11: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
+ switch ( alt4 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:586:11: '0' .. '9'
+ {
+ matchRange( '0',
+ '9' );
+ if ( failed ) return;
- }
- break;
+ }
+ break;
- default :
- if ( cnt4 >= 1 ) break loop4;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(4, input);
- throw eee;
- }
- cnt4++;
- } while (true);
+ default :
+ if ( cnt4 >= 1 ) break loop4;
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ EarlyExitException eee = new EarlyExitException( 4,
+ input );
+ throw eee;
+ }
+ cnt4++;
+ } while ( true );
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end INT
// $ANTLR start FLOAT
@@ -631,101 +695,111 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:4: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:4: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:4: ( '-' )?
- int alt5=2;
- int LA5_0 = input.LA(1);
- if ( (LA5_0=='-') ) {
- alt5=1;
- }
- switch (alt5) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:5: '-'
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:4: ( '-' )?
+ int alt5 = 2;
+ int LA5_0 = input.LA( 1 );
+ if ( (LA5_0 == '-') ) {
+ alt5 = 1;
+ }
+ switch ( alt5 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:5: '-'
{
- match('-'); if (failed) return ;
+ match( '-' );
+ if ( failed ) return;
}
- break;
+ break;
- }
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:10: ( '0' .. '9' )+
- int cnt6=0;
- loop6:
- do {
- int alt6=2;
- int LA6_0 = input.LA(1);
- if ( ((LA6_0>='0' && LA6_0<='9')) ) {
- alt6=1;
}
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:10: ( '0' .. '9' )+
+ int cnt6 = 0;
+ loop6 : do {
+ int alt6 = 2;
+ int LA6_0 = input.LA( 1 );
+ if ( ((LA6_0 >= '0' && LA6_0 <= '9')) ) {
+ alt6 = 1;
+ }
- switch (alt6) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:11: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
+ switch ( alt6 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:11: '0' .. '9'
+ {
+ matchRange( '0',
+ '9' );
+ if ( failed ) return;
- }
- break;
+ }
+ break;
- default :
- if ( cnt6 >= 1 ) break loop6;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(6, input);
- throw eee;
- }
- cnt6++;
- } while (true);
+ default :
+ if ( cnt6 >= 1 ) break loop6;
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ EarlyExitException eee = new EarlyExitException( 6,
+ input );
+ throw eee;
+ }
+ cnt6++;
+ } while ( true );
- match('.'); if (failed) return ;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:26: ( '0' .. '9' )+
- int cnt7=0;
- loop7:
- do {
- int alt7=2;
- int LA7_0 = input.LA(1);
- if ( ((LA7_0>='0' && LA7_0<='9')) ) {
- alt7=1;
- }
+ match( '.' );
+ if ( failed ) return;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:26: ( '0' .. '9' )+
+ int cnt7 = 0;
+ loop7 : do {
+ int alt7 = 2;
+ int LA7_0 = input.LA( 1 );
+ if ( ((LA7_0 >= '0' && LA7_0 <= '9')) ) {
+ alt7 = 1;
+ }
+ switch ( alt7 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:27: '0' .. '9'
+ {
+ matchRange( '0',
+ '9' );
+ if ( failed ) return;
- switch (alt7) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:27: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
+ }
+ break;
- }
- break;
+ default :
+ if ( cnt7 >= 1 ) break loop7;
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ EarlyExitException eee = new EarlyExitException( 7,
+ input );
+ throw eee;
+ }
+ cnt7++;
+ } while ( true );
- default :
- if ( cnt7 >= 1 ) break loop7;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(7, input);
- throw eee;
- }
- cnt7++;
- } while (true);
-
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end FLOAT
// $ANTLR start STRING
@@ -738,154 +812,163 @@
int _charPosition = getCharPositionInLine();
int _channel = Token.DEFAULT_CHANNEL;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:8: ( ( '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"' ) | ( '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\'' ) )
- int alt10=2;
- int LA10_0 = input.LA(1);
- if ( (LA10_0=='\"') ) {
- alt10=1;
- }
- else if ( (LA10_0=='\'') ) {
- alt10=2;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("593:1: STRING : ( ( '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"' ) | ( '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\'' ) );", 10, 0, input);
+ int alt10 = 2;
+ int LA10_0 = input.LA( 1 );
+ if ( (LA10_0 == '\"') ) {
+ alt10 = 1;
+ } else if ( (LA10_0 == '\'') ) {
+ alt10 = 2;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "593:1: STRING : ( ( '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"' ) | ( '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\'' ) );",
+ 10,
+ 0,
+ input );
throw nvae;
}
- switch (alt10) {
+ switch ( alt10 ) {
case 1 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:8: ( '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"' )
- {
+ {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:8: ( '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:9: '\"' ( EscapeSequence | ~ ('\\\\'|'\"'))* '\"'
{
- match('\"'); if (failed) return ;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:13: ( EscapeSequence | ~ ('\\\\'|'\"'))*
- loop8:
- do {
- int alt8=3;
- int LA8_0 = input.LA(1);
- if ( (LA8_0=='\\') ) {
- alt8=1;
- }
- else if ( ((LA8_0>='\u0000' && LA8_0<='!')||(LA8_0>='#' && LA8_0<='[')||(LA8_0>=']' && LA8_0<='\uFFFE')) ) {
- alt8=2;
- }
+ match( '\"' );
+ if ( failed ) return;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:13: ( EscapeSequence | ~ ('\\\\'|'\"'))*
+ loop8 : do {
+ int alt8 = 3;
+ int LA8_0 = input.LA( 1 );
+ if ( (LA8_0 == '\\') ) {
+ alt8 = 1;
+ } else if ( ((LA8_0 >= '\u0000' && LA8_0 <= '!') || (LA8_0 >= '#' && LA8_0 <= '[') || (LA8_0 >= ']' && LA8_0 <= '\uFFFE')) ) {
+ alt8 = 2;
+ }
+ switch ( alt8 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:15: EscapeSequence
+ {
+ mEscapeSequence();
+ if ( failed ) return;
- switch (alt8) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:15: EscapeSequence
- {
- mEscapeSequence(); if (failed) return ;
+ }
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:32: ~ ('\\\\'|'\"')
+ {
+ if ( (input.LA( 1 ) >= '\u0000' && input.LA( 1 ) <= '!') || (input.LA( 1 ) >= '#' && input.LA( 1 ) <= '[') || (input.LA( 1 ) >= ']' && input.LA( 1 ) <= '\uFFFE') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
- }
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:594:32: ~ ('\\\\'|'\"')
- {
- if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ }
+ break;
+ default :
+ break loop8;
+ }
+ } while ( true );
- }
- break;
+ match( '\"' );
+ if ( failed ) return;
- default :
- break loop8;
- }
- } while (true);
-
- match('\"'); if (failed) return ;
-
}
-
- }
+ }
break;
case 2 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:8: ( '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\'' )
- {
+ {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:8: ( '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\'' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:9: '\\'' ( EscapeSequence | ~ ('\\\\'|'\\''))* '\\''
{
- match('\''); if (failed) return ;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:14: ( EscapeSequence | ~ ('\\\\'|'\\''))*
- loop9:
- do {
- int alt9=3;
- int LA9_0 = input.LA(1);
- if ( (LA9_0=='\\') ) {
- alt9=1;
- }
- else if ( ((LA9_0>='\u0000' && LA9_0<='&')||(LA9_0>='(' && LA9_0<='[')||(LA9_0>=']' && LA9_0<='\uFFFE')) ) {
- alt9=2;
- }
+ match( '\'' );
+ if ( failed ) return;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:14: ( EscapeSequence | ~ ('\\\\'|'\\''))*
+ loop9 : do {
+ int alt9 = 3;
+ int LA9_0 = input.LA( 1 );
+ if ( (LA9_0 == '\\') ) {
+ alt9 = 1;
+ } else if ( ((LA9_0 >= '\u0000' && LA9_0 <= '&') || (LA9_0 >= '(' && LA9_0 <= '[') || (LA9_0 >= ']' && LA9_0 <= '\uFFFE')) ) {
+ alt9 = 2;
+ }
+ switch ( alt9 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:16: EscapeSequence
+ {
+ mEscapeSequence();
+ if ( failed ) return;
- switch (alt9) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:16: EscapeSequence
- {
- mEscapeSequence(); if (failed) return ;
+ }
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:33: ~ ('\\\\'|'\\'')
+ {
+ if ( (input.LA( 1 ) >= '\u0000' && input.LA( 1 ) <= '&') || (input.LA( 1 ) >= '(' && input.LA( 1 ) <= '[') || (input.LA( 1 ) >= ']' && input.LA( 1 ) <= '\uFFFE') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
- }
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:33: ~ ('\\\\'|'\\'')
- {
- if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ }
+ break;
+ default :
+ break loop9;
+ }
+ } while ( true );
- }
- break;
+ match( '\'' );
+ if ( failed ) return;
- default :
- break loop9;
- }
- } while (true);
-
- match('\''); if (failed) return ;
-
}
-
- }
+ }
break;
}
- if ( backtracking==0 ) {
+ if ( backtracking == 0 ) {
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end STRING
// $ANTLR start HexDigit
@@ -895,25 +978,27 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:599:12: ( ('0'..'9'|'a'..'f'|'A'..'F'))
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:599:12: ('0'..'9'|'a'..'f'|'A'..'F')
{
- if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ if ( (input.LA( 1 ) >= '0' && input.LA( 1 ) <= '9') || (input.LA( 1 ) >= 'A' && input.LA( 1 ) <= 'F') || (input.LA( 1 ) >= 'a' && input.LA( 1 ) <= 'f') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end HexDigit
// $ANTLR start EscapeSequence
@@ -921,89 +1006,103 @@
try {
ruleNestingLevel++;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:603:9: ( '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\') | UnicodeEscape | OctalEscape )
- int alt11=3;
- int LA11_0 = input.LA(1);
- if ( (LA11_0=='\\') ) {
- switch ( input.LA(2) ) {
- case 'u':
- alt11=2;
- break;
- case '\"':
- case '\'':
- case '\\':
- case 'b':
- case 'f':
- case 'n':
- case 'r':
- case 't':
- alt11=1;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- alt11=3;
- break;
- default:
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("601:1: fragment EscapeSequence : ( '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\') | UnicodeEscape | OctalEscape );", 11, 1, input);
+ int alt11 = 3;
+ int LA11_0 = input.LA( 1 );
+ if ( (LA11_0 == '\\') ) {
+ switch ( input.LA( 2 ) ) {
+ case 'u' :
+ alt11 = 2;
+ break;
+ case '\"' :
+ case '\'' :
+ case '\\' :
+ case 'b' :
+ case 'f' :
+ case 'n' :
+ case 'r' :
+ case 't' :
+ alt11 = 1;
+ break;
+ case '0' :
+ case '1' :
+ case '2' :
+ case '3' :
+ case '4' :
+ case '5' :
+ case '6' :
+ case '7' :
+ alt11 = 3;
+ break;
+ default :
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "601:1: fragment EscapeSequence : ( '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\') | UnicodeEscape | OctalEscape );",
+ 11,
+ 1,
+ input );
- throw nvae;
+ throw nvae;
}
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("601:1: fragment EscapeSequence : ( '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\') | UnicodeEscape | OctalEscape );", 11, 0, input);
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "601:1: fragment EscapeSequence : ( '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\') | UnicodeEscape | OctalEscape );",
+ 11,
+ 0,
+ input );
throw nvae;
}
- switch (alt11) {
+ switch ( alt11 ) {
case 1 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:603:9: '\\\\' ('b'|'t'|'n'|'f'|'r'|'\\\"'|'\\''|'\\\\')
- {
- match('\\'); if (failed) return ;
- if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
+ {
+ match( '\\' );
+ if ( failed ) return;
+ if ( input.LA( 1 ) == '\"' || input.LA( 1 ) == '\'' || input.LA( 1 ) == '\\' || input.LA( 1 ) == 'b' || input.LA( 1 ) == 'f' || input.LA( 1 ) == 'n' || input.LA( 1 ) == 'r' || input.LA( 1 ) == 't' ) {
input.consume();
- failed=false;
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
}
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
- }
+ }
break;
case 2 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:604:9: UnicodeEscape
- {
- mUnicodeEscape(); if (failed) return ;
+ {
+ mUnicodeEscape();
+ if ( failed ) return;
- }
+ }
break;
case 3 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:605:9: OctalEscape
- {
- mOctalEscape(); if (failed) return ;
+ {
+ mOctalEscape();
+ if ( failed ) return;
- }
+ }
break;
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end EscapeSequence
// $ANTLR start OctalEscape
@@ -1011,117 +1110,136 @@
try {
ruleNestingLevel++;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:9: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
- int alt12=3;
- int LA12_0 = input.LA(1);
- if ( (LA12_0=='\\') ) {
- int LA12_1 = input.LA(2);
- if ( ((LA12_1>='0' && LA12_1<='3')) ) {
- int LA12_2 = input.LA(3);
- if ( ((LA12_2>='0' && LA12_2<='7')) ) {
- int LA12_5 = input.LA(4);
- if ( ((LA12_5>='0' && LA12_5<='7')) ) {
- alt12=1;
+ int alt12 = 3;
+ int LA12_0 = input.LA( 1 );
+ if ( (LA12_0 == '\\') ) {
+ int LA12_1 = input.LA( 2 );
+ if ( ((LA12_1 >= '0' && LA12_1 <= '3')) ) {
+ int LA12_2 = input.LA( 3 );
+ if ( ((LA12_2 >= '0' && LA12_2 <= '7')) ) {
+ int LA12_5 = input.LA( 4 );
+ if ( ((LA12_5 >= '0' && LA12_5 <= '7')) ) {
+ alt12 = 1;
+ } else {
+ alt12 = 2;
}
- else {
- alt12=2;}
+ } else {
+ alt12 = 3;
}
- else {
- alt12=3;}
- }
- else if ( ((LA12_1>='4' && LA12_1<='7')) ) {
- int LA12_3 = input.LA(3);
- if ( ((LA12_3>='0' && LA12_3<='7')) ) {
- alt12=2;
+ } else if ( ((LA12_1 >= '4' && LA12_1 <= '7')) ) {
+ int LA12_3 = input.LA( 3 );
+ if ( ((LA12_3 >= '0' && LA12_3 <= '7')) ) {
+ alt12 = 2;
+ } else {
+ alt12 = 3;
}
- else {
- alt12=3;}
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("608:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 1, input);
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "608:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );",
+ 12,
+ 1,
+ input );
throw nvae;
}
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("608:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 0, input);
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "608:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );",
+ 12,
+ 0,
+ input );
throw nvae;
}
- switch (alt12) {
+ switch ( alt12 ) {
case 1 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
+ {
+ match( '\\' );
+ if ( failed ) return;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:14: ( '0' .. '3' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:15: '0' .. '3'
{
- matchRange('0','3'); if (failed) return ;
+ matchRange( '0',
+ '3' );
+ if ( failed ) return;
}
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:25: ( '0' .. '7' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:26: '0' .. '7'
{
- matchRange('0','7'); if (failed) return ;
+ matchRange( '0',
+ '7' );
+ if ( failed ) return;
}
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:36: ( '0' .. '7' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:610:37: '0' .. '7'
{
- matchRange('0','7'); if (failed) return ;
+ matchRange( '0',
+ '7' );
+ if ( failed ) return;
}
-
- }
+ }
break;
case 2 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:611:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
+ {
+ match( '\\' );
+ if ( failed ) return;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:611:14: ( '0' .. '7' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:611:15: '0' .. '7'
{
- matchRange('0','7'); if (failed) return ;
+ matchRange( '0',
+ '7' );
+ if ( failed ) return;
}
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:611:25: ( '0' .. '7' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:611:26: '0' .. '7'
{
- matchRange('0','7'); if (failed) return ;
+ matchRange( '0',
+ '7' );
+ if ( failed ) return;
}
-
- }
+ }
break;
case 3 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:612:9: '\\\\' ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
+ {
+ match( '\\' );
+ if ( failed ) return;
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:612:14: ( '0' .. '7' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:612:15: '0' .. '7'
{
- matchRange('0','7'); if (failed) return ;
+ matchRange( '0',
+ '7' );
+ if ( failed ) return;
}
-
- }
+ }
break;
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end OctalEscape
// $ANTLR start UnicodeEscape
@@ -1131,20 +1249,26 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:617:9: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:617:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
{
- match('\\'); if (failed) return ;
- match('u'); if (failed) return ;
- mHexDigit(); if (failed) return ;
- mHexDigit(); if (failed) return ;
- mHexDigit(); if (failed) return ;
- mHexDigit(); if (failed) return ;
+ match( '\\' );
+ if ( failed ) return;
+ match( 'u' );
+ if ( failed ) return;
+ mHexDigit();
+ if ( failed ) return;
+ mHexDigit();
+ if ( failed ) return;
+ mHexDigit();
+ if ( failed ) return;
+ mHexDigit();
+ if ( failed ) return;
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end UnicodeEscape
// $ANTLR start BOOL
@@ -1159,59 +1283,64 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:4: ( ( 'true' | 'false' ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:4: ( 'true' | 'false' )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:4: ( 'true' | 'false' )
- int alt13=2;
- int LA13_0 = input.LA(1);
- if ( (LA13_0=='t') ) {
- alt13=1;
- }
- else if ( (LA13_0=='f') ) {
- alt13=2;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("621:4: ( 'true' | 'false' )", 13, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:4: ( 'true' | 'false' )
+ int alt13 = 2;
+ int LA13_0 = input.LA( 1 );
+ if ( (LA13_0 == 't') ) {
+ alt13 = 1;
+ } else if ( (LA13_0 == 'f') ) {
+ alt13 = 2;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "621:4: ( 'true' | 'false' )",
+ 13,
+ 0,
+ input );
- throw nvae;
- }
- switch (alt13) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:5: 'true'
+ throw nvae;
+ }
+ switch ( alt13 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:5: 'true'
{
- match("true"); if (failed) return ;
+ match( "true" );
+ if ( failed ) return;
-
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:12: 'false'
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:621:12: 'false'
{
- match("false"); if (failed) return ;
+ match( "false" );
+ if ( failed ) return;
-
}
- break;
+ break;
- }
+ }
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end BOOL
// $ANTLR start VAR
@@ -1226,59 +1355,65 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:8: ( '?' ('a'..'z'|'A'..'Z'|'_'|'$') ( SYMBOL )* )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:8: '?' ('a'..'z'|'A'..'Z'|'_'|'$') ( SYMBOL )*
{
- match('?'); if (failed) return ;
- if ( input.LA(1)=='$'||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:38: ( SYMBOL )*
- loop14:
- do {
- int alt14=2;
- int LA14_0 = input.LA(1);
- if ( ((LA14_0>='\u0000' && LA14_0<='\b')||(LA14_0>='\u000B' && LA14_0<='\f')||(LA14_0>='\u000E' && LA14_0<='\u001F')||LA14_0=='!'||(LA14_0>='#' && LA14_0<='%')||LA14_0=='\''||(LA14_0>='*' && LA14_0<=':')||(LA14_0>='<' && LA14_0<='>')||(LA14_0>='@' && LA14_0<='{')||LA14_0=='}'||(LA14_0>='\u007F' && LA14_0<='\uFFFE')) ) {
- alt14=1;
+ match( '?' );
+ if ( failed ) return;
+ if ( input.LA( 1 ) == '$' || (input.LA( 1 ) >= 'A' && input.LA( 1 ) <= 'Z') || input.LA( 1 ) == '_' || (input.LA( 1 ) >= 'a' && input.LA( 1 ) <= 'z') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
}
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:38: ( SYMBOL )*
+ loop14 : do {
+ int alt14 = 2;
+ int LA14_0 = input.LA( 1 );
+ if ( ((LA14_0 >= '\u0000' && LA14_0 <= '\b') || (LA14_0 >= '\u000B' && LA14_0 <= '\f') || (LA14_0 >= '\u000E' && LA14_0 <= '\u001F') || LA14_0 == '!' || (LA14_0 >= '#' && LA14_0 <= '%') || LA14_0 == '\''
+ || (LA14_0 >= '*' && LA14_0 <= ':') || (LA14_0 >= '<' && LA14_0 <= '>') || (LA14_0 >= '@' && LA14_0 <= '{') || LA14_0 == '}' || (LA14_0 >= '\u007F' && LA14_0 <= '\uFFFE')) ) {
+ alt14 = 1;
+ }
- switch (alt14) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:38: SYMBOL
- {
- mSYMBOL(); if (failed) return ;
+ switch ( alt14 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:624:38: SYMBOL
+ {
+ mSYMBOL();
+ if ( failed ) return;
- }
- break;
+ }
+ break;
- default :
- break loop14;
- }
- } while (true);
+ default :
+ break loop14;
+ }
+ } while ( true );
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end VAR
// $ANTLR start SH_STYLE_SINGLE_LINE_COMMENT
@@ -1293,58 +1428,60 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:4: ( '#' ( options {greedy=false; } : . )* EOL )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:4: '#' ( options {greedy=false; } : . )* EOL
{
- match('#'); if (failed) return ;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:8: ( options {greedy=false; } : . )*
- loop15:
- do {
- int alt15=2;
- int LA15_0 = input.LA(1);
- if ( (LA15_0=='\r') ) {
- alt15=2;
- }
- else if ( (LA15_0=='\n') ) {
- alt15=2;
- }
- else if ( ((LA15_0>='\u0000' && LA15_0<='\t')||(LA15_0>='\u000B' && LA15_0<='\f')||(LA15_0>='\u000E' && LA15_0<='\uFFFE')) ) {
- alt15=1;
- }
+ match( '#' );
+ if ( failed ) return;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:8: ( options {greedy=false; } : . )*
+ loop15 : do {
+ int alt15 = 2;
+ int LA15_0 = input.LA( 1 );
+ if ( (LA15_0 == '\r') ) {
+ alt15 = 2;
+ } else if ( (LA15_0 == '\n') ) {
+ alt15 = 2;
+ } else if ( ((LA15_0 >= '\u0000' && LA15_0 <= '\t') || (LA15_0 >= '\u000B' && LA15_0 <= '\f') || (LA15_0 >= '\u000E' && LA15_0 <= '\uFFFE')) ) {
+ alt15 = 1;
+ }
+ switch ( alt15 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:35: .
+ {
+ matchAny();
+ if ( failed ) return;
- switch (alt15) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:628:35: .
- {
- matchAny(); if (failed) return ;
+ }
+ break;
- }
- break;
+ default :
+ break loop15;
+ }
+ } while ( true );
- default :
- break loop15;
+ mEOL();
+ if ( failed ) return;
+ if ( backtracking == 0 ) {
+ _channel = HIDDEN;
}
- } while (true);
- mEOL(); if (failed) return ;
- if ( backtracking==0 ) {
- _channel=HIDDEN;
}
- }
+ if ( backtracking == 0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( backtracking==0 ) {
-
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end SH_STYLE_SINGLE_LINE_COMMENT
// $ANTLR start C_STYLE_SINGLE_LINE_COMMENT
@@ -1359,59 +1496,61 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:4: ( '//' ( options {greedy=false; } : . )* EOL )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:4: '//' ( options {greedy=false; } : . )* EOL
{
- match("//"); if (failed) return ;
+ match( "//" );
+ if ( failed ) return;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:9: ( options {greedy=false; } : . )*
- loop16:
- do {
- int alt16=2;
- int LA16_0 = input.LA(1);
- if ( (LA16_0=='\r') ) {
- alt16=2;
- }
- else if ( (LA16_0=='\n') ) {
- alt16=2;
- }
- else if ( ((LA16_0>='\u0000' && LA16_0<='\t')||(LA16_0>='\u000B' && LA16_0<='\f')||(LA16_0>='\u000E' && LA16_0<='\uFFFE')) ) {
- alt16=1;
- }
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:9: ( options {greedy=false; } : . )*
+ loop16 : do {
+ int alt16 = 2;
+ int LA16_0 = input.LA( 1 );
+ if ( (LA16_0 == '\r') ) {
+ alt16 = 2;
+ } else if ( (LA16_0 == '\n') ) {
+ alt16 = 2;
+ } else if ( ((LA16_0 >= '\u0000' && LA16_0 <= '\t') || (LA16_0 >= '\u000B' && LA16_0 <= '\f') || (LA16_0 >= '\u000E' && LA16_0 <= '\uFFFE')) ) {
+ alt16 = 1;
+ }
+ switch ( alt16 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:36: .
+ {
+ matchAny();
+ if ( failed ) return;
- switch (alt16) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:634:36: .
- {
- matchAny(); if (failed) return ;
+ }
+ break;
- }
- break;
+ default :
+ break loop16;
+ }
+ } while ( true );
- default :
- break loop16;
+ mEOL();
+ if ( failed ) return;
+ if ( backtracking == 0 ) {
+ _channel = HIDDEN;
}
- } while (true);
- mEOL(); if (failed) return ;
- if ( backtracking==0 ) {
- _channel=HIDDEN;
}
- }
+ if ( backtracking == 0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( backtracking==0 ) {
-
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end C_STYLE_SINGLE_LINE_COMMENT
// $ANTLR start LEFT_PAREN
@@ -1426,24 +1565,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:640:4: ( '(' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:640:4: '('
{
- match('('); if (failed) return ;
+ match( '(' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end LEFT_PAREN
// $ANTLR start RIGHT_PAREN
@@ -1458,24 +1601,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:644:4: ( ')' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:644:4: ')'
{
- match(')'); if (failed) return ;
+ match( ')' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end RIGHT_PAREN
// $ANTLR start LEFT_SQUARE
@@ -1490,24 +1637,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:648:4: ( '[' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:648:4: '['
{
- match('['); if (failed) return ;
+ match( '[' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end LEFT_SQUARE
// $ANTLR start RIGHT_SQUARE
@@ -1522,24 +1673,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:652:4: ( ']' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:652:4: ']'
{
- match(']'); if (failed) return ;
+ match( ']' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end RIGHT_SQUARE
// $ANTLR start LEFT_CURLY
@@ -1554,24 +1709,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:656:4: ( '{' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:656:4: '{'
{
- match('{'); if (failed) return ;
+ match( '{' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end LEFT_CURLY
// $ANTLR start RIGHT_CURLY
@@ -1586,24 +1745,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:660:4: ( '}' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:660:4: '}'
{
- match('}'); if (failed) return ;
+ match( '}' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end RIGHT_CURLY
// $ANTLR start TILDE
@@ -1618,24 +1781,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:663:9: ( '~' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:663:9: '~'
{
- match('~'); if (failed) return ;
+ match( '~' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end TILDE
// $ANTLR start AMPERSAND
@@ -1650,24 +1817,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:667:4: ( '&' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:667:4: '&'
{
- match('&'); if (failed) return ;
+ match( '&' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end AMPERSAND
// $ANTLR start PIPE
@@ -1682,24 +1853,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:671:4: ( '|' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:671:4: '|'
{
- match('|'); if (failed) return ;
+ match( '|' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end PIPE
// $ANTLR start ASSIGN_OP
@@ -1714,25 +1889,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:675:4: ( '<-' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:675:4: '<-'
{
- match("<-"); if (failed) return ;
+ match( "<-" );
+ if ( failed ) return;
-
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end ASSIGN_OP
// $ANTLR start COLON
@@ -1747,24 +1925,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:678:9: ( ':' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:678:9: ':'
{
- match(':'); if (failed) return ;
+ match( ':' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end COLON
// $ANTLR start EQUALS
@@ -1779,24 +1961,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:680:10: ( '=' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:680:10: '='
{
- match('='); if (failed) return ;
+ match( '=' );
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end EQUALS
// $ANTLR start MULTI_LINE_COMMENT
@@ -1811,65 +1997,66 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:4: ( '/*' ( options {greedy=false; } : . )* '*/' )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:4: '/*' ( options {greedy=false; } : . )* '*/'
{
- match("/*"); if (failed) return ;
+ match( "/*" );
+ if ( failed ) return;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:9: ( options {greedy=false; } : . )*
- loop17:
- do {
- int alt17=2;
- int LA17_0 = input.LA(1);
- if ( (LA17_0=='*') ) {
- int LA17_1 = input.LA(2);
- if ( (LA17_1=='/') ) {
- alt17=2;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:9: ( options {greedy=false; } : . )*
+ loop17 : do {
+ int alt17 = 2;
+ int LA17_0 = input.LA( 1 );
+ if ( (LA17_0 == '*') ) {
+ int LA17_1 = input.LA( 2 );
+ if ( (LA17_1 == '/') ) {
+ alt17 = 2;
+ } else if ( ((LA17_1 >= '\u0000' && LA17_1 <= '.') || (LA17_1 >= '0' && LA17_1 <= '\uFFFE')) ) {
+ alt17 = 1;
+ }
+
+ } else if ( ((LA17_0 >= '\u0000' && LA17_0 <= ')') || (LA17_0 >= '+' && LA17_0 <= '\uFFFE')) ) {
+ alt17 = 1;
}
- else if ( ((LA17_1>='\u0000' && LA17_1<='.')||(LA17_1>='0' && LA17_1<='\uFFFE')) ) {
- alt17=1;
- }
+ switch ( alt17 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:35: .
+ {
+ matchAny();
+ if ( failed ) return;
- }
- else if ( ((LA17_0>='\u0000' && LA17_0<=')')||(LA17_0>='+' && LA17_0<='\uFFFE')) ) {
- alt17=1;
- }
+ }
+ break;
+ default :
+ break loop17;
+ }
+ } while ( true );
- switch (alt17) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:683:35: .
- {
- matchAny(); if (failed) return ;
+ match( "*/" );
+ if ( failed ) return;
- }
- break;
-
- default :
- break loop17;
+ if ( backtracking == 0 ) {
+ _channel = HIDDEN;
}
- } while (true);
- match("*/"); if (failed) return ;
-
- if ( backtracking==0 ) {
- _channel=HIDDEN;
}
- }
+ if ( backtracking == 0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( backtracking==0 ) {
-
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end MULTI_LINE_COMMENT
// $ANTLR start NAME
@@ -1884,24 +2071,28 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:687:8: ( SYMBOL )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:687:8: SYMBOL
{
- mSYMBOL(); if (failed) return ;
+ mSYMBOL();
+ if ( failed ) return;
}
+ if ( backtracking == 0 ) {
- if ( backtracking==0 ) {
+ if ( token == null && ruleNestingLevel == 1 ) {
+ emit( _type,
+ _line,
+ _charPosition,
+ _channel,
+ _start,
+ getCharIndex() - 1 );
+ }
- if ( token==null && ruleNestingLevel==1 ) {
- emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
- }
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end NAME
// $ANTLR start SYMBOL
@@ -1911,616 +2102,479 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:4: ( ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) ) (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?'))* )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:4: ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) ) (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?'))*
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:4: ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) )
- int alt18=2;
- int LA18_0 = input.LA(1);
- if ( ((LA18_0>='\u0000' && LA18_0<='\b')||(LA18_0>='\u000B' && LA18_0<='\f')||(LA18_0>='\u000E' && LA18_0<='\u001F')||LA18_0=='!'||LA18_0=='#'||LA18_0=='%'||LA18_0=='\''||(LA18_0>='*' && LA18_0<=':')||(LA18_0>='<' && LA18_0<='>')||(LA18_0>='@' && LA18_0<='{')||LA18_0=='}'||(LA18_0>='\u007F' && LA18_0<='\uFFFE')) ) {
- alt18=1;
- }
- else if ( (LA18_0=='$') ) {
- alt18=2;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("691:4: ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) )", 18, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:4: ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) )
+ int alt18 = 2;
+ int LA18_0 = input.LA( 1 );
+ if ( ((LA18_0 >= '\u0000' && LA18_0 <= '\b') || (LA18_0 >= '\u000B' && LA18_0 <= '\f') || (LA18_0 >= '\u000E' && LA18_0 <= '\u001F') || LA18_0 == '!' || LA18_0 == '#' || LA18_0 == '%' || LA18_0 == '\''
+ || (LA18_0 >= '*' && LA18_0 <= ':') || (LA18_0 >= '<' && LA18_0 <= '>') || (LA18_0 >= '@' && LA18_0 <= '{') || LA18_0 == '}' || (LA18_0 >= '\u007F' && LA18_0 <= '\uFFFE')) ) {
+ alt18 = 1;
+ } else if ( (LA18_0 == '$') ) {
+ alt18 = 2;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ NoViableAltException nvae = new NoViableAltException( "691:4: ( (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')) | ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')) )",
+ 18,
+ 0,
+ input );
- throw nvae;
- }
- switch (alt18) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:5: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$'))
+ throw nvae;
+ }
+ switch ( alt18 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:5: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$'))
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:5: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$'))
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:6: ~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')
- {
- if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||input.LA(1)=='!'||input.LA(1)=='#'||input.LA(1)=='%'||input.LA(1)=='\''||(input.LA(1)>='*' && input.LA(1)<=':')||(input.LA(1)>='<' && input.LA(1)<='>')||(input.LA(1)>='@' && input.LA(1)<='{')||input.LA(1)=='}'||(input.LA(1)>='\u007F' && input.LA(1)<='\uFFFE') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:5: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$'))
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:6: ~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'?'|'$')
+ {
+ if ( (input.LA( 1 ) >= '\u0000' && input.LA( 1 ) <= '\b') || (input.LA( 1 ) >= '\u000B' && input.LA( 1 ) <= '\f') || (input.LA( 1 ) >= '\u000E' && input.LA( 1 ) <= '\u001F') || input.LA( 1 ) == '!' || input.LA( 1 ) == '#'
+ || input.LA( 1 ) == '%' || input.LA( 1 ) == '\'' || (input.LA( 1 ) >= '*' && input.LA( 1 ) <= ':') || (input.LA( 1 ) >= '<' && input.LA( 1 ) <= '>') || (input.LA( 1 ) >= '@' && input.LA( 1 ) <= '{')
+ || input.LA( 1 ) == '}' || (input.LA( 1 ) >= '\u007F' && input.LA( 1 ) <= '\uFFFE') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
+ }
}
-
-
- }
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:65: ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'))
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:65: ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'))
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:65: ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'))
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:66: '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')
- {
- match('$'); if (failed) return ;
- if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||input.LA(1)=='!'||(input.LA(1)>='#' && input.LA(1)<='%')||input.LA(1)=='\''||(input.LA(1)>='*' && input.LA(1)<=':')||(input.LA(1)>='=' && input.LA(1)<='>')||(input.LA(1)>='@' && input.LA(1)<='{')||input.LA(1)=='}'||(input.LA(1)>='\u007F' && input.LA(1)<='\uFFFE') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:65: ( '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'))
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:66: '$' ~ ('?'|' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<')
+ {
+ match( '$' );
+ if ( failed ) return;
+ if ( (input.LA( 1 ) >= '\u0000' && input.LA( 1 ) <= '\b') || (input.LA( 1 ) >= '\u000B' && input.LA( 1 ) <= '\f') || (input.LA( 1 ) >= '\u000E' && input.LA( 1 ) <= '\u001F') || input.LA( 1 ) == '!'
+ || (input.LA( 1 ) >= '#' && input.LA( 1 ) <= '%') || input.LA( 1 ) == '\'' || (input.LA( 1 ) >= '*' && input.LA( 1 ) <= ':') || (input.LA( 1 ) >= '=' && input.LA( 1 ) <= '>')
+ || (input.LA( 1 ) >= '@' && input.LA( 1 ) <= '{') || input.LA( 1 ) == '}' || (input.LA( 1 ) >= '\u007F' && input.LA( 1 ) <= '\uFFFE') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
+ }
}
+ break;
+ }
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:11: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?'))*
+ loop19 : do {
+ int alt19 = 2;
+ int LA19_0 = input.LA( 1 );
+ if ( ((LA19_0 >= '\u0000' && LA19_0 <= '\b') || (LA19_0 >= '\u000B' && LA19_0 <= '\f') || (LA19_0 >= '\u000E' && LA19_0 <= '\u001F') || LA19_0 == '!' || (LA19_0 >= '#' && LA19_0 <= '%') || LA19_0 == '\''
+ || (LA19_0 >= '*' && LA19_0 <= ':') || (LA19_0 >= '=' && LA19_0 <= '>') || (LA19_0 >= '@' && LA19_0 <= '{') || LA19_0 == '}' || (LA19_0 >= '\u007F' && LA19_0 <= '\uFFFE')) ) {
+ alt19 = 1;
}
- break;
- }
+ switch ( alt19 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:12: ~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?')
+ {
+ if ( (input.LA( 1 ) >= '\u0000' && input.LA( 1 ) <= '\b') || (input.LA( 1 ) >= '\u000B' && input.LA( 1 ) <= '\f') || (input.LA( 1 ) >= '\u000E' && input.LA( 1 ) <= '\u001F') || input.LA( 1 ) == '!'
+ || (input.LA( 1 ) >= '#' && input.LA( 1 ) <= '%') || input.LA( 1 ) == '\'' || (input.LA( 1 ) >= '*' && input.LA( 1 ) <= ':') || (input.LA( 1 ) >= '=' && input.LA( 1 ) <= '>')
+ || (input.LA( 1 ) >= '@' && input.LA( 1 ) <= '{') || input.LA( 1 ) == '}' || (input.LA( 1 ) >= '\u007F' && input.LA( 1 ) <= '\uFFFE') ) {
+ input.consume();
+ failed = false;
+ } else {
+ if ( backtracking > 0 ) {
+ failed = true;
+ return;
+ }
+ MismatchedSetException mse = new MismatchedSetException( null,
+ input );
+ recover( mse );
+ throw mse;
+ }
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:11: (~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?'))*
- loop19:
- do {
- int alt19=2;
- int LA19_0 = input.LA(1);
- if ( ((LA19_0>='\u0000' && LA19_0<='\b')||(LA19_0>='\u000B' && LA19_0<='\f')||(LA19_0>='\u000E' && LA19_0<='\u001F')||LA19_0=='!'||(LA19_0>='#' && LA19_0<='%')||LA19_0=='\''||(LA19_0>='*' && LA19_0<=':')||(LA19_0>='=' && LA19_0<='>')||(LA19_0>='@' && LA19_0<='{')||LA19_0=='}'||(LA19_0>='\u007F' && LA19_0<='\uFFFE')) ) {
- alt19=1;
- }
+ }
+ break;
+ default :
+ break loop19;
+ }
+ } while ( true );
- switch (alt19) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:12: ~ (' '|'\\t'|'\\n'|'\\r'|'\"'|'('|')'|';'|'&'|'|'|'~'|'<'|'?')
- {
- if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||input.LA(1)=='!'||(input.LA(1)>='#' && input.LA(1)<='%')||input.LA(1)=='\''||(input.LA(1)>='*' && input.LA(1)<=':')||(input.LA(1)>='=' && input.LA(1)<='>')||(input.LA(1)>='@' && input.LA(1)<='{')||input.LA(1)=='}'||(input.LA(1)>='\u007F' && input.LA(1)<='\uFFFE') ) {
- input.consume();
- failed=false;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
- break;
-
- default :
- break loop19;
- }
- } while (true);
-
-
}
- }
- finally {
+ } finally {
ruleNestingLevel--;
}
}
+
// $ANTLR end SYMBOL
public void mTokens() throws RecognitionException {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:10: ( T41 | WS | DEFRULE | OR | AND | NOT | EXISTS | TEST | NULL | DECLARE | SALIENCE | INT | FLOAT | STRING | BOOL | VAR | SH_STYLE_SINGLE_LINE_COMMENT | C_STYLE_SINGLE_LINE_COMMENT | LEFT_PAREN | RIGHT_PAREN | LEFT_SQUARE | RIGHT_SQUARE | LEFT_CURLY | RIGHT_CURLY | TILDE | AMPERSAND | PIPE | ASSIGN_OP | COLON | EQUALS | MULTI_LINE_COMMENT | NAME )
- int alt20=32;
- alt20 = dfa20.predict(input);
- switch (alt20) {
+ int alt20 = 32;
+ alt20 = dfa20.predict( input );
+ switch ( alt20 ) {
case 1 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:10: T41
- {
- mT41(); if (failed) return ;
+ {
+ mT41();
+ if ( failed ) return;
- }
+ }
break;
case 2 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:14: WS
- {
- mWS(); if (failed) return ;
+ {
+ mWS();
+ if ( failed ) return;
- }
+ }
break;
case 3 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:17: DEFRULE
- {
- mDEFRULE(); if (failed) return ;
+ {
+ mDEFRULE();
+ if ( failed ) return;
- }
+ }
break;
case 4 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:25: OR
- {
- mOR(); if (failed) return ;
+ {
+ mOR();
+ if ( failed ) return;
- }
+ }
break;
case 5 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:28: AND
- {
- mAND(); if (failed) return ;
+ {
+ mAND();
+ if ( failed ) return;
- }
+ }
break;
case 6 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:32: NOT
- {
- mNOT(); if (failed) return ;
+ {
+ mNOT();
+ if ( failed ) return;
- }
+ }
break;
case 7 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:36: EXISTS
- {
- mEXISTS(); if (failed) return ;
+ {
+ mEXISTS();
+ if ( failed ) return;
- }
+ }
break;
case 8 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:43: TEST
- {
- mTEST(); if (failed) return ;
+ {
+ mTEST();
+ if ( failed ) return;
- }
+ }
break;
case 9 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:48: NULL
- {
- mNULL(); if (failed) return ;
+ {
+ mNULL();
+ if ( failed ) return;
- }
+ }
break;
case 10 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:53: DECLARE
- {
- mDECLARE(); if (failed) return ;
+ {
+ mDECLARE();
+ if ( failed ) return;
- }
+ }
break;
case 11 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:61: SALIENCE
- {
- mSALIENCE(); if (failed) return ;
+ {
+ mSALIENCE();
+ if ( failed ) return;
- }
+ }
break;
case 12 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:70: INT
- {
- mINT(); if (failed) return ;
+ {
+ mINT();
+ if ( failed ) return;
- }
+ }
break;
case 13 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:74: FLOAT
- {
- mFLOAT(); if (failed) return ;
+ {
+ mFLOAT();
+ if ( failed ) return;
- }
+ }
break;
case 14 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:80: STRING
- {
- mSTRING(); if (failed) return ;
+ {
+ mSTRING();
+ if ( failed ) return;
- }
+ }
break;
case 15 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:87: BOOL
- {
- mBOOL(); if (failed) return ;
+ {
+ mBOOL();
+ if ( failed ) return;
- }
+ }
break;
case 16 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:92: VAR
- {
- mVAR(); if (failed) return ;
+ {
+ mVAR();
+ if ( failed ) return;
- }
+ }
break;
case 17 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:96: SH_STYLE_SINGLE_LINE_COMMENT
- {
- mSH_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
+ {
+ mSH_STYLE_SINGLE_LINE_COMMENT();
+ if ( failed ) return;
- }
+ }
break;
case 18 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:125: C_STYLE_SINGLE_LINE_COMMENT
- {
- mC_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
+ {
+ mC_STYLE_SINGLE_LINE_COMMENT();
+ if ( failed ) return;
- }
+ }
break;
case 19 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:153: LEFT_PAREN
- {
- mLEFT_PAREN(); if (failed) return ;
+ {
+ mLEFT_PAREN();
+ if ( failed ) return;
- }
+ }
break;
case 20 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:164: RIGHT_PAREN
- {
- mRIGHT_PAREN(); if (failed) return ;
+ {
+ mRIGHT_PAREN();
+ if ( failed ) return;
- }
+ }
break;
case 21 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:176: LEFT_SQUARE
- {
- mLEFT_SQUARE(); if (failed) return ;
+ {
+ mLEFT_SQUARE();
+ if ( failed ) return;
- }
+ }
break;
case 22 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:188: RIGHT_SQUARE
- {
- mRIGHT_SQUARE(); if (failed) return ;
+ {
+ mRIGHT_SQUARE();
+ if ( failed ) return;
- }
+ }
break;
case 23 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:201: LEFT_CURLY
- {
- mLEFT_CURLY(); if (failed) return ;
+ {
+ mLEFT_CURLY();
+ if ( failed ) return;
- }
+ }
break;
case 24 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:212: RIGHT_CURLY
- {
- mRIGHT_CURLY(); if (failed) return ;
+ {
+ mRIGHT_CURLY();
+ if ( failed ) return;
- }
+ }
break;
case 25 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:224: TILDE
- {
- mTILDE(); if (failed) return ;
+ {
+ mTILDE();
+ if ( failed ) return;
- }
+ }
break;
case 26 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:230: AMPERSAND
- {
- mAMPERSAND(); if (failed) return ;
+ {
+ mAMPERSAND();
+ if ( failed ) return;
- }
+ }
break;
case 27 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:240: PIPE
- {
- mPIPE(); if (failed) return ;
+ {
+ mPIPE();
+ if ( failed ) return;
- }
+ }
break;
case 28 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:245: ASSIGN_OP
- {
- mASSIGN_OP(); if (failed) return ;
+ {
+ mASSIGN_OP();
+ if ( failed ) return;
- }
+ }
break;
case 29 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:255: COLON
- {
- mCOLON(); if (failed) return ;
+ {
+ mCOLON();
+ if ( failed ) return;
- }
+ }
break;
case 30 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:261: EQUALS
- {
- mEQUALS(); if (failed) return ;
+ {
+ mEQUALS();
+ if ( failed ) return;
- }
+ }
break;
case 31 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:268: MULTI_LINE_COMMENT
- {
- mMULTI_LINE_COMMENT(); if (failed) return ;
+ {
+ mMULTI_LINE_COMMENT();
+ if ( failed ) return;
- }
+ }
break;
case 32 :
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:287: NAME
- {
- mNAME(); if (failed) return ;
+ {
+ mNAME();
+ if ( failed ) return;
- }
+ }
break;
}
}
-
- protected DFA20 dfa20 = new DFA20(this);
- public static final String DFA20_eotS =
- "\1\uffff\1\40\1\uffff\1\2\10\36\1\54\1\uffff\2\36\1\uffff\2\36\2"+
- "\uffff\1\65\1\66\1\67\1\70\3\uffff\1\36\1\72\1\uffff\1\73\1\uffff"+
- "\1\36\1\76\7\36\1\54\1\36\1\uffff\2\36\1\15\1\36\1\uffff\3\36\4"+
- "\uffff\1\121\2\uffff\2\36\1\uffff\1\124\1\125\5\36\1\133\7\36\1"+
- "\uffff\1\36\2\uffff\2\36\2\uffff\1\143\1\36\1\145\1\146\1\36\1\uffff"+
- "\4\36\1\116\2\36\1\uffff\1\36\2\uffff\3\36\1\145\2\36\1\162\2\36"+
- "\1\165\1\166\1\uffff\2\36\2\uffff\1\170\1\uffff";
- public static final String DFA20_eofS =
- "\171\uffff";
- public static final String DFA20_minS =
- "\2\0\1\uffff\1\0\1\145\1\162\1\156\1\157\1\170\1\145\1\141\1\60"+
- "\1\0\1\uffff\1\0\1\141\1\uffff\1\0\1\52\2\uffff\4\0\3\uffff\1\55"+
- "\1\0\1\uffff\1\0\1\uffff\1\143\1\0\1\144\1\164\1\154\1\151\1\165"+
- "\1\163\1\154\1\0\1\60\1\uffff\1\42\2\0\1\154\1\uffff\3\0\4\uffff"+
- "\1\0\2\uffff\1\154\1\162\1\uffff\2\0\1\154\1\163\1\145\1\164\1\151"+
- "\2\0\1\60\2\0\1\163\2\0\1\uffff\1\0\2\uffff\1\141\1\165\2\uffff"+
- "\1\0\1\164\2\0\1\145\1\uffff\1\60\2\0\1\145\1\0\1\162\1\154\1\uffff"+
- "\1\163\2\uffff\1\156\1\60\2\0\2\145\1\0\1\143\1\60\2\0\1\uffff\1"+
- "\145\1\0\2\uffff\1\0\1\uffff";
- public static final String DFA20_maxS =
- "\2\ufffe\1\uffff\1\ufffe\1\145\1\162\1\156\1\165\1\170\1\162\1\141"+
- "\1\71\1\ufffe\1\uffff\1\ufffe\1\141\1\uffff\1\ufffe\1\57\2\uffff"+
- "\4\ufffe\3\uffff\1\55\1\ufffe\1\uffff\1\ufffe\1\uffff\1\146\1\ufffe"+
- "\1\144\1\164\1\154\1\151\1\165\1\163\1\154\1\ufffe\1\71\1\uffff"+
- "\1\165\2\ufffe\1\154\1\uffff\3\ufffe\4\uffff\1\ufffe\2\uffff\1\154"+
- "\1\162\1\uffff\2\ufffe\1\154\1\163\1\145\1\164\1\151\2\ufffe\1\146"+
- "\2\ufffe\1\163\2\ufffe\1\uffff\1\ufffe\2\uffff\1\141\1\165\2\uffff"+
- "\1\ufffe\1\164\2\ufffe\1\145\1\uffff\1\146\2\ufffe\1\145\1\ufffe"+
- "\1\162\1\154\1\uffff\1\163\2\uffff\1\156\1\146\2\ufffe\2\145\1\ufffe"+
- "\1\143\1\146\2\ufffe\1\uffff\1\145\1\ufffe\2\uffff\1\ufffe\1\uffff";
- public static final String DFA20_acceptS =
- "\2\uffff\1\2\12\uffff\1\16\2\uffff\1\20\2\uffff\1\23\1\24\4\uffff"+
- "\1\31\1\32\1\33\2\uffff\1\40\1\uffff\1\36\13\uffff\1\14\4\uffff"+
- "\1\21\3\uffff\1\25\1\26\1\27\1\30\1\uffff\1\35\1\1\2\uffff\1\4\17"+
- "\uffff\1\37\1\uffff\1\22\1\34\2\uffff\1\5\1\6\5\uffff\1\15\7\uffff"+
- "\1\11\1\uffff\1\17\1\10\13\uffff\1\7\2\uffff\1\12\1\3\1\uffff\1"+
- "\13";
- public static final String DFA20_specialS =
- "\171\uffff}>";
+ protected DFA20 dfa20 = new DFA20( this );
+ public static final String DFA20_eotS = "\1\uffff\1\40\1\uffff\1\2\10\36\1\54\1\uffff\2\36\1\uffff\2\36\2" + "\uffff\1\65\1\66\1\67\1\70\3\uffff\1\36\1\72\1\uffff\1\73\1\uffff"
+ + "\1\36\1\76\7\36\1\54\1\36\1\uffff\2\36\1\15\1\36\1\uffff\3\36\4" + "\uffff\1\121\2\uffff\2\36\1\uffff\1\124\1\125\5\36\1\133\7\36\1"
+ + "\uffff\1\36\2\uffff\2\36\2\uffff\1\143\1\36\1\145\1\146\1\36\1\uffff" + "\4\36\1\116\2\36\1\uffff\1\36\2\uffff\3\36\1\145\2\36\1\162\2\36" + "\1\165\1\166\1\uffff\2\36\2\uffff\1\170\1\uffff";
+ public static final String DFA20_eofS = "\171\uffff";
+ public static final String DFA20_minS = "\2\0\1\uffff\1\0\1\145\1\162\1\156\1\157\1\170\1\145\1\141\1\60" + "\1\0\1\uffff\1\0\1\141\1\uffff\1\0\1\52\2\uffff\4\0\3\uffff\1\55"
+ + "\1\0\1\uffff\1\0\1\uffff\1\143\1\0\1\144\1\164\1\154\1\151\1\165" + "\1\163\1\154\1\0\1\60\1\uffff\1\42\2\0\1\154\1\uffff\3\0\4\uffff"
+ + "\1\0\2\uffff\1\154\1\162\1\uffff\2\0\1\154\1\163\1\145\1\164\1\151" + "\2\0\1\60\2\0\1\163\2\0\1\uffff\1\0\2\uffff\1\141\1\165\2\uffff"
+ + "\1\0\1\164\2\0\1\145\1\uffff\1\60\2\0\1\145\1\0\1\162\1\154\1\uffff" + "\1\163\2\uffff\1\156\1\60\2\0\2\145\1\0\1\143\1\60\2\0\1\uffff\1" + "\145\1\0\2\uffff\1\0\1\uffff";
+ public static final String DFA20_maxS = "\2\ufffe\1\uffff\1\ufffe\1\145\1\162\1\156\1\165\1\170\1\162\1\141" + "\1\71\1\ufffe\1\uffff\1\ufffe\1\141\1\uffff\1\ufffe\1\57\2\uffff"
+ + "\4\ufffe\3\uffff\1\55\1\ufffe\1\uffff\1\ufffe\1\uffff\1\146\1\ufffe" + "\1\144\1\164\1\154\1\151\1\165\1\163\1\154\1\ufffe\1\71\1\uffff"
+ + "\1\165\2\ufffe\1\154\1\uffff\3\ufffe\4\uffff\1\ufffe\2\uffff\1\154" + "\1\162\1\uffff\2\ufffe\1\154\1\163\1\145\1\164\1\151\2\ufffe\1\146"
+ + "\2\ufffe\1\163\2\ufffe\1\uffff\1\ufffe\2\uffff\1\141\1\165\2\uffff" + "\1\ufffe\1\164\2\ufffe\1\145\1\uffff\1\146\2\ufffe\1\145\1\ufffe"
+ + "\1\162\1\154\1\uffff\1\163\2\uffff\1\156\1\146\2\ufffe\2\145\1\ufffe" + "\1\143\1\146\2\ufffe\1\uffff\1\145\1\ufffe\2\uffff\1\ufffe\1\uffff";
+ public static final String DFA20_acceptS = "\2\uffff\1\2\12\uffff\1\16\2\uffff\1\20\2\uffff\1\23\1\24\4\uffff" + "\1\31\1\32\1\33\2\uffff\1\40\1\uffff\1\36\13\uffff\1\14\4\uffff"
+ + "\1\21\3\uffff\1\25\1\26\1\27\1\30\1\uffff\1\35\1\1\2\uffff\1\4\17" + "\uffff\1\37\1\uffff\1\22\1\34\2\uffff\1\5\1\6\5\uffff\1\15\7\uffff"
+ + "\1\11\1\uffff\1\17\1\10\13\uffff\1\7\2\uffff\1\12\1\3\1\uffff\1" + "\13";
+ public static final String DFA20_specialS = "\171\uffff}>";
public static final String[] DFA20_transition = {
- "\11\36\2\2\1\36\1\3\1\2\22\36\1\2\1\36\1\15\1\21\2\36\1\32\1\16"+
- "\1\23\1\24\3\36\1\13\1\36\1\22\12\14\1\35\1\uffff\1\34\1\1\1\36"+
- "\1\20\33\36\1\25\1\36\1\26\3\36\1\6\2\36\1\4\1\10\1\17\7\36\1\7"+
- "\1\5\3\36\1\12\1\11\6\36\1\27\1\33\1\30\1\31\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\1\36\1\37\1\uffff\74\36\1\uffff\1\36"+
- "\1\uffff\uff80\36",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\41",
- "\1\42",
- "\1\43",
- "\1\44\5\uffff\1\45",
- "\1\46",
- "\1\50\14\uffff\1\47",
- "\1\51",
- "\12\52",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\4\36\1\53\1\36\12\52\1\36\2\uffff\2\36\1\uffff\74"+
- "\36\1\uffff\1\36\1\uffff\uff80\36",
- "",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "\1\60",
- "",
- "\11\62\2\61\2\62\1\61\22\62\1\61\1\62\1\61\3\62\1\61\1\62\2\61\21"+
- "\62\2\61\2\62\1\61\74\62\1\61\1\62\1\61\uff80\62",
- "\1\63\4\uffff\1\64",
- "",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "",
- "",
- "",
- "\1\71",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "",
- "\1\74\2\uffff\1\75",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\77",
- "\1\100",
- "\1\101",
- "\1\102",
- "\1\103",
- "\1\104",
- "\1\105",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\4\36\1\53\1\36\12\52\1\36\2\uffff\2\36\1\uffff\74"+
- "\36\1\uffff\1\36\1\uffff\uff80\36",
- "\12\106",
- "",
- "\1\15\4\uffff\1\107\10\uffff\4\111\4\112\44\uffff\1\107\5\uffff"+
- "\1\107\3\uffff\1\107\7\uffff\1\107\3\uffff\1\107\1\uffff\1\107\1"+
- "\110",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\113",
- "",
- "\11\62\2\61\2\62\1\61\22\62\1\61\1\62\1\61\3\62\1\61\1\62\2\61\21"+
- "\62\2\61\2\62\1\61\74\62\1\61\1\62\1\61\uff80\62",
- "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1"+
- "\115\2\116\1\114\20\115\2\116\2\115\1\116\74\115\1\116\1\115\1\116"+
- "\uff80\115",
- "\11\117\2\120\2\117\1\120\22\117\1\120\1\117\1\120\3\117\1\120\1"+
- "\117\2\120\21\117\2\120\2\117\1\120\74\117\1\120\1\117\1\120\uff80"+
- "\117",
- "",
- "",
- "",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "",
- "",
- "\1\122",
- "\1\123",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\126",
- "\1\127",
- "\1\130",
- "\1\131",
- "\1\132",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\6\36\12\106\1\36\2\uffff\2\36\1\uffff\74\36\1\uffff"+
- "\1\36\1\uffff\uff80\36",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "\12\134\7\uffff\6\134\32\uffff\6\134",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6"+
- "\56\10\135\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80"+
- "\56",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6"+
- "\56\10\136\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80"+
- "\56",
- "\1\137",
- "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1"+
- "\115\2\116\1\114\4\115\1\140\13\115\2\116\2\115\1\116\74\115\1\116"+
- "\1\115\1\116\uff80\115",
- "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1"+
- "\115\2\116\1\114\20\115\2\116\2\115\1\116\74\115\1\116\1\115\1\116"+
- "\uff80\115",
- "",
- "\11\117\2\120\2\117\1\120\22\117\1\120\1\117\1\120\3\117\1\120\1"+
- "\117\2\120\21\117\2\120\2\117\1\120\74\117\1\120\1\117\1\120\uff80"+
- "\117",
- "",
- "",
- "\1\141",
- "\1\142",
- "",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\144",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\147",
- "",
- "\12\150\7\uffff\6\150\32\uffff\6\150",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6"+
- "\56\10\151\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80"+
- "\56",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "\1\152",
- "\11\115\2\uffff\2\115\1\uffff\22\115\1\uffff\1\115\1\uffff\3\115"+
- "\1\uffff\1\115\2\uffff\1\114\20\115\2\uffff\2\115\1\uffff\74\115"+
- "\1\uffff\1\115\1\uffff\uff80\115",
- "\1\153",
- "\1\154",
- "",
- "\1\155",
- "",
- "",
- "\1\156",
- "\12\157\7\uffff\6\157\32\uffff\6\157",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\160",
- "\1\161",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\1\163",
- "\12\164\7\uffff\6\164\32\uffff\6\164",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- "",
- "\1\167",
- "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21"+
- "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
- "",
- "",
- "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff"+
- "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff"+
- "\uff80\36",
- ""
- };
+ "\11\36\2\2\1\36\1\3\1\2\22\36\1\2\1\36\1\15\1\21\2\36\1\32\1\16" + "\1\23\1\24\3\36\1\13\1\36\1\22\12\14\1\35\1\uffff\1\34\1\1\1\36" + "\1\20\33\36\1\25\1\36\1\26\3\36\1\6\2\36\1\4\1\10\1\17\7\36\1\7"
+ + "\1\5\3\36\1\12\1\11\6\36\1\27\1\33\1\30\1\31\uff80\36", "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\1\36\1\37\1\uffff\74\36\1\uffff\1\36" + "\1\uffff\uff80\36", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\41", "\1\42", "\1\43", "\1\44\5\uffff\1\45", "\1\46", "\1\50\14\uffff\1\47",
+ "\1\51", "\12\52", "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\4\36\1\53\1\36\12\52\1\36\2\uffff\2\36\1\uffff\74" + "\36\1\uffff\1\36\1\uffff\uff80\36", "",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56", "\1\60", "",
+ "\11\62\2\61\2\62\1\61\22\62\1\61\1\62\1\61\3\62\1\61\1\62\2\61\21" + "\62\2\61\2\62\1\61\74\62\1\61\1\62\1\61\uff80\62", "\1\63\4\uffff\1\64", "", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "", "", "", "\1\71",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "", "\1\74\2\uffff\1\75",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\77", "\1\100", "\1\101", "\1\102", "\1\103", "\1\104", "\1\105",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\4\36\1\53\1\36\12\52\1\36\2\uffff\2\36\1\uffff\74" + "\36\1\uffff\1\36\1\uffff\uff80\36", "\12\106", "",
+ "\1\15\4\uffff\1\107\10\uffff\4\111\4\112\44\uffff\1\107\5\uffff" + "\1\107\3\uffff\1\107\7\uffff\1\107\3\uffff\1\107\1\uffff\1\107\1" + "\110",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\113", "",
+ "\11\62\2\61\2\62\1\61\22\62\1\61\1\62\1\61\3\62\1\61\1\62\2\61\21" + "\62\2\61\2\62\1\61\74\62\1\61\1\62\1\61\uff80\62",
+ "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1" + "\115\2\116\1\114\20\115\2\116\2\115\1\116\74\115\1\116\1\115\1\116" + "\uff80\115",
+ "\11\117\2\120\2\117\1\120\22\117\1\120\1\117\1\120\3\117\1\120\1" + "\117\2\120\21\117\2\120\2\117\1\120\74\117\1\120\1\117\1\120\uff80" + "\117", "", "", "", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "", "", "\1\122", "\1\123", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\126", "\1\127", "\1\130", "\1\131", "\1\132",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\6\36\12\106\1\36\2\uffff\2\36\1\uffff\74\36\1\uffff" + "\1\36\1\uffff\uff80\36",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56", "\12\134\7\uffff\6\134\32\uffff\6\134",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6" + "\56\10\135\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80" + "\56",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6" + "\56\10\136\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80" + "\56", "\1\137",
+ "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1" + "\115\2\116\1\114\4\115\1\140\13\115\2\116\2\115\1\116\74\115\1\116" + "\1\115\1\116\uff80\115",
+ "\11\115\2\116\2\115\1\116\22\115\1\116\1\115\1\116\3\115\1\116\1" + "\115\2\116\1\114\20\115\2\116\2\115\1\116\74\115\1\116\1\115\1\116" + "\uff80\115", "",
+ "\11\117\2\120\2\117\1\120\22\117\1\120\1\117\1\120\3\117\1\120\1" + "\117\2\120\21\117\2\120\2\117\1\120\74\117\1\120\1\117\1\120\uff80" + "\117", "", "", "\1\141", "\1\142", "", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\144",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\147", "", "\12\150\7\uffff\6\150\32\uffff\6\150",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\6" + "\56\10\151\3\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80" + "\56",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56", "\1\152",
+ "\11\115\2\uffff\2\115\1\uffff\22\115\1\uffff\1\115\1\uffff\3\115" + "\1\uffff\1\115\2\uffff\1\114\20\115\2\uffff\2\115\1\uffff\74\115" + "\1\uffff\1\115\1\uffff\uff80\115", "\1\153", "\1\154", "", "\1\155", "", "", "\1\156",
+ "\12\157\7\uffff\6\157\32\uffff\6\157", "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\160", "\1\161",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "\1\163", "\12\164\7\uffff\6\164\32\uffff\6\164",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", "", "\1\167",
+ "\11\56\2\15\2\56\1\15\22\56\1\15\1\56\1\15\3\56\1\15\1\57\2\15\21" + "\56\2\15\2\56\1\15\34\56\1\55\37\56\1\15\1\56\1\15\uff80\56", "", "",
+ "\11\36\2\uffff\2\36\1\uffff\22\36\1\uffff\1\36\1\uffff\3\36\1\uffff" + "\1\36\2\uffff\21\36\2\uffff\2\36\1\uffff\74\36\1\uffff\1\36\1\uffff" + "\uff80\36", ""};
class DFA20 extends DFA {
public DFA20(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 20;
- this.eot = DFA.unpackEncodedString(DFA20_eotS);
- this.eof = DFA.unpackEncodedString(DFA20_eofS);
- this.min = DFA.unpackEncodedStringToUnsignedChars(DFA20_minS);
- this.max = DFA.unpackEncodedStringToUnsignedChars(DFA20_maxS);
- this.accept = DFA.unpackEncodedString(DFA20_acceptS);
- this.special = DFA.unpackEncodedString(DFA20_specialS);
+ this.eot = DFA.unpackEncodedString( DFA20_eotS );
+ this.eof = DFA.unpackEncodedString( DFA20_eofS );
+ this.min = DFA.unpackEncodedStringToUnsignedChars( DFA20_minS );
+ this.max = DFA.unpackEncodedStringToUnsignedChars( DFA20_maxS );
+ this.accept = DFA.unpackEncodedString( DFA20_acceptS );
+ this.special = DFA.unpackEncodedString( DFA20_specialS );
int numStates = DFA20_transition.length;
this.transition = new short[numStates][];
- for (int i=0; i<numStates; i++) {
- transition[i] = DFA.unpackEncodedString(DFA20_transition[i]);
+ for ( int i = 0; i < numStates; i++ ) {
+ transition[i] = DFA.unpackEncodedString( DFA20_transition[i] );
}
}
+
public String getDescription() {
return "1:1: Tokens : ( T41 | WS | DEFRULE | OR | AND | NOT | EXISTS | TEST | NULL | DECLARE | SALIENCE | INT | FLOAT | STRING | BOOL | VAR | SH_STYLE_SINGLE_LINE_COMMENT | C_STYLE_SINGLE_LINE_COMMENT | LEFT_PAREN | RIGHT_PAREN | LEFT_SQUARE | RIGHT_SQUARE | LEFT_CURLY | RIGHT_CURLY | TILDE | AMPERSAND | PIPE | ASSIGN_OP | COLON | EQUALS | MULTI_LINE_COMMENT | NAME );";
}
}
-
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPParser.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPParser.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPParser.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,227 +1,235 @@
-// $ANTLR 3.0b7 C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2007-03-24 19:53:23
-
- package org.drools.clp;
-
- import org.drools.clp.valuehandlers.*
- import java.util.List;
- import java.util.ArrayList;
- import java.util.Iterator;
- import java.util.HashMap;
- import java.util.StringTokenizer;
- import org.drools.lang.descr.*;
- import org.drools.compiler.SwitchingCommonTokenStream;
+// $ANTLR 3.0b7 C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2007-03-24 20:05:52
+package org.drools.clp;
-import org.antlr.runtime.*;
-import java.util.Stack;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
+import org.antlr.runtime.BitSet;
+import org.antlr.runtime.CommonToken;
+import org.antlr.runtime.EarlyExitException;
+import org.antlr.runtime.FailedPredicateException;
+import org.antlr.runtime.MismatchedNotSetException;
+import org.antlr.runtime.MismatchedSetException;
+import org.antlr.runtime.MismatchedTokenException;
+import org.antlr.runtime.MismatchedTreeNodeException;
+import org.antlr.runtime.NoViableAltException;
+import org.antlr.runtime.Parser;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.Token;
+import org.antlr.runtime.TokenStream;
+import org.drools.clp.valuehandlers.BooleanValueHandler;
+import org.drools.clp.valuehandlers.DoubleValueHandler;
+import org.drools.clp.valuehandlers.FunctionCaller;
+import org.drools.clp.valuehandlers.LongValueHandler;
+import org.drools.clp.valuehandlers.ObjectValueHandler;
+import org.drools.lang.descr.AndDescr;
+import org.drools.lang.descr.AttributeDescr;
+import org.drools.lang.descr.ColumnDescr;
+import org.drools.lang.descr.ConditionalElementDescr;
+import org.drools.lang.descr.DescrFactory;
+import org.drools.lang.descr.EvalDescr;
+import org.drools.lang.descr.ExistsDescr;
+import org.drools.lang.descr.FieldBindingDescr;
+import org.drools.lang.descr.FieldConstraintDescr;
+import org.drools.lang.descr.LiteralRestrictionDescr;
+import org.drools.lang.descr.NotDescr;
+import org.drools.lang.descr.OrDescr;
+import org.drools.lang.descr.PackageDescr;
+import org.drools.lang.descr.PredicateDescr;
+import org.drools.lang.descr.RestrictionConnectiveDescr;
+import org.drools.lang.descr.ReturnValueRestrictionDescr;
+import org.drools.lang.descr.RuleDescr;
+import org.drools.lang.descr.VariableRestrictionDescr;
+
public class CLPParser extends Parser {
- public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "LEFT_PAREN", "DEFRULE", "NAME", "STRING", "RIGHT_PAREN", "SALIENCE", "INT", "AND", "OR", "NOT", "EXISTS", "TEST", "VAR", "ASSIGN_OP", "AMPERSAND", "PIPE", "TILDE", "COLON", "EQUALS", "FLOAT", "BOOL", "NULL", "EOL", "WS", "DECLARE", "EscapeSequence", "HexDigit", "UnicodeEscape", "OctalEscape", "SYMBOL", "SH_STYLE_SINGLE_LINE_COMMENT", "C_STYLE_SINGLE_LINE_COMMENT", "LEFT_SQUARE", "RIGHT_SQUARE", "LEFT_CURLY", "RIGHT_CURLY", "MULTI_LINE_COMMENT", "'=>'"
- };
- public static final int EXISTS=14;
- public static final int LEFT_PAREN=4;
- public static final int RIGHT_CURLY=39;
- public static final int BOOL=24;
- public static final int DEFRULE=5;
- public static final int HexDigit=30;
- public static final int WS=27;
- public static final int STRING=7;
- public static final int FLOAT=23;
- public static final int TILDE=20;
- public static final int OR=12;
- public static final int PIPE=19;
- public static final int EQUALS=22;
- public static final int VAR=16;
- public static final int ASSIGN_OP=17;
- public static final int UnicodeEscape=31;
- public static final int AND=11;
- public static final int EscapeSequence=29;
- public static final int INT=10;
- public static final int EOF=-1;
- public static final int EOL=26;
- public static final int NULL=25;
- public static final int SYMBOL=33;
- public static final int LEFT_SQUARE=36;
- public static final int COLON=21;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=34;
- public static final int OctalEscape=32;
- public static final int SALIENCE=9;
- public static final int MULTI_LINE_COMMENT=40;
- public static final int TEST=15;
- public static final int AMPERSAND=18;
- public static final int NAME=6;
- public static final int DECLARE=28;
- public static final int RIGHT_PAREN=8;
- public static final int NOT=13;
- public static final int LEFT_CURLY=38;
- public static final int RIGHT_SQUARE=37;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=35;
+ public static final String[] tokenNames = new String[]{"<invalid>", "<EOR>", "<DOWN>", "<UP>", "LEFT_PAREN", "DEFRULE", "NAME", "STRING", "RIGHT_PAREN", "SALIENCE", "INT", "AND", "OR", "NOT", "EXISTS", "TEST", "VAR",
+ "ASSIGN_OP", "AMPERSAND", "PIPE", "TILDE", "COLON", "EQUALS", "FLOAT", "BOOL", "NULL", "EOL", "WS", "DECLARE", "EscapeSequence", "HexDigit", "UnicodeEscape", "OctalEscape", "SYMBOL", "SH_STYLE_SINGLE_LINE_COMMENT",
+ "C_STYLE_SINGLE_LINE_COMMENT", "LEFT_SQUARE", "RIGHT_SQUARE", "LEFT_CURLY", "RIGHT_CURLY", "MULTI_LINE_COMMENT", "'=>'"};
+ public static final int EXISTS = 14;
+ public static final int LEFT_PAREN = 4;
+ public static final int RIGHT_CURLY = 39;
+ public static final int BOOL = 24;
+ public static final int DEFRULE = 5;
+ public static final int HexDigit = 30;
+ public static final int WS = 27;
+ public static final int STRING = 7;
+ public static final int FLOAT = 23;
+ public static final int TILDE = 20;
+ public static final int OR = 12;
+ public static final int PIPE = 19;
+ public static final int EQUALS = 22;
+ public static final int VAR = 16;
+ public static final int ASSIGN_OP = 17;
+ public static final int UnicodeEscape = 31;
+ public static final int AND = 11;
+ public static final int EscapeSequence = 29;
+ public static final int INT = 10;
+ public static final int EOF = -1;
+ public static final int EOL = 26;
+ public static final int NULL = 25;
+ public static final int SYMBOL = 33;
+ public static final int LEFT_SQUARE = 36;
+ public static final int COLON = 21;
+ public static final int SH_STYLE_SINGLE_LINE_COMMENT = 34;
+ public static final int OctalEscape = 32;
+ public static final int SALIENCE = 9;
+ public static final int MULTI_LINE_COMMENT = 40;
+ public static final int TEST = 15;
+ public static final int AMPERSAND = 18;
+ public static final int NAME = 6;
+ public static final int DECLARE = 28;
+ public static final int RIGHT_PAREN = 8;
+ public static final int NOT = 13;
+ public static final int LEFT_CURLY = 38;
+ public static final int RIGHT_SQUARE = 37;
+ public static final int C_STYLE_SINGLE_LINE_COMMENT = 35;
- public CLPParser(TokenStream input) {
- super(input);
+ public CLPParser(TokenStream input) {
+ super( input );
+ }
+
+ public String[] getTokenNames() {
+ return tokenNames;
+ }
+
+ public String getGrammarFileName() {
+ return "C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g";
+ }
+
+ private PackageDescr packageDescr;
+ private List errors = new ArrayList();
+ private String source = "unknown";
+ private int lineOffset = 0;
+ private DescrFactory factory = new DescrFactory();
+ private boolean parserDebug = false;
+ private FunctionRegistry functionRegistry;
+
+ FunctionRegistry factoryRegistry;
+
+ public void setFunctionRegistry(FunctionRegistry functionRegistry) {
+ this.functionRegistry = functionRegistry;
+ }
+
+ public void setParserDebug(boolean parserDebug) {
+ this.parserDebug = parserDebug;
+ }
+
+ public void debug(String message) {
+ if ( parserDebug ) System.err.println( "drl parser: " + message );
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public DescrFactory getFactory() {
+ return factory;
+ }
+
+ public String getSource() {
+ return this.source;
+ }
+
+ public PackageDescr getPackageDescr() {
+ return packageDescr;
+ }
+
+ private int offset(int line) {
+ return line + lineOffset;
+ }
+
+ /**
+ * This will set the offset to record when reparsing. Normally is zero of course
+ */
+ public void setLineOffset(int i) {
+ this.lineOffset = i;
+ }
+
+ private String getString(Token token) {
+ String orig = token.getText();
+ return orig.substring( 1,
+ orig.length() - 1 );
+ }
+
+ public void reportError(RecognitionException ex) {
+ // if we've already reported an error and have not matched a token
+ // yet successfully, don't report any errors.
+ if ( errorRecovery ) {
+ return;
}
-
+ errorRecovery = true;
- public String[] getTokenNames() { return tokenNames; }
- public String getGrammarFileName() { return "C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g"; }
+ ex.line = offset( ex.line ); //add the offset if there is one
+ errors.add( ex );
+ }
-
- private PackageDescr packageDescr;
- private List errors = new ArrayList();
- private String source = "unknown";
- private int lineOffset = 0;
- private DescrFactory factory = new DescrFactory();
- private boolean parserDebug = false;
- private FunctionRegistry functionRegistry;
-
- FunctionRegistry factoryRegistry;
-
- public void setFunctionRegistry(FunctionRegistry functionRegistry) {
- this.functionRegistry = functionRegistry;
- }
-
- public void setParserDebug(boolean parserDebug) {
- this.parserDebug = parserDebug;
- }
-
- public void debug(String message) {
- if ( parserDebug )
- System.err.println( "drl parser: " + message );
- }
-
- public void setSource(String source) {
- this.source = source;
- }
- public DescrFactory getFactory() {
- return factory;
- }
-
- public String getSource() {
- return this.source;
- }
-
- public PackageDescr getPackageDescr() {
- return packageDescr;
- }
-
- private int offset(int line) {
- return line + lineOffset;
- }
-
- /**
- * This will set the offset to record when reparsing. Normally is zero of course
- */
- public void setLineOffset(int i) {
- this.lineOffset = i;
- }
-
- private String getString(Token token) {
- String orig = token.getText();
- return orig.substring( 1, orig.length() -1 );
- }
-
- public void reportError(RecognitionException ex) {
- // if we've already reported an error and have not matched a token
- // yet successfully, don't report any errors.
- if ( errorRecovery ) {
- return;
- }
- errorRecovery = true;
-
- ex.line = offset(ex.line); //add the offset if there is one
- errors.add( ex );
- }
-
- /** return the raw RecognitionException errors */
- public List getErrors() {
- return errors;
- }
-
- /** Return a list of pretty strings summarising the errors */
- public List getErrorMessages() {
- List messages = new ArrayList();
- for ( Iterator errorIter = errors.iterator() ; errorIter.hasNext() ; ) {
- messages.add( createErrorMessage( (RecognitionException) errorIter.next() ) );
- }
- return messages;
- }
-
- /** return true if any parser errors were accumulated */
- public boolean hasErrors() {
- return ! errors.isEmpty();
- }
-
- /** This will take a RecognitionException, and create a sensible error message out of it */
- public String createErrorMessage(RecognitionException e)
- {
- StringBuffer message = new StringBuffer();
- message.append( source + ":"+e.line+":"+e.charPositionInLine+" ");
- if ( e instanceof MismatchedTokenException ) {
- MismatchedTokenException mte = (MismatchedTokenException)e;
- message.append("mismatched token: "+
- e.token+
- "; expecting type "+
- tokenNames[mte.expecting]);
- }
- else if ( e instanceof MismatchedTreeNodeException ) {
- MismatchedTreeNodeException mtne = (MismatchedTreeNodeException)e;
- message.append("mismatched tree node: "+
- mtne.foundNode+
- "; expecting type "+
- tokenNames[mtne.expecting]);
- }
- else if ( e instanceof NoViableAltException ) {
- NoViableAltException nvae = (NoViableAltException)e;
- message.append( "Unexpected token '" + e.token.getText() + "'" );
- /*
- message.append("decision=<<"+nvae.grammarDecisionDescription+">>"+
- " state "+nvae.stateNumber+
- " (decision="+nvae.decisionNumber+
- ") no viable alt; token="+
- e.token);
- */
- }
- else if ( e instanceof EarlyExitException ) {
- EarlyExitException eee = (EarlyExitException)e;
- message.append("required (...)+ loop (decision="+
- eee.decisionNumber+
- ") did not match anything; token="+
- e.token);
- }
- else if ( e instanceof MismatchedSetException ) {
- MismatchedSetException mse = (MismatchedSetException)e;
- message.append("mismatched token '"+
- e.token+
- "' expecting set "+mse.expecting);
- }
- else if ( e instanceof MismatchedNotSetException ) {
- MismatchedNotSetException mse = (MismatchedNotSetException)e;
- message.append("mismatched token '"+
- e.token+
- "' expecting set "+mse.expecting);
- }
- else if ( e instanceof FailedPredicateException ) {
- FailedPredicateException fpe = (FailedPredicateException)e;
- message.append("rule "+fpe.ruleName+" failed predicate: {"+
- fpe.predicateText+"}?");
- } else if (e instanceof GeneralParseException) {
- message.append(" " + e.getMessage());
- }
- return message.toString();
- }
-
- void checkTrailingSemicolon(String text, int line) {
- if (text.trim().endsWith( ";" ) ) {
- this.errors.add( new GeneralParseException( "Trailing semi-colon not allowed", offset(line) ) );
- }
- }
-
+ /** return the raw RecognitionException errors */
+ public List getErrors() {
+ return errors;
+ }
+ /** Return a list of pretty strings summarising the errors */
+ public List getErrorMessages() {
+ List messages = new ArrayList();
+ for ( Iterator errorIter = errors.iterator(); errorIter.hasNext(); ) {
+ messages.add( createErrorMessage( (RecognitionException) errorIter.next() ) );
+ }
+ return messages;
+ }
+ /** return true if any parser errors were accumulated */
+ public boolean hasErrors() {
+ return !errors.isEmpty();
+ }
+ /** This will take a RecognitionException, and create a sensible error message out of it */
+ public String createErrorMessage(RecognitionException e) {
+ StringBuffer message = new StringBuffer();
+ message.append( source + ":" + e.line + ":" + e.charPositionInLine + " " );
+ if ( e instanceof MismatchedTokenException ) {
+ MismatchedTokenException mte = (MismatchedTokenException) e;
+ message.append( "mismatched token: " + e.token + "; expecting type " + tokenNames[mte.expecting] );
+ } else if ( e instanceof MismatchedTreeNodeException ) {
+ MismatchedTreeNodeException mtne = (MismatchedTreeNodeException) e;
+ message.append( "mismatched tree node: " + mtne.foundNode + "; expecting type " + tokenNames[mtne.expecting] );
+ } else if ( e instanceof NoViableAltException ) {
+ NoViableAltException nvae = (NoViableAltException) e;
+ message.append( "Unexpected token '" + e.token.getText() + "'" );
+ /*
+ message.append("decision=<<"+nvae.grammarDecisionDescription+">>"+
+ " state "+nvae.stateNumber+
+ " (decision="+nvae.decisionNumber+
+ ") no viable alt; token="+
+ e.token);
+ */
+ } else if ( e instanceof EarlyExitException ) {
+ EarlyExitException eee = (EarlyExitException) e;
+ message.append( "required (...)+ loop (decision=" + eee.decisionNumber + ") did not match anything; token=" + e.token );
+ } else if ( e instanceof MismatchedSetException ) {
+ MismatchedSetException mse = (MismatchedSetException) e;
+ message.append( "mismatched token '" + e.token + "' expecting set " + mse.expecting );
+ } else if ( e instanceof MismatchedNotSetException ) {
+ MismatchedNotSetException mse = (MismatchedNotSetException) e;
+ message.append( "mismatched token '" + e.token + "' expecting set " + mse.expecting );
+ } else if ( e instanceof FailedPredicateException ) {
+ FailedPredicateException fpe = (FailedPredicateException) e;
+ message.append( "rule " + fpe.ruleName + " failed predicate: {" + fpe.predicateText + "}?" );
+ } else if ( e instanceof GeneralParseException ) {
+ message.append( " " + e.getMessage() );
+ }
+ return message.toString();
+ }
+
+ void checkTrailingSemicolon(String text,
+ int line) {
+ if ( text.trim().endsWith( ";" ) ) {
+ this.errors.add( new GeneralParseException( "Trailing semi-colon not allowed",
+ offset( line ) ) );
+ }
+ }
+
// $ANTLR start deffunction
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:225:1: deffunction : ;
public void deffunction() throws RecognitionException {
@@ -231,235 +239,256 @@
{
}
+ } finally {
}
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end deffunction
-
// $ANTLR start defrule
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:229:1: defrule returns [RuleDescr rule] : loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs] )* '=>' engine= rhs RIGHT_PAREN ;
public RuleDescr defrule() throws RecognitionException {
RuleDescr rule = null;
- Token loc=null;
- Token ruleName=null;
- Token documentation=null;
+ Token loc = null;
+ Token ruleName = null;
+ Token documentation = null;
ExecutionEngine engine = null;
+ rule = null;
+ AndDescr lhs = null;
+ ColumnDescr colum = null;
+ AttributeDescr module = null;
-
- rule = null;
- AndDescr lhs = null;
- ColumnDescr colum = null;
- AttributeDescr module = null;
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:236:4: (loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs] )* '=>' engine= rhs RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:236:4: loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs] )* '=>' engine= rhs RIGHT_PAREN
{
- loc=(Token)input.LT(1);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_defrule68);
- match(input,DEFRULE,FOLLOW_DEFRULE_in_defrule76);
- ruleName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_defrule80);
-
- debug( "start rule: " + ruleName.getText() );
- String ruleStr = ruleName.getText();
-
- if ( ruleStr.indexOf("::") >= 0 ) {
- String mod = ruleStr.substring(0, ruleStr.indexOf("::"));
- ruleStr = ruleStr.substring(ruleStr.indexOf("::")+2);
- module = new AttributeDescr( "agenda-group", mod );
- module.setLocation( offset(ruleName.getLine()), ruleName.getCharPositionInLine() );
- module.setStartCharacter( ((CommonToken)ruleName).getStartIndex() );
- module.setEndCharacter( ((CommonToken)ruleName).getStopIndex() );
- }
-
- rule = new RuleDescr( ruleStr, null );
- if( module != null ) {
- rule.addAttribute( module );
- }
-
- rule.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
- rule.setStartCharacter( ((CommonToken)loc).getStartIndex() );
-
- // not sure how you define where a LHS starts in clips, so just putting it here for now
- lhs = new AndDescr();
- rule.setLhs( lhs );
- lhs.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
- lhs.setStartCharacter( ((CommonToken)loc).getStartIndex() );
-
- documentation=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_defrule92);
-
- // do nothing here for now
-
- pushFollow(FOLLOW_ruleAttribute_in_defrule98);
- ruleAttribute(rule);
- _fsp--;
+ loc = (Token) input.LT( 1 );
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_defrule68 );
+ match( input,
+ DEFRULE,
+ FOLLOW_DEFRULE_in_defrule76 );
+ ruleName = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_defrule80 );
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:271:3: ( ce[lhs] )*
- loop1:
- do {
- int alt1=2;
- int LA1_0 = input.LA(1);
- if ( (LA1_0==LEFT_PAREN||LA1_0==VAR) ) {
- alt1=1;
+ debug( "start rule: " + ruleName.getText() );
+ String ruleStr = ruleName.getText();
+
+ if ( ruleStr.indexOf( "::" ) >= 0 ) {
+ String mod = ruleStr.substring( 0,
+ ruleStr.indexOf( "::" ) );
+ ruleStr = ruleStr.substring( ruleStr.indexOf( "::" ) + 2 );
+ module = new AttributeDescr( "agenda-group",
+ mod );
+ module.setLocation( offset( ruleName.getLine() ),
+ ruleName.getCharPositionInLine() );
+ module.setStartCharacter( ((CommonToken) ruleName).getStartIndex() );
+ module.setEndCharacter( ((CommonToken) ruleName).getStopIndex() );
}
+ rule = new RuleDescr( ruleStr,
+ null );
+ if ( module != null ) {
+ rule.addAttribute( module );
+ }
- switch (alt1) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:271:3: ce[lhs]
- {
- pushFollow(FOLLOW_ce_in_defrule106);
- ce(lhs);
- _fsp--;
+ rule.setLocation( offset( loc.getLine() ),
+ loc.getCharPositionInLine() );
+ rule.setStartCharacter( ((CommonToken) loc).getStartIndex() );
+ // not sure how you define where a LHS starts in clips, so just putting it here for now
+ lhs = new AndDescr();
+ rule.setLhs( lhs );
+ lhs.setLocation( offset( loc.getLine() ),
+ loc.getCharPositionInLine() );
+ lhs.setStartCharacter( ((CommonToken) loc).getStartIndex() );
- }
- break;
+ documentation = (Token) input.LT( 1 );
+ match( input,
+ STRING,
+ FOLLOW_STRING_in_defrule92 );
- default :
- break loop1;
- }
- } while (true);
+ // do nothing here for now
- match(input,41,FOLLOW_41_in_defrule115);
- pushFollow(FOLLOW_rhs_in_defrule124);
- engine=rhs();
- _fsp--;
+ pushFollow( FOLLOW_ruleAttribute_in_defrule98 );
+ ruleAttribute( rule );
+ _fsp--;
- rule.setConsequence( engine );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_defrule133);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:271:3: ( ce[lhs] )*
+ loop1 : do {
+ int alt1 = 2;
+ int LA1_0 = input.LA( 1 );
+ if ( (LA1_0 == LEFT_PAREN || LA1_0 == VAR) ) {
+ alt1 = 1;
+ }
+ switch ( alt1 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:271:3: ce[lhs]
+ {
+ pushFollow( FOLLOW_ce_in_defrule106 );
+ ce( lhs );
+ _fsp--;
+
+ }
+ break;
+
+ default :
+ break loop1;
+ }
+ } while ( true );
+
+ match( input,
+ 41,
+ FOLLOW_41_in_defrule115 );
+ pushFollow( FOLLOW_rhs_in_defrule124 );
+ engine = rhs();
+ _fsp--;
+
+ rule.setConsequence( engine );
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_defrule133 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return rule;
}
+
// $ANTLR end defrule
-
// $ANTLR start ruleAttribute
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:281:1: ruleAttribute[RuleDescr rule] : ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? ;
public void ruleAttribute(RuleDescr rule) throws RecognitionException {
AttributeDescr d = null;
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:3: ( ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
- int alt3=2;
- int LA3_0 = input.LA(1);
- if ( (LA3_0==LEFT_PAREN) ) {
- int LA3_1 = input.LA(2);
- if ( (LA3_1==DECLARE) ) {
- alt3=1;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
+ int alt3 = 2;
+ int LA3_0 = input.LA( 1 );
+ if ( (LA3_0 == LEFT_PAREN) ) {
+ int LA3_1 = input.LA( 2 );
+ if ( (LA3_1 == DECLARE) ) {
+ alt3 = 1;
+ }
}
- }
- switch (alt3) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:5: LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN
+ switch ( alt3 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:283:5: LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute150);
- match(input,DECLARE,FOLLOW_DECLARE_in_ruleAttribute152);
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:284:4: ( LEFT_PAREN d= salience RIGHT_PAREN )?
- int alt2=2;
- int LA2_0 = input.LA(1);
- if ( (LA2_0==LEFT_PAREN) ) {
- alt2=1;
- }
- switch (alt2) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:284:6: LEFT_PAREN d= salience RIGHT_PAREN
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_ruleAttribute150 );
+ match( input,
+ DECLARE,
+ FOLLOW_DECLARE_in_ruleAttribute152 );
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:284:4: ( LEFT_PAREN d= salience RIGHT_PAREN )?
+ int alt2 = 2;
+ int LA2_0 = input.LA( 1 );
+ if ( (LA2_0 == LEFT_PAREN) ) {
+ alt2 = 1;
+ }
+ switch ( alt2 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:284:6: LEFT_PAREN d= salience RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute159);
- pushFollow(FOLLOW_salience_in_ruleAttribute163);
- d=salience();
- _fsp--;
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_ruleAttribute159 );
+ pushFollow( FOLLOW_salience_in_ruleAttribute163 );
+ d = salience();
+ _fsp--;
- rule.addAttribute( d );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute167);
+ rule.addAttribute( d );
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_ruleAttribute167 );
}
- break;
+ break;
- }
+ }
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute174);
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_ruleAttribute174 );
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end ruleAttribute
-
// $ANTLR start salience
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:288:1: salience returns [AttributeDescr d ] : loc= SALIENCE i= INT ;
public AttributeDescr salience() throws RecognitionException {
AttributeDescr d = null;
- Token loc=null;
- Token i=null;
+ Token loc = null;
+ Token i = null;
-
- d = null;
-
+ d = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:293:3: (loc= SALIENCE i= INT )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:293:3: loc= SALIENCE i= INT
{
- loc=(Token)input.LT(1);
- match(input,SALIENCE,FOLLOW_SALIENCE_in_salience204);
- i=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_salience208);
-
- d = new AttributeDescr( "salience", i.getText() );
- d.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
- d.setStartCharacter( ((CommonToken)loc).getStartIndex() );
- d.setEndCharacter( ((CommonToken)i).getStopIndex() );
-
+ loc = (Token) input.LT( 1 );
+ match( input,
+ SALIENCE,
+ FOLLOW_SALIENCE_in_salience204 );
+ i = (Token) input.LT( 1 );
+ match( input,
+ INT,
+ FOLLOW_INT_in_salience208 );
+ d = new AttributeDescr( "salience",
+ i.getText() );
+ d.setLocation( offset( loc.getLine() ),
+ loc.getCharPositionInLine() );
+ d.setStartCharacter( ((CommonToken) loc).getStartIndex() );
+ d.setEndCharacter( ((CommonToken) i).getStopIndex() );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return d;
}
+
// $ANTLR end salience
-
// $ANTLR start ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:303:1: ce[ConditionalElementDescr in_ce] : ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] ) ;
public void ce(ConditionalElementDescr in_ce) throws RecognitionException {
@@ -467,135 +496,128 @@
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:4: ( ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )
- int alt4=7;
- int LA4_0 = input.LA(1);
- if ( (LA4_0==LEFT_PAREN) ) {
- switch ( input.LA(2) ) {
- case NAME:
- alt4=6;
- break;
- case AND:
- alt4=1;
- break;
- case OR:
- alt4=2;
- break;
- case EXISTS:
- alt4=4;
- break;
- case NOT:
- alt4=3;
- break;
- case TEST:
- alt4=5;
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )", 4, 1, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )
+ int alt4 = 7;
+ int LA4_0 = input.LA( 1 );
+ if ( (LA4_0 == LEFT_PAREN) ) {
+ switch ( input.LA( 2 ) ) {
+ case NAME :
+ alt4 = 6;
+ break;
+ case AND :
+ alt4 = 1;
+ break;
+ case OR :
+ alt4 = 2;
+ break;
+ case EXISTS :
+ alt4 = 4;
+ break;
+ case NOT :
+ alt4 = 3;
+ break;
+ case TEST :
+ alt4 = 5;
+ break;
+ default :
+ NoViableAltException nvae = new NoViableAltException( "304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )",
+ 4,
+ 1,
+ input );
+ throw nvae;
+ }
+
+ } else if ( (LA4_0 == VAR) ) {
+ alt4 = 7;
+ } else {
+ NoViableAltException nvae = new NoViableAltException( "304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )",
+ 4,
+ 0,
+ input );
+
throw nvae;
}
-
- }
- else if ( (LA4_0==VAR) ) {
- alt4=7;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("304:4: ( and_ce[in_ce] | or_ce[in_ce] | not_ce[in_ce] | exists_ce[in_ce] | eval_ce[in_ce] | normal_pattern[in_ce] | bound_pattern[in_ce] )", 4, 0, input);
-
- throw nvae;
- }
- switch (alt4) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:8: and_ce[in_ce]
+ switch ( alt4 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:304:8: and_ce[in_ce]
{
- pushFollow(FOLLOW_and_ce_in_ce234);
- and_ce(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_and_ce_in_ce234 );
+ and_ce( in_ce );
+ _fsp--;
-
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:305:7: or_ce[in_ce]
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:305:7: or_ce[in_ce]
{
- pushFollow(FOLLOW_or_ce_in_ce244);
- or_ce(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_or_ce_in_ce244 );
+ or_ce( in_ce );
+ _fsp--;
-
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:306:7: not_ce[in_ce]
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:306:7: not_ce[in_ce]
{
- pushFollow(FOLLOW_not_ce_in_ce253);
- not_ce(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_not_ce_in_ce253 );
+ not_ce( in_ce );
+ _fsp--;
-
}
- break;
- case 4 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:307:7: exists_ce[in_ce]
+ break;
+ case 4 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:307:7: exists_ce[in_ce]
{
- pushFollow(FOLLOW_exists_ce_in_ce262);
- exists_ce(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_exists_ce_in_ce262 );
+ exists_ce( in_ce );
+ _fsp--;
-
}
- break;
- case 5 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:308:8: eval_ce[in_ce]
+ break;
+ case 5 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:308:8: eval_ce[in_ce]
{
- pushFollow(FOLLOW_eval_ce_in_ce276);
- eval_ce(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_eval_ce_in_ce276 );
+ eval_ce( in_ce );
+ _fsp--;
-
}
- break;
- case 6 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:309:7: normal_pattern[in_ce]
+ break;
+ case 6 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:309:7: normal_pattern[in_ce]
{
- pushFollow(FOLLOW_normal_pattern_in_ce290);
- normal_pattern(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_normal_pattern_in_ce290 );
+ normal_pattern( in_ce );
+ _fsp--;
-
}
- break;
- case 7 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:310:7: bound_pattern[in_ce]
+ break;
+ case 7 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:310:7: bound_pattern[in_ce]
{
- pushFollow(FOLLOW_bound_pattern_in_ce299);
- bound_pattern(in_ce);
- _fsp--;
+ pushFollow( FOLLOW_bound_pattern_in_ce299 );
+ bound_pattern( in_ce );
+ _fsp--;
-
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end ce
-
// $ANTLR start rhs
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:314:1: rhs returns [ExecutionEngine engine] : (fc= lisp_list[context, new LispForm(context) ] )* ;
public ExecutionEngine rhs() throws RecognitionException {
@@ -603,769 +625,802 @@
ValueHandler fc = null;
+ engine = new BlockExecutionEngine();
+ ExecutionBuildContext context = new ExecutionBuildContext( engine,
+ functionRegistry );
-
- engine = new BlockExecutionEngine();
- ExecutionBuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:3: ( (fc= lisp_list[context, new LispForm(context) ] )* )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:3: (fc= lisp_list[context, new LispForm(context) ] )*
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:3: (fc= lisp_list[context, new LispForm(context) ] )*
- loop5:
- do {
- int alt5=2;
- int LA5_0 = input.LA(1);
- if ( (LA5_0==LEFT_PAREN) ) {
- alt5=1;
- }
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:3: (fc= lisp_list[context, new LispForm(context) ] )*
+ loop5 : do {
+ int alt5 = 2;
+ int LA5_0 = input.LA( 1 );
+ if ( (LA5_0 == LEFT_PAREN) ) {
+ alt5 = 1;
+ }
+ switch ( alt5 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:4: fc= lisp_list[context, new LispForm(context) ]
+ {
+ pushFollow( FOLLOW_lisp_list_in_rhs331 );
+ fc = lisp_list( context,
+ new LispForm( context ) );
+ _fsp--;
- switch (alt5) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:321:4: fc= lisp_list[context, new LispForm(context) ]
- {
- pushFollow(FOLLOW_lisp_list_in_rhs331);
- fc=lisp_list(context, new LispForm(context) );
- _fsp--;
+ context.addFunction( (FunctionCaller) fc );
- context.addFunction( (FunctionCaller) fc );
+ }
+ break;
- }
- break;
+ default :
+ break loop5;
+ }
+ } while ( true );
- default :
- break loop5;
- }
- } while (true);
-
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return engine;
}
+
// $ANTLR end rhs
-
// $ANTLR start and_ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:324:1: and_ce[ConditionalElementDescr in_ce] : LEFT_PAREN AND ( ce[andDescr] )+ RIGHT_PAREN ;
public void and_ce(ConditionalElementDescr in_ce) throws RecognitionException {
-
- AndDescr andDescr= null;
-
+
+ AndDescr andDescr = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:328:4: ( LEFT_PAREN AND ( ce[andDescr] )+ RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:328:4: LEFT_PAREN AND ( ce[andDescr] )+ RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_and_ce359);
- match(input,AND,FOLLOW_AND_in_and_ce364);
-
- andDescr = new AndDescr();
- in_ce.addDescr( andDescr );
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:333:3: ( ce[andDescr] )+
- int cnt6=0;
- loop6:
- do {
- int alt6=2;
- int LA6_0 = input.LA(1);
- if ( (LA6_0==LEFT_PAREN||LA6_0==VAR) ) {
- alt6=1;
- }
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_and_ce359 );
+ match( input,
+ AND,
+ FOLLOW_AND_in_and_ce364 );
+ andDescr = new AndDescr();
+ in_ce.addDescr( andDescr );
- switch (alt6) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:333:3: ce[andDescr]
- {
- pushFollow(FOLLOW_ce_in_and_ce370);
- ce(andDescr);
- _fsp--;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:333:3: ( ce[andDescr] )+
+ int cnt6 = 0;
+ loop6 : do {
+ int alt6 = 2;
+ int LA6_0 = input.LA( 1 );
+ if ( (LA6_0 == LEFT_PAREN || LA6_0 == VAR) ) {
+ alt6 = 1;
+ }
+ switch ( alt6 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:333:3: ce[andDescr]
+ {
+ pushFollow( FOLLOW_ce_in_and_ce370 );
+ ce( andDescr );
+ _fsp--;
- }
- break;
+ }
+ break;
- default :
- if ( cnt6 >= 1 ) break loop6;
- EarlyExitException eee =
- new EarlyExitException(6, input);
- throw eee;
- }
- cnt6++;
- } while (true);
+ default :
+ if ( cnt6 >= 1 ) break loop6;
+ EarlyExitException eee = new EarlyExitException( 6,
+ input );
+ throw eee;
+ }
+ cnt6++;
+ } while ( true );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_and_ce379);
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_and_ce379 );
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end and_ce
-
// $ANTLR start or_ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:337:1: or_ce[ConditionalElementDescr in_ce] : LEFT_PAREN OR ( ce[orDescr] )+ RIGHT_PAREN ;
public void or_ce(ConditionalElementDescr in_ce) throws RecognitionException {
-
- OrDescr orDescr= null;
-
+
+ OrDescr orDescr = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:341:4: ( LEFT_PAREN OR ( ce[orDescr] )+ RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:341:4: LEFT_PAREN OR ( ce[orDescr] )+ RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_or_ce407);
- match(input,OR,FOLLOW_OR_in_or_ce412);
-
- orDescr = new OrDescr();
- in_ce.addDescr( orDescr );
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:346:3: ( ce[orDescr] )+
- int cnt7=0;
- loop7:
- do {
- int alt7=2;
- int LA7_0 = input.LA(1);
- if ( (LA7_0==LEFT_PAREN||LA7_0==VAR) ) {
- alt7=1;
- }
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_or_ce407 );
+ match( input,
+ OR,
+ FOLLOW_OR_in_or_ce412 );
+ orDescr = new OrDescr();
+ in_ce.addDescr( orDescr );
- switch (alt7) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:346:3: ce[orDescr]
- {
- pushFollow(FOLLOW_ce_in_or_ce418);
- ce(orDescr);
- _fsp--;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:346:3: ( ce[orDescr] )+
+ int cnt7 = 0;
+ loop7 : do {
+ int alt7 = 2;
+ int LA7_0 = input.LA( 1 );
+ if ( (LA7_0 == LEFT_PAREN || LA7_0 == VAR) ) {
+ alt7 = 1;
+ }
+ switch ( alt7 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:346:3: ce[orDescr]
+ {
+ pushFollow( FOLLOW_ce_in_or_ce418 );
+ ce( orDescr );
+ _fsp--;
- }
- break;
+ }
+ break;
- default :
- if ( cnt7 >= 1 ) break loop7;
- EarlyExitException eee =
- new EarlyExitException(7, input);
- throw eee;
- }
- cnt7++;
- } while (true);
+ default :
+ if ( cnt7 >= 1 ) break loop7;
+ EarlyExitException eee = new EarlyExitException( 7,
+ input );
+ throw eee;
+ }
+ cnt7++;
+ } while ( true );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_or_ce427);
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_or_ce427 );
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end or_ce
-
// $ANTLR start not_ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:350:1: not_ce[ConditionalElementDescr in_ce] : LEFT_PAREN NOT ce[notDescr] RIGHT_PAREN ;
public void not_ce(ConditionalElementDescr in_ce) throws RecognitionException {
-
- NotDescr notDescr= null;
-
+
+ NotDescr notDescr = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:354:4: ( LEFT_PAREN NOT ce[notDescr] RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:354:4: LEFT_PAREN NOT ce[notDescr] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_not_ce455);
- match(input,NOT,FOLLOW_NOT_in_not_ce460);
-
- notDescr = new NotDescr();
- in_ce.addDescr( notDescr );
-
- pushFollow(FOLLOW_ce_in_not_ce466);
- ce(notDescr);
- _fsp--;
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_not_ce455 );
+ match( input,
+ NOT,
+ FOLLOW_NOT_in_not_ce460 );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_not_ce474);
+ notDescr = new NotDescr();
+ in_ce.addDescr( notDescr );
+ pushFollow( FOLLOW_ce_in_not_ce466 );
+ ce( notDescr );
+ _fsp--;
+
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_not_ce474 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end not_ce
-
// $ANTLR start exists_ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:363:1: exists_ce[ConditionalElementDescr in_ce] : LEFT_PAREN EXISTS ce[existsDescr] RIGHT_PAREN ;
public void exists_ce(ConditionalElementDescr in_ce) throws RecognitionException {
-
- ExistsDescr existsDescr= null;
-
+
+ ExistsDescr existsDescr = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:367:4: ( LEFT_PAREN EXISTS ce[existsDescr] RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:367:4: LEFT_PAREN EXISTS ce[existsDescr] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_exists_ce503);
- match(input,EXISTS,FOLLOW_EXISTS_in_exists_ce508);
-
- existsDescr = new ExistsDescr();
- in_ce.addDescr( existsDescr );
-
- pushFollow(FOLLOW_ce_in_exists_ce514);
- ce(existsDescr);
- _fsp--;
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_exists_ce503 );
+ match( input,
+ EXISTS,
+ FOLLOW_EXISTS_in_exists_ce508 );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_exists_ce522);
+ existsDescr = new ExistsDescr();
+ in_ce.addDescr( existsDescr );
+ pushFollow( FOLLOW_ce_in_exists_ce514 );
+ ce( existsDescr );
+ _fsp--;
+
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_exists_ce522 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end exists_ce
-
// $ANTLR start eval_ce
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:376:1: eval_ce[ConditionalElementDescr in_ce] : LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN ;
public void eval_ce(ConditionalElementDescr in_ce) throws RecognitionException {
ValueHandler fc = null;
+ EvalDescr evalDescr = null;
+ ExecutionEngine engine = new CLPEval();
+ ExecutionBuildContext context = new ExecutionBuildContext( engine,
+ functionRegistry );
-
- EvalDescr evalDescr= null;
- ExecutionEngine engine = new CLPEval();
- ExecutionBuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:382:4: ( LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:382:4: LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_eval_ce550);
- match(input,TEST,FOLLOW_TEST_in_eval_ce555);
-
- evalDescr = new EvalDescr();
- in_ce.addDescr( evalDescr );
-
- pushFollow(FOLLOW_lisp_list_in_eval_ce563);
- fc=lisp_list(context, new LispForm(context));
- _fsp--;
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_eval_ce550 );
+ match( input,
+ TEST,
+ FOLLOW_TEST_in_eval_ce555 );
-
- engine.addFunction( (FunctionCaller) fc );
- evalDescr.setContent( engine );
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_eval_ce574);
+ evalDescr = new EvalDescr();
+ in_ce.addDescr( evalDescr );
+ pushFollow( FOLLOW_lisp_list_in_eval_ce563 );
+ fc = lisp_list( context,
+ new LispForm( context ) );
+ _fsp--;
+
+ engine.addFunction( (FunctionCaller) fc );
+ evalDescr.setContent( engine );
+
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_eval_ce574 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end eval_ce
-
// $ANTLR start normal_pattern
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:394:1: normal_pattern[ConditionalElementDescr in_ce] : LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN ;
public void normal_pattern(ConditionalElementDescr in_ce) throws RecognitionException {
- Token name=null;
+ Token name = null;
-
- ColumnDescr column = null;
-
+ ColumnDescr column = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:398:4: ( LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:398:4: LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_normal_pattern602);
- name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_normal_pattern609);
-
- column = new ColumnDescr(name.getText());
- in_ce.addDescr( column );
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:403:3: ( field_constriant[column] )*
- loop8:
- do {
- int alt8=2;
- int LA8_0 = input.LA(1);
- if ( (LA8_0==LEFT_PAREN) ) {
- alt8=1;
- }
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_normal_pattern602 );
+ name = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_normal_pattern609 );
+ column = new ColumnDescr( name.getText() );
+ in_ce.addDescr( column );
- switch (alt8) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:403:3: field_constriant[column]
- {
- pushFollow(FOLLOW_field_constriant_in_normal_pattern615);
- field_constriant(column);
- _fsp--;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:403:3: ( field_constriant[column] )*
+ loop8 : do {
+ int alt8 = 2;
+ int LA8_0 = input.LA( 1 );
+ if ( (LA8_0 == LEFT_PAREN) ) {
+ alt8 = 1;
+ }
+ switch ( alt8 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:403:3: field_constriant[column]
+ {
+ pushFollow( FOLLOW_field_constriant_in_normal_pattern615 );
+ field_constriant( column );
+ _fsp--;
- }
- break;
+ }
+ break;
- default :
- break loop8;
- }
- } while (true);
+ default :
+ break loop8;
+ }
+ } while ( true );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_normal_pattern625);
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_normal_pattern625 );
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end normal_pattern
-
// $ANTLR start bound_pattern
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:409:1: bound_pattern[ConditionalElementDescr in_ce] : var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN ;
public void bound_pattern(ConditionalElementDescr in_ce) throws RecognitionException {
- Token var=null;
- Token name=null;
+ Token var = null;
+ Token name = null;
-
- ColumnDescr column = null;
- String identifier = null;
-
+ ColumnDescr column = null;
+ String identifier = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:414:4: (var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:414:4: var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[column] )* RIGHT_PAREN
{
- var=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_bound_pattern653);
-
- identifier = var.getText();
-
- match(input,ASSIGN_OP,FOLLOW_ASSIGN_OP_in_bound_pattern659);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_bound_pattern661);
- name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_bound_pattern665);
-
- column = new ColumnDescr(name.getText());
- column.setIdentifier( identifier );
- in_ce.addDescr( column );
-
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:3: ( field_constriant[column] )*
- loop9:
- do {
- int alt9=2;
- int LA9_0 = input.LA(1);
- if ( (LA9_0==LEFT_PAREN) ) {
- alt9=1;
- }
+ var = (Token) input.LT( 1 );
+ match( input,
+ VAR,
+ FOLLOW_VAR_in_bound_pattern653 );
+ identifier = var.getText();
- switch (alt9) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:3: field_constriant[column]
- {
- pushFollow(FOLLOW_field_constriant_in_bound_pattern674);
- field_constriant(column);
- _fsp--;
+ match( input,
+ ASSIGN_OP,
+ FOLLOW_ASSIGN_OP_in_bound_pattern659 );
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_bound_pattern661 );
+ name = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_bound_pattern665 );
+ column = new ColumnDescr( name.getText() );
+ column.setIdentifier( identifier );
+ in_ce.addDescr( column );
- }
- break;
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:3: ( field_constriant[column] )*
+ loop9 : do {
+ int alt9 = 2;
+ int LA9_0 = input.LA( 1 );
+ if ( (LA9_0 == LEFT_PAREN) ) {
+ alt9 = 1;
+ }
- default :
- break loop9;
- }
- } while (true);
+ switch ( alt9 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:3: field_constriant[column]
+ {
+ pushFollow( FOLLOW_field_constriant_in_bound_pattern674 );
+ field_constriant( column );
+ _fsp--;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_bound_pattern681);
+ }
+ break;
+ default :
+ break loop9;
+ }
+ } while ( true );
+
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_bound_pattern681 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end bound_pattern
-
// $ANTLR start field_constriant
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:427:1: field_constriant[ColumnDescr column] : LEFT_PAREN f= NAME connected_constraint[fc, column] RIGHT_PAREN ;
public void field_constriant(ColumnDescr column) throws RecognitionException {
- Token f=null;
+ Token f = null;
-
- List list = new ArrayList();
- FieldBindingDescr fbd = null;
- FieldConstraintDescr fc = null;
- String op = "==";
-
+ List list = new ArrayList();
+ FieldBindingDescr fbd = null;
+ FieldConstraintDescr fc = null;
+ String op = "==";
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:435:3: ( LEFT_PAREN f= NAME connected_constraint[fc, column] RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:435:3: LEFT_PAREN f= NAME connected_constraint[fc, column] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_field_constriant712);
- f=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_field_constriant716);
-
- fc = new FieldConstraintDescr(f.getText());
- fc.setLocation( offset(f.getLine()), f.getCharPositionInLine() );
- fc.setStartCharacter( ((CommonToken)f).getStartIndex() );
- column.addDescr( fc );
-
- pushFollow(FOLLOW_connected_constraint_in_field_constriant731);
- connected_constraint(fc, column);
- _fsp--;
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_field_constriant712 );
+ f = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_field_constriant716 );
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_field_constriant737);
+ fc = new FieldConstraintDescr( f.getText() );
+ fc.setLocation( offset( f.getLine() ),
+ f.getCharPositionInLine() );
+ fc.setStartCharacter( ((CommonToken) f).getStartIndex() );
+ column.addDescr( fc );
+ pushFollow( FOLLOW_connected_constraint_in_field_constriant731 );
+ connected_constraint( fc,
+ column );
+ _fsp--;
+
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_field_constriant737 );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end field_constriant
-
// $ANTLR start connected_constraint
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:447:1: connected_constraint[FieldConstraintDescr fc, ColumnDescr column] : restriction[fc, column] ( AMPERSAND connected_constraint[fc, column] | PIPE connected_constraint[fc, column] )? ;
- public void connected_constraint(FieldConstraintDescr fc, ColumnDescr column) throws RecognitionException {
+ public void connected_constraint(FieldConstraintDescr fc,
+ ColumnDescr column) throws RecognitionException {
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:449:2: ( restriction[fc, column] ( AMPERSAND connected_constraint[fc, column] | PIPE connected_constraint[fc, column] )? )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:449:2: restriction[fc, column] ( AMPERSAND connected_constraint[fc, column] | PIPE connected_constraint[fc, column] )?
{
- pushFollow(FOLLOW_restriction_in_connected_constraint753);
- restriction(fc, column);
- _fsp--;
+ pushFollow( FOLLOW_restriction_in_connected_constraint753 );
+ restriction( fc,
+ column );
+ _fsp--;
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:450:2: ( AMPERSAND connected_constraint[fc, column] | PIPE connected_constraint[fc, column] )?
- int alt10=3;
- int LA10_0 = input.LA(1);
- if ( (LA10_0==AMPERSAND) ) {
- alt10=1;
- }
- else if ( (LA10_0==PIPE) ) {
- alt10=2;
- }
- switch (alt10) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:451:6: AMPERSAND connected_constraint[fc, column]
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:450:2: ( AMPERSAND connected_constraint[fc, column] | PIPE connected_constraint[fc, column] )?
+ int alt10 = 3;
+ int LA10_0 = input.LA( 1 );
+ if ( (LA10_0 == AMPERSAND) ) {
+ alt10 = 1;
+ } else if ( (LA10_0 == PIPE) ) {
+ alt10 = 2;
+ }
+ switch ( alt10 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:451:6: AMPERSAND connected_constraint[fc, column]
{
- match(input,AMPERSAND,FOLLOW_AMPERSAND_in_connected_constraint765);
- fc.addRestriction(new RestrictionConnectiveDescr(RestrictionConnectiveDescr.AND));
- pushFollow(FOLLOW_connected_constraint_in_connected_constraint774);
- connected_constraint(fc, column);
- _fsp--;
+ match( input,
+ AMPERSAND,
+ FOLLOW_AMPERSAND_in_connected_constraint765 );
+ fc.addRestriction( new RestrictionConnectiveDescr( RestrictionConnectiveDescr.AND ) );
+ pushFollow( FOLLOW_connected_constraint_in_connected_constraint774 );
+ connected_constraint( fc,
+ column );
+ _fsp--;
-
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:454:6: PIPE connected_constraint[fc, column]
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:454:6: PIPE connected_constraint[fc, column]
{
- match(input,PIPE,FOLLOW_PIPE_in_connected_constraint786);
- fc.addRestriction(new RestrictionConnectiveDescr(RestrictionConnectiveDescr.OR));
- pushFollow(FOLLOW_connected_constraint_in_connected_constraint795);
- connected_constraint(fc, column);
- _fsp--;
+ match( input,
+ PIPE,
+ FOLLOW_PIPE_in_connected_constraint786 );
+ fc.addRestriction( new RestrictionConnectiveDescr( RestrictionConnectiveDescr.OR ) );
+ pushFollow( FOLLOW_connected_constraint_in_connected_constraint795 );
+ connected_constraint( fc,
+ column );
+ _fsp--;
-
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end connected_constraint
-
// $ANTLR start restriction
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:459:1: restriction[FieldConstraintDescr fc, ColumnDescr column] : ( TILDE )? ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction ) ;
- public void restriction(FieldConstraintDescr fc, ColumnDescr column) throws RecognitionException {
+ public void restriction(FieldConstraintDescr fc,
+ ColumnDescr column) throws RecognitionException {
String lc = null;
+ String op = "==";
-
- String op = "==";
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:4: ( ( TILDE )? ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:4: ( TILDE )? ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:4: ( TILDE )?
- int alt11=2;
- int LA11_0 = input.LA(1);
- if ( (LA11_0==TILDE) ) {
- alt11=1;
- }
- switch (alt11) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:5: TILDE
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:4: ( TILDE )?
+ int alt11 = 2;
+ int LA11_0 = input.LA( 1 );
+ if ( (LA11_0 == TILDE) ) {
+ alt11 = 1;
+ }
+ switch ( alt11 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:463:5: TILDE
{
- match(input,TILDE,FOLLOW_TILDE_in_restriction821);
- op = "!=";
+ match( input,
+ TILDE,
+ FOLLOW_TILDE_in_restriction821 );
+ op = "!=";
}
- break;
+ break;
- }
+ }
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:464:3: ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction )
- int alt12=4;
- switch ( input.LA(1) ) {
- case COLON:
- alt12=1;
- break;
- case EQUALS:
- alt12=2;
- break;
- case VAR:
- alt12=3;
- break;
- case NAME:
- case STRING:
- case INT:
- case FLOAT:
- case BOOL:
- case NULL:
- alt12=4;
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("464:3: ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction )", 12, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:464:3: ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction )
+ int alt12 = 4;
+ switch ( input.LA( 1 ) ) {
+ case COLON :
+ alt12 = 1;
+ break;
+ case EQUALS :
+ alt12 = 2;
+ break;
+ case VAR :
+ alt12 = 3;
+ break;
+ case NAME :
+ case STRING :
+ case INT :
+ case FLOAT :
+ case BOOL :
+ case NULL :
+ alt12 = 4;
+ break;
+ default :
+ NoViableAltException nvae = new NoViableAltException( "464:3: ( predicate_constraint[op, column] | return_value_restriction[op, fc] | variable_restriction[op, fc] | lc= literal_restriction )",
+ 12,
+ 0,
+ input );
- throw nvae;
- }
+ throw nvae;
+ }
- switch (alt12) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:464:5: predicate_constraint[op, column]
+ switch ( alt12 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:464:5: predicate_constraint[op, column]
{
- pushFollow(FOLLOW_predicate_constraint_in_restriction837);
- predicate_constraint(op, column);
- _fsp--;
+ pushFollow( FOLLOW_predicate_constraint_in_restriction837 );
+ predicate_constraint( op,
+ column );
+ _fsp--;
-
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:465:7: return_value_restriction[op, fc]
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:465:7: return_value_restriction[op, fc]
{
- pushFollow(FOLLOW_return_value_restriction_in_restriction853);
- return_value_restriction(op, fc);
- _fsp--;
+ pushFollow( FOLLOW_return_value_restriction_in_restriction853 );
+ return_value_restriction( op,
+ fc );
+ _fsp--;
-
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:466:7: variable_restriction[op, fc]
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:466:7: variable_restriction[op, fc]
{
- pushFollow(FOLLOW_variable_restriction_in_restriction862);
- variable_restriction(op, fc);
- _fsp--;
+ pushFollow( FOLLOW_variable_restriction_in_restriction862 );
+ variable_restriction( op,
+ fc );
+ _fsp--;
-
}
- break;
- case 4 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:467:8: lc= literal_restriction
+ break;
+ case 4 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:467:8: lc= literal_restriction
{
- pushFollow(FOLLOW_literal_restriction_in_restriction874);
- lc=literal_restriction();
- _fsp--;
+ pushFollow( FOLLOW_literal_restriction_in_restriction874 );
+ lc = literal_restriction();
+ _fsp--;
-
- fc.addRestriction( new LiteralRestrictionDescr(op, lc, true) );
- op = "==";
-
+ fc.addRestriction( new LiteralRestrictionDescr( op,
+ lc,
+ true ) );
+ op = "==";
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end restriction
-
// $ANTLR start predicate_constraint
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:474:1: predicate_constraint[String op, ColumnDescr column] : COLON fc= lisp_list[context, new LispForm(context)] ;
- public void predicate_constraint(String op, ColumnDescr column) throws RecognitionException {
+ public void predicate_constraint(String op,
+ ColumnDescr column) throws RecognitionException {
ValueHandler fc = null;
+ ExecutionEngine engine = new CLPPredicate();
+ ExecutionBuildContext context = new ExecutionBuildContext( engine,
+ functionRegistry );
-
- ExecutionEngine engine = new CLPPredicate();
- ExecutionBuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:479:4: ( COLON fc= lisp_list[context, new LispForm(context)] )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:479:4: COLON fc= lisp_list[context, new LispForm(context)]
{
- match(input,COLON,FOLLOW_COLON_in_predicate_constraint916);
- pushFollow(FOLLOW_lisp_list_in_predicate_constraint922);
- fc=lisp_list(context, new LispForm(context));
- _fsp--;
+ match( input,
+ COLON,
+ FOLLOW_COLON_in_predicate_constraint916 );
+ pushFollow( FOLLOW_lisp_list_in_predicate_constraint922 );
+ fc = lisp_list( context,
+ new LispForm( context ) );
+ _fsp--;
-
- engine.addFunction( (FunctionCaller) fc );
- column.addDescr( new PredicateDescr( engine ) );
-
+ engine.addFunction( (FunctionCaller) fc );
+ column.addDescr( new PredicateDescr( engine ) );
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end predicate_constraint
-
// $ANTLR start return_value_restriction
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:488:1: return_value_restriction[String op, FieldConstraintDescr fc] : EQUALS func= lisp_list[context, new LispForm(context)] ;
- public void return_value_restriction(String op, FieldConstraintDescr fc) throws RecognitionException {
+ public void return_value_restriction(String op,
+ FieldConstraintDescr fc) throws RecognitionException {
ValueHandler func = null;
+ ExecutionEngine engine = new CLPReturnValue();
+ ExecutionBuildContext context = new ExecutionBuildContext( engine,
+ functionRegistry );
-
- ExecutionEngine engine = new CLPReturnValue();
- ExecutionBuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:493:4: ( EQUALS func= lisp_list[context, new LispForm(context)] )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:493:4: EQUALS func= lisp_list[context, new LispForm(context)]
{
- match(input,EQUALS,FOLLOW_EQUALS_in_return_value_restriction948);
- pushFollow(FOLLOW_lisp_list_in_return_value_restriction955);
- func=lisp_list(context, new LispForm(context));
- _fsp--;
+ match( input,
+ EQUALS,
+ FOLLOW_EQUALS_in_return_value_restriction948 );
+ pushFollow( FOLLOW_lisp_list_in_return_value_restriction955 );
+ func = lisp_list( context,
+ new LispForm( context ) );
+ _fsp--;
-
- engine.addFunction( (FunctionCaller) func );
- fc.addRestriction( new ReturnValueRestrictionDescr (op, engine ) );
-
+ engine.addFunction( (FunctionCaller) func );
+ fc.addRestriction( new ReturnValueRestrictionDescr( op,
+ engine ) );
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end return_value_restriction
-
// $ANTLR start variable_restriction
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:500:1: variable_restriction[String op, FieldConstraintDescr fc] : var= VAR ;
- public void variable_restriction(String op, FieldConstraintDescr fc) throws RecognitionException {
- Token var=null;
+ public void variable_restriction(String op,
+ FieldConstraintDescr fc) throws RecognitionException {
+ Token var = null;
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:501:4: (var= VAR )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:501:4: var= VAR
{
- var=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_variable_restriction976);
-
- fc.addRestriction( new VariableRestrictionDescr(op, var.getText()) );
-
+ var = (Token) input.LT( 1 );
+ match( input,
+ VAR,
+ FOLLOW_VAR_in_variable_restriction976 );
+ fc.addRestriction( new VariableRestrictionDescr( op,
+ var.getText() ) );
+
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
+ return;
}
+
// $ANTLR end variable_restriction
-
// $ANTLR start literal_restriction
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:507:1: literal_restriction returns [String text] : t= literal ;
public String literal_restriction() throws RecognitionException {
@@ -1373,443 +1428,461 @@
String t = null;
+ text = null;
-
- text = null;
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:512:6: (t= literal )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:512:6: t= literal
{
- pushFollow(FOLLOW_literal_in_literal_restriction1009);
- t=literal();
- _fsp--;
+ pushFollow( FOLLOW_literal_in_literal_restriction1009 );
+ t = literal();
+ _fsp--;
-
- text = t;
-
+ text = t;
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return text;
}
+
// $ANTLR end literal_restriction
-
// $ANTLR start lisp_list
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:517:1: lisp_list[ExecutionBuildContext context, LispList list] returns [ValueHandler valueHandler] : LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN ;
- public ValueHandler lisp_list(ExecutionBuildContext context, LispList list) throws RecognitionException {
+ public ValueHandler lisp_list(ExecutionBuildContext context,
+ LispList list) throws RecognitionException {
ValueHandler valueHandler = null;
ValueHandler a = null;
-
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:518:4: ( LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:518:4: LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_lisp_list1028);
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:519:3: (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )*
- loop13:
- do {
- int alt13=3;
- int LA13_0 = input.LA(1);
- if ( ((LA13_0>=NAME && LA13_0<=STRING)||LA13_0==INT||LA13_0==VAR||(LA13_0>=FLOAT && LA13_0<=NULL)) ) {
- alt13=1;
- }
- else if ( (LA13_0==LEFT_PAREN) ) {
- alt13=2;
- }
+ match( input,
+ LEFT_PAREN,
+ FOLLOW_LEFT_PAREN_in_lisp_list1028 );
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:519:3: (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )*
+ loop13 : do {
+ int alt13 = 3;
+ int LA13_0 = input.LA( 1 );
+ if ( ((LA13_0 >= NAME && LA13_0 <= STRING) || LA13_0 == INT || LA13_0 == VAR || (LA13_0 >= FLOAT && LA13_0 <= NULL)) ) {
+ alt13 = 1;
+ } else if ( (LA13_0 == LEFT_PAREN) ) {
+ alt13 = 2;
+ }
+ switch ( alt13 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:519:6: a= lisp_atom[context]
+ {
+ pushFollow( FOLLOW_lisp_atom_in_lisp_list1038 );
+ a = lisp_atom( context );
+ _fsp--;
- switch (alt13) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:519:6: a= lisp_atom[context]
- {
- pushFollow(FOLLOW_lisp_atom_in_lisp_list1038);
- a=lisp_atom(context);
- _fsp--;
+ list.add( a );
- list.add( a );
+ }
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:520:6: a= lisp_list[context, list.createList()]
+ {
+ pushFollow( FOLLOW_lisp_list_in_lisp_list1054 );
+ a = lisp_list( context,
+ list.createList() );
+ _fsp--;
- }
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:520:6: a= lisp_list[context, list.createList()]
- {
- pushFollow(FOLLOW_lisp_list_in_lisp_list1054);
- a=lisp_list(context, list.createList());
- _fsp--;
+ list.add( a );
- list.add( a );
+ }
+ break;
- }
- break;
+ default :
+ break loop13;
+ }
+ } while ( true );
- default :
- break loop13;
- }
- } while (true);
+ match( input,
+ RIGHT_PAREN,
+ FOLLOW_RIGHT_PAREN_in_lisp_list1084 );
+ valueHandler = list.getValueHandler();
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_lisp_list1084);
- valueHandler = list.getValueHandler();
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return valueHandler;
}
+
// $ANTLR end lisp_list
-
// $ANTLR start lisp_atom
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:526:1: lisp_atom[ExecutionBuildContext context] returns [ValueHandler value] : (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL ) ;
public ValueHandler lisp_atom(ExecutionBuildContext context) throws RecognitionException {
ValueHandler value = null;
- Token t=null;
+ Token t = null;
-
- value = null;
-
+ value = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:3: ( (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )
- int alt14=7;
- switch ( input.LA(1) ) {
- case VAR:
- alt14=1;
- break;
- case STRING:
- alt14=2;
- break;
- case NAME:
- alt14=3;
- break;
- case FLOAT:
- alt14=4;
- break;
- case INT:
- alt14=5;
- break;
- case BOOL:
- alt14=6;
- break;
- case NULL:
- alt14=7;
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("531:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )", 14, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )
+ int alt14 = 7;
+ switch ( input.LA( 1 ) ) {
+ case VAR :
+ alt14 = 1;
+ break;
+ case STRING :
+ alt14 = 2;
+ break;
+ case NAME :
+ alt14 = 3;
+ break;
+ case FLOAT :
+ alt14 = 4;
+ break;
+ case INT :
+ alt14 = 5;
+ break;
+ case BOOL :
+ alt14 = 6;
+ break;
+ case NULL :
+ alt14 = 7;
+ break;
+ default :
+ NoViableAltException nvae = new NoViableAltException( "531:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )",
+ 14,
+ 0,
+ input );
- throw nvae;
- }
+ throw nvae;
+ }
- switch (alt14) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:6: t= VAR
+ switch ( alt14 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:6: t= VAR
{
- t=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_lisp_atom1121);
- value = context.getVariableValueHandler(t.getText() );
+ t = (Token) input.LT( 1 );
+ match( input,
+ VAR,
+ FOLLOW_VAR_in_lisp_atom1121 );
+ value = context.getVariableValueHandler( t.getText() );
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:532:6: t= STRING
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:532:6: t= STRING
{
- t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_lisp_atom1133);
- value = new ObjectLiteralValue( getString( t ) );
+ t = (Token) input.LT( 1 );
+ match( input,
+ STRING,
+ FOLLOW_STRING_in_lisp_atom1133 );
+ value = new ObjectValueHandler( getString( t ) );
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:533:7: t= NAME
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:533:7: t= NAME
{
- t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_lisp_atom1145);
- value = new ObjectLiteralValue( t.getText() );
+ t = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_lisp_atom1145 );
+ value = new ObjectValueHandler( t.getText() );
}
- break;
- case 4 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:534:6: t= FLOAT
+ break;
+ case 4 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:534:6: t= FLOAT
{
- t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_lisp_atom1160);
- value = new DoubleLiteralValue( t.getText() );
+ t = (Token) input.LT( 1 );
+ match( input,
+ FLOAT,
+ FOLLOW_FLOAT_in_lisp_atom1160 );
+ value = new DoubleValueHandler( t.getText() );
}
- break;
- case 5 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:535:6: t= INT
+ break;
+ case 5 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:535:6: t= INT
{
- t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_lisp_atom1172);
- value = new LongLiteralValue( t.getText() );
+ t = (Token) input.LT( 1 );
+ match( input,
+ INT,
+ FOLLOW_INT_in_lisp_atom1172 );
+ value = new LongValueHandler( t.getText() );
}
- break;
- case 6 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:536:6: t= BOOL
+ break;
+ case 6 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:536:6: t= BOOL
{
- t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_lisp_atom1188);
- value = new BooleanLiteralValue( t.getText() );
+ t = (Token) input.LT( 1 );
+ match( input,
+ BOOL,
+ FOLLOW_BOOL_in_lisp_atom1188 );
+ value = new BooleanValueHandler( t.getText() );
}
- break;
- case 7 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:537:6: t= NULL
+ break;
+ case 7 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:537:6: t= NULL
{
- t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_lisp_atom1206);
- value = ObjectLiteralValue.NULL;
+ t = (Token) input.LT( 1 );
+ match( input,
+ NULL,
+ FOLLOW_NULL_in_lisp_atom1206 );
+ value = ObjectValueHandler.NULL;
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return value;
}
+
// $ANTLR end lisp_atom
-
// $ANTLR start literal
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:541:1: literal returns [String text] : (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) ;
public String literal() throws RecognitionException {
String text = null;
- Token t=null;
+ Token t = null;
-
- text = null;
-
+ text = null;
+
try {
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:4: ( (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) )
// C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
{
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
- int alt15=6;
- switch ( input.LA(1) ) {
- case STRING:
- alt15=1;
- break;
- case NAME:
- alt15=2;
- break;
- case INT:
- alt15=3;
- break;
- case FLOAT:
- alt15=4;
- break;
- case BOOL:
- alt15=5;
- break;
- case NULL:
- alt15=6;
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("545:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )", 15, 0, input);
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
+ int alt15 = 6;
+ switch ( input.LA( 1 ) ) {
+ case STRING :
+ alt15 = 1;
+ break;
+ case NAME :
+ alt15 = 2;
+ break;
+ case INT :
+ alt15 = 3;
+ break;
+ case FLOAT :
+ alt15 = 4;
+ break;
+ case BOOL :
+ alt15 = 5;
+ break;
+ case NULL :
+ alt15 = 6;
+ break;
+ default :
+ NoViableAltException nvae = new NoViableAltException( "545:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )",
+ 15,
+ 0,
+ input );
- throw nvae;
- }
+ throw nvae;
+ }
- switch (alt15) {
- case 1 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:8: t= STRING
+ switch ( alt15 ) {
+ case 1 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:545:8: t= STRING
{
- t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_literal1242);
- text = getString( t );
+ t = (Token) input.LT( 1 );
+ match( input,
+ STRING,
+ FOLLOW_STRING_in_literal1242 );
+ text = getString( t );
}
- break;
- case 2 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:546:7: t= NAME
+ break;
+ case 2 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:546:7: t= NAME
{
- t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_literal1255);
- text = t.getText();
+ t = (Token) input.LT( 1 );
+ match( input,
+ NAME,
+ FOLLOW_NAME_in_literal1255 );
+ text = t.getText();
}
- break;
- case 3 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:547:7: t= INT
+ break;
+ case 3 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:547:7: t= INT
{
- t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_literal1271);
- text = t.getText();
+ t = (Token) input.LT( 1 );
+ match( input,
+ INT,
+ FOLLOW_INT_in_literal1271 );
+ text = t.getText();
}
- break;
- case 4 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:548:7: t= FLOAT
+ break;
+ case 4 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:548:7: t= FLOAT
{
- t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_literal1286);
- text = t.getText();
+ t = (Token) input.LT( 1 );
+ match( input,
+ FLOAT,
+ FOLLOW_FLOAT_in_literal1286 );
+ text = t.getText();
}
- break;
- case 5 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:549:7: t= BOOL
+ break;
+ case 5 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:549:7: t= BOOL
{
- t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_literal1299);
- text = t.getText();
+ t = (Token) input.LT( 1 );
+ match( input,
+ BOOL,
+ FOLLOW_BOOL_in_literal1299 );
+ text = t.getText();
}
- break;
- case 6 :
- // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:550:7: t= NULL
+ break;
+ case 6 :
+ // C:\\dev\\jbossrules\\trunk\\drools-compiler\\src\\main\\resources\\org\\drools\\clp\\CLP.g:550:7: t= NULL
{
- t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_literal1313);
- text = null;
+ t = (Token) input.LT( 1 );
+ match( input,
+ NULL,
+ FOLLOW_NULL_in_literal1313 );
+ text = null;
}
- break;
+ break;
- }
+ }
-
}
+ } catch ( RecognitionException re ) {
+ reportError( re );
+ recover( input,
+ re );
+ } finally {
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
return text;
}
+
// $ANTLR end literal
+ public static final BitSet FOLLOW_LEFT_PAREN_in_defrule68 = new BitSet( new long[]{0x0000000000000020L} );
+ public static final BitSet FOLLOW_DEFRULE_in_defrule76 = new BitSet( new long[]{0x0000000000000040L} );
+ public static final BitSet FOLLOW_NAME_in_defrule80 = new BitSet( new long[]{0x0000000000000080L} );
+ public static final BitSet FOLLOW_STRING_in_defrule92 = new BitSet( new long[]{0x0000020000010010L} );
+ public static final BitSet FOLLOW_ruleAttribute_in_defrule98 = new BitSet( new long[]{0x0000020000010010L} );
+ public static final BitSet FOLLOW_ce_in_defrule106 = new BitSet( new long[]{0x0000020000010010L} );
+ public static final BitSet FOLLOW_41_in_defrule115 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_rhs_in_defrule124 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_defrule133 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute150 = new BitSet( new long[]{0x0000000010000000L} );
+ public static final BitSet FOLLOW_DECLARE_in_ruleAttribute152 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute159 = new BitSet( new long[]{0x0000000000000200L} );
+ public static final BitSet FOLLOW_salience_in_ruleAttribute163 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute167 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute174 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_SALIENCE_in_salience204 = new BitSet( new long[]{0x0000000000000400L} );
+ public static final BitSet FOLLOW_INT_in_salience208 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_and_ce_in_ce234 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_or_ce_in_ce244 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_not_ce_in_ce253 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_exists_ce_in_ce262 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_eval_ce_in_ce276 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_normal_pattern_in_ce290 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_bound_pattern_in_ce299 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_lisp_list_in_rhs331 = new BitSet( new long[]{0x0000000000000012L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_and_ce359 = new BitSet( new long[]{0x0000000000000800L} );
+ public static final BitSet FOLLOW_AND_in_and_ce364 = new BitSet( new long[]{0x0000000000010010L} );
+ public static final BitSet FOLLOW_ce_in_and_ce370 = new BitSet( new long[]{0x0000000000010110L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_and_ce379 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_or_ce407 = new BitSet( new long[]{0x0000000000001000L} );
+ public static final BitSet FOLLOW_OR_in_or_ce412 = new BitSet( new long[]{0x0000000000010010L} );
+ public static final BitSet FOLLOW_ce_in_or_ce418 = new BitSet( new long[]{0x0000000000010110L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_or_ce427 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_not_ce455 = new BitSet( new long[]{0x0000000000002000L} );
+ public static final BitSet FOLLOW_NOT_in_not_ce460 = new BitSet( new long[]{0x0000000000010010L} );
+ public static final BitSet FOLLOW_ce_in_not_ce466 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_not_ce474 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_exists_ce503 = new BitSet( new long[]{0x0000000000004000L} );
+ public static final BitSet FOLLOW_EXISTS_in_exists_ce508 = new BitSet( new long[]{0x0000000000010010L} );
+ public static final BitSet FOLLOW_ce_in_exists_ce514 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_exists_ce522 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_eval_ce550 = new BitSet( new long[]{0x0000000000008000L} );
+ public static final BitSet FOLLOW_TEST_in_eval_ce555 = new BitSet( new long[]{0x0000000000000010L} );
+ public static final BitSet FOLLOW_lisp_list_in_eval_ce563 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_eval_ce574 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_normal_pattern602 = new BitSet( new long[]{0x0000000000000040L} );
+ public static final BitSet FOLLOW_NAME_in_normal_pattern609 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_field_constriant_in_normal_pattern615 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_normal_pattern625 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_VAR_in_bound_pattern653 = new BitSet( new long[]{0x0000000000020000L} );
+ public static final BitSet FOLLOW_ASSIGN_OP_in_bound_pattern659 = new BitSet( new long[]{0x0000000000000010L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_bound_pattern661 = new BitSet( new long[]{0x0000000000000040L} );
+ public static final BitSet FOLLOW_NAME_in_bound_pattern665 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_field_constriant_in_bound_pattern674 = new BitSet( new long[]{0x0000000000000110L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_bound_pattern681 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_field_constriant712 = new BitSet( new long[]{0x0000000000000040L} );
+ public static final BitSet FOLLOW_NAME_in_field_constriant716 = new BitSet( new long[]{0x0000000003F104C0L} );
+ public static final BitSet FOLLOW_connected_constraint_in_field_constriant731 = new BitSet( new long[]{0x0000000000000100L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_field_constriant737 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_restriction_in_connected_constraint753 = new BitSet( new long[]{0x00000000000C0002L} );
+ public static final BitSet FOLLOW_AMPERSAND_in_connected_constraint765 = new BitSet( new long[]{0x0000000003F104C0L} );
+ public static final BitSet FOLLOW_connected_constraint_in_connected_constraint774 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_PIPE_in_connected_constraint786 = new BitSet( new long[]{0x0000000003F104C0L} );
+ public static final BitSet FOLLOW_connected_constraint_in_connected_constraint795 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_TILDE_in_restriction821 = new BitSet( new long[]{0x0000000003E104C0L} );
+ public static final BitSet FOLLOW_predicate_constraint_in_restriction837 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_return_value_restriction_in_restriction853 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_variable_restriction_in_restriction862 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_literal_restriction_in_restriction874 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_COLON_in_predicate_constraint916 = new BitSet( new long[]{0x0000000000000010L} );
+ public static final BitSet FOLLOW_lisp_list_in_predicate_constraint922 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_EQUALS_in_return_value_restriction948 = new BitSet( new long[]{0x0000000000000010L} );
+ public static final BitSet FOLLOW_lisp_list_in_return_value_restriction955 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_VAR_in_variable_restriction976 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_literal_in_literal_restriction1009 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_LEFT_PAREN_in_lisp_list1028 = new BitSet( new long[]{0x00000000038105D0L} );
+ public static final BitSet FOLLOW_lisp_atom_in_lisp_list1038 = new BitSet( new long[]{0x00000000038105D0L} );
+ public static final BitSet FOLLOW_lisp_list_in_lisp_list1054 = new BitSet( new long[]{0x00000000038105D0L} );
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_lisp_list1084 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_VAR_in_lisp_atom1121 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_STRING_in_lisp_atom1133 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_NAME_in_lisp_atom1145 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_FLOAT_in_lisp_atom1160 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_INT_in_lisp_atom1172 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_BOOL_in_lisp_atom1188 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_NULL_in_lisp_atom1206 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_STRING_in_literal1242 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_NAME_in_literal1255 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_INT_in_literal1271 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_FLOAT_in_literal1286 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_BOOL_in_literal1299 = new BitSet( new long[]{0x0000000000000002L} );
+ public static final BitSet FOLLOW_NULL_in_literal1313 = new BitSet( new long[]{0x0000000000000002L} );
-
-
- public static final BitSet FOLLOW_LEFT_PAREN_in_defrule68 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_DEFRULE_in_defrule76 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_NAME_in_defrule80 = new BitSet(new long[]{0x0000000000000080L});
- public static final BitSet FOLLOW_STRING_in_defrule92 = new BitSet(new long[]{0x0000020000010010L});
- public static final BitSet FOLLOW_ruleAttribute_in_defrule98 = new BitSet(new long[]{0x0000020000010010L});
- public static final BitSet FOLLOW_ce_in_defrule106 = new BitSet(new long[]{0x0000020000010010L});
- public static final BitSet FOLLOW_41_in_defrule115 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_rhs_in_defrule124 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_defrule133 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute150 = new BitSet(new long[]{0x0000000010000000L});
- public static final BitSet FOLLOW_DECLARE_in_ruleAttribute152 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute159 = new BitSet(new long[]{0x0000000000000200L});
- public static final BitSet FOLLOW_salience_in_ruleAttribute163 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute167 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute174 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SALIENCE_in_salience204 = new BitSet(new long[]{0x0000000000000400L});
- public static final BitSet FOLLOW_INT_in_salience208 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_and_ce_in_ce234 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_or_ce_in_ce244 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_not_ce_in_ce253 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_exists_ce_in_ce262 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_eval_ce_in_ce276 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_normal_pattern_in_ce290 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_bound_pattern_in_ce299 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_lisp_list_in_rhs331 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_and_ce359 = new BitSet(new long[]{0x0000000000000800L});
- public static final BitSet FOLLOW_AND_in_and_ce364 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_and_ce370 = new BitSet(new long[]{0x0000000000010110L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_and_ce379 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_or_ce407 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_OR_in_or_ce412 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_or_ce418 = new BitSet(new long[]{0x0000000000010110L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_or_ce427 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_not_ce455 = new BitSet(new long[]{0x0000000000002000L});
- public static final BitSet FOLLOW_NOT_in_not_ce460 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_not_ce466 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_not_ce474 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_exists_ce503 = new BitSet(new long[]{0x0000000000004000L});
- public static final BitSet FOLLOW_EXISTS_in_exists_ce508 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_exists_ce514 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_exists_ce522 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_eval_ce550 = new BitSet(new long[]{0x0000000000008000L});
- public static final BitSet FOLLOW_TEST_in_eval_ce555 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_eval_ce563 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_eval_ce574 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_normal_pattern602 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_NAME_in_normal_pattern609 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_field_constriant_in_normal_pattern615 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_normal_pattern625 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_bound_pattern653 = new BitSet(new long[]{0x0000000000020000L});
- public static final BitSet FOLLOW_ASSIGN_OP_in_bound_pattern659 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_bound_pattern661 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_NAME_in_bound_pattern665 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_field_constriant_in_bound_pattern674 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_bound_pattern681 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_field_constriant712 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_NAME_in_field_constriant716 = new BitSet(new long[]{0x0000000003F104C0L});
- public static final BitSet FOLLOW_connected_constraint_in_field_constriant731 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_field_constriant737 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_restriction_in_connected_constraint753 = new BitSet(new long[]{0x00000000000C0002L});
- public static final BitSet FOLLOW_AMPERSAND_in_connected_constraint765 = new BitSet(new long[]{0x0000000003F104C0L});
- public static final BitSet FOLLOW_connected_constraint_in_connected_constraint774 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_PIPE_in_connected_constraint786 = new BitSet(new long[]{0x0000000003F104C0L});
- public static final BitSet FOLLOW_connected_constraint_in_connected_constraint795 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_TILDE_in_restriction821 = new BitSet(new long[]{0x0000000003E104C0L});
- public static final BitSet FOLLOW_predicate_constraint_in_restriction837 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_return_value_restriction_in_restriction853 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_variable_restriction_in_restriction862 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_restriction_in_restriction874 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_COLON_in_predicate_constraint916 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_predicate_constraint922 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_EQUALS_in_return_value_restriction948 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_return_value_restriction955 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_variable_restriction976 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_in_literal_restriction1009 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_lisp_list1028 = new BitSet(new long[]{0x00000000038105D0L});
- public static final BitSet FOLLOW_lisp_atom_in_lisp_list1038 = new BitSet(new long[]{0x00000000038105D0L});
- public static final BitSet FOLLOW_lisp_list_in_lisp_list1054 = new BitSet(new long[]{0x00000000038105D0L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_lisp_list1084 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_lisp_atom1121 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_lisp_atom1133 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_lisp_atom1145 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_lisp_atom1160 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_lisp_atom1172 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_lisp_atom1188 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_lisp_atom1206 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_literal1242 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_literal1255 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_literal1271 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_literal1286 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_literal1299 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_literal1313 = new BitSet(new long[]{0x0000000000000002L});
-
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPPredicate.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPPredicate.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPPredicate.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -18,30 +18,30 @@
PredicateExpression,
ExecutionEngine {
private FunctionCaller function;
- private int index;
-
- public CLPPredicate() {
+ private int index;
+
+ public CLPPredicate() {
}
-
+
public CLPPredicate(FunctionCaller function) {
this.function = function;
}
public void addFunction(FunctionCaller function) {
- setFunction( function );
+ setFunction( function );
}
-
+
public void setFunction(FunctionCaller function) {
this.function = function;
}
-
+
public FunctionCaller[] getFunctions() {
- return new FunctionCaller[] { this.function };
- }
-
+ return new FunctionCaller[]{this.function};
+ }
+
public int getNextIndex() {
- return this.index++;
- }
+ return this.index++;
+ }
public boolean evaluate(Object object,
Tuple tuple,
@@ -51,11 +51,11 @@
ExecutionContext context = new ExecutionContext( (InternalWorkingMemory) workingMemory,
(ReteTuple) tuple,
object,
- this.index-1 );
+ this.index - 1 );
return this.function.getBooleanValue( context );
}
-
+
public void replaceTempTokens(Map variables) {
this.function.replaceTempTokens( variables );
- }
+ }
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPReturnValue.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPReturnValue.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/CLPReturnValue.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -20,12 +20,12 @@
ReturnValueExpression,
ExecutionEngine {
private FunctionCaller function;
- private int index;
-
+ private int index;
+
public CLPReturnValue() {
-
+
}
-
+
public CLPReturnValue(FunctionCaller function) {
this.function = function;
}
@@ -33,19 +33,19 @@
public void setFunction(FunctionCaller function) {
this.function = function;
}
-
+
public void addFunction(FunctionCaller function) {
- setFunction( function );
- }
-
+ setFunction( function );
+ }
+
public FunctionCaller[] getFunctions() {
- return new FunctionCaller[] { this.function };
+ return new FunctionCaller[]{this.function};
}
public int getNextIndex() {
- return this.index++;
+ return this.index++;
}
-
+
public FieldValue evaluate(Object object,
Tuple tuple,
Declaration[] previousDeclarations,
@@ -54,11 +54,11 @@
ExecutionContext context = new ExecutionContext( (InternalWorkingMemory) workingMemory,
(ReteTuple) tuple,
object,
- this.index-1 );
+ this.index - 1 );
return FieldFactory.getFieldValue( this.function.getBooleanValue( context ) );
}
-
+
public void replaceTempTokens(Map variables) {
this.function.replaceTempTokens( variables );
- }
+ }
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Deffunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Deffunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Deffunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -60,16 +60,17 @@
}
public ValueHandler execute(ValueHandler[] args,
- ExecutionContext context) {
+ ExecutionContext context) {
ExecutionContext newContext = initContext( args,
context );
- Object returnValue = null;
+ ValueHandler returnValue = null;
for ( int i = 0, length = this.functions.length; i < length; i++ ) {
- returnValue = this.functions[i].getValue( newContext );
+ // We know a function always returns a ValueHandler
+ returnValue = (ValueHandler) this.functions[i].getValue( newContext );
}
- return new ObjectValueHandler( returnValue );
+ return returnValue;
}
private ExecutionContext initContext(ValueHandler[] args,
@@ -81,7 +82,7 @@
// We know that each argument is a local variable, so we can cast and access the underlying value handler,
// as we don't want the variable fully resolved at this stage, just mapped.
newContext.setLocalVariable( i,
- ((LocalVariableValue) args[i]).getRawValue( context ) );
+ ((LocalVariableValue) args[i]).getValue( context ) );
}
return newContext;
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionBuildContext.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionBuildContext.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionBuildContext.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -23,10 +23,10 @@
public FunctionRegistry getFunctionRegistry() {
return this.registry;
}
-
+
public void addFunction(FunctionCaller function) {
this.engine.addFunction( function );
- }
+ }
public Object setProperty(Object key,
Object value) {
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionEngine.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExecutionEngine.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -4,8 +4,8 @@
public interface ExecutionEngine {
public void addFunction(FunctionCaller function);
-
+
public int getNextIndex();
-
+
public FunctionCaller[] getFunctions();
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExpressionExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExpressionExecutionEngine.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ExpressionExecutionEngine.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,16 +1,15 @@
package org.drools.clp;
-
public class ExpressionExecutionEngine { //implements Consequence, ReturnValueExpression, PredicateExpression {
//private Map variableMap = new HashMap();
private Function function;
- private int localVariableSize;
-
+ private int localVariableSize;
+
public ExpressionExecutionEngine() {
-
+
}
-
+
public ExpressionExecutionEngine(Function function) {
this.function = function;
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Function.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Function.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/Function.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,14 +1,16 @@
package org.drools.clp;
+public interface Function { //extends ValueHandler {
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context);
-public interface Function { //extends ValueHandler {
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context);
-
- public String getName();
-
+ public String getName();
+
public void initCallback(ExecutionBuildContext context);
-
- public ValueHandler addParameterCallback(int index, ValueHandler valueHandler, ExecutionBuildContext context );
-
- public LispList createList(int index);
+
+ public ValueHandler addParameterCallback(int index,
+ ValueHandler valueHandler,
+ ExecutionBuildContext context);
+
+ public LispList createList(int index);
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionDelegator.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionDelegator.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionDelegator.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -17,7 +17,7 @@
public void setFunction(Function function) {
this.function = function;
}
-
+
public Function getFunction() {
return this.function;
}
@@ -35,7 +35,7 @@
}
public ValueHandler execute(ValueHandler[] args,
- ExecutionContext context) {
+ ExecutionContext context) {
return function.execute( args,
context );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionRegistry.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionRegistry.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/FunctionRegistry.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -6,19 +6,19 @@
import java.util.HashMap;
import java.util.Map;
-public class FunctionRegistry {
- public Map functions;
-
+public class FunctionRegistry {
+ public Map functions;
+
public BuiltinFunctions builtin;
-
+
//public Map variables;
-
+
public FunctionRegistry(BuiltinFunctions builtin) {
this.functions = new HashMap();
//this.variables = new HashMap();
-
+
this.builtin = builtin;
-
+
try {
loadFunctions();
} catch ( IOException e ) {
@@ -26,86 +26,90 @@
} catch ( ClassNotFoundException e ) {
throw new RuntimeException( e );
}
- }
-
- public void loadFunctions() throws IOException, ClassNotFoundException {
+ }
+
+ public void loadFunctions() throws IOException,
+ ClassNotFoundException {
BufferedReader reader = new BufferedReader( new InputStreamReader( getClass().getResourceAsStream( "functions.conf" ) ) );
loadFunctions( reader );
}
-
- public void loadFunctions(BufferedReader reader) throws IOException, ClassNotFoundException {
- String line = null;
-
+
+ public void loadFunctions(BufferedReader reader) throws IOException,
+ ClassNotFoundException {
+ String line = null;
+
try {
- while( (line = reader.readLine() ) != null ) {
+ while ( (line = reader.readLine()) != null ) {
Class clazz = getClass().getClassLoader().loadClass( line );
- Function function = ( Function) clazz.newInstance();
+ Function function = (Function) clazz.newInstance();
addFunction( function );
}
- } catch(IllegalAccessException e) {
- throw new RuntimeException( e );
- } catch(InstantiationException e) {
+ } catch ( IllegalAccessException e ) {
throw new RuntimeException( e );
+ } catch ( InstantiationException e ) {
+ throw new RuntimeException( e );
}
}
-
+
public Function getFunction(String name) {
- Function function = ( Function ) this.functions.get( name );
-
+ Function function = (Function) this.functions.get( name );
+
if ( function == null ) {
// Allows for late binidng FunctionDelegators
function = new FunctionDelegator( name );
- this.functions.put( name, function );
+ this.functions.put( name,
+ function );
}
return function;
}
-
-// public Function createFunction(String name) {
-// try {
-// Class clazz = ( Class ) this.functions.get( name );
-// if ( clazz == null ) {
-// throw new RuntimeException( "Function '" + name + "' does not exist" );
-// }
-// return (Function) clazz.newInstance();
-// } catch ( InstantiationException e ) {
-// throw new RuntimeException( e );
-// } catch ( IllegalAccessException e ) {
-// throw new RuntimeException( e );
-// }
-// }
-
+
+ // public Function createFunction(String name) {
+ // try {
+ // Class clazz = ( Class ) this.functions.get( name );
+ // if ( clazz == null ) {
+ // throw new RuntimeException( "Function '" + name + "' does not exist" );
+ // }
+ // return (Function) clazz.newInstance();
+ // } catch ( InstantiationException e ) {
+ // throw new RuntimeException( e );
+ // } catch ( IllegalAccessException e ) {
+ // throw new RuntimeException( e );
+ // }
+ // }
+
public void addFunction(Function function) {
- FunctionDelegator delegator = ( FunctionDelegator ) this.functions.get( function.getName() );
-
+ FunctionDelegator delegator = (FunctionDelegator) this.functions.get( function.getName() );
+
if ( delegator == null ) {
delegator = new FunctionDelegator( function.getName() );
- this.functions.put( function.getName(), delegator );
+ this.functions.put( function.getName(),
+ delegator );
}
delegator.setFunction( function );
}
-
-// public void init() {
-// this.variables.clear();
-// }
-//
-// public void setVariable(LocalVariableValue variable) {
-// this.variables.put( variable.getIdentifier(), variable );
-// }
-//
-// public VariableValueHandler getVariable(String identifier) {
-// VariableValueHandler variable = ( VariableValueHandler ) this.variables.get( identifier );
-// if ( identifier == null ) {
-// variable = new TempTokenVariable( identifier );
-// this.variables.put( identifier, variable );
-// }
-// return variable;
-// }
-
+
+ // public void init() {
+ // this.variables.clear();
+ // }
+ //
+ // public void setVariable(LocalVariableValue variable) {
+ // this.variables.put( variable.getIdentifier(), variable );
+ // }
+ //
+ // public VariableValueHandler getVariable(String identifier) {
+ // VariableValueHandler variable = ( VariableValueHandler ) this.variables.get( identifier );
+ // if ( identifier == null ) {
+ // variable = new TempTokenVariable( identifier );
+ // this.variables.put( identifier, variable );
+ // }
+ // return variable;
+ // }
+
public int getFunctionSize() {
return this.functions.size();
}
-
-// public int getVariablesSize() {
-// return this.variables.size();
-// }
+
+ // public int getVariablesSize() {
+ // return this.variables.size();
+ // }
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/GeneralParseException.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/GeneralParseException.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/GeneralParseException.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -24,7 +24,7 @@
*
*/
private static final long serialVersionUID = -1743929851876940150L;
- private String message;
+ private String message;
public GeneralParseException(final String message,
final int line) {
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispData.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispData.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispData.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -5,30 +5,30 @@
public class LispData
implements
LispList {
-
- private ListValueHandler list;
+
+ private ListValueHandler list;
private ExecutionBuildContext context;
-
+
public LispData() {
- this.list = new ListValueHandler() ;
+ this.list = new ListValueHandler();
}
public void add(ValueHandler valueHandler) {
this.list.add( valueHandler );
}
-
+
public LispList createList() {
- LispList list = new LispForm( );
-
+ LispList list = new LispForm();
+
list.setContext( this.context );
-
+
return list;
}
-
+
public ValueHandler getValueHandler() {
return this.list;
}
-
+
public void setContext(ExecutionBuildContext context) {
this.context = context;
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispForm.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispForm.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispForm.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -2,17 +2,19 @@
import org.drools.clp.valuehandlers.FunctionCaller;
-public class LispForm implements LispList {
+public class LispForm
+ implements
+ LispList {
private ExecutionBuildContext context;
- private FunctionCaller caller;
+ private FunctionCaller caller;
public LispForm(ExecutionBuildContext context) {
this.context = context;
}
-
+
public LispForm() {
}
-
+
public ValueHandler getValueHandler() {
return this.caller;
}
@@ -21,27 +23,29 @@
// we know this is a string literal, so can use null for the context
if ( this.caller == null ) {
this.caller = new FunctionCaller( this.context.getFunctionRegistry().getFunction( valueHandler.getStringValue( null ) ) );
-
+
//We can only call initCallback on known functions
- FunctionDelegator delegator = ( FunctionDelegator ) this.caller.getFunction();
+ FunctionDelegator delegator = (FunctionDelegator) this.caller.getFunction();
if ( delegator.getFunction() != null ) {
- delegator.getFunction().initCallback( context );
+ delegator.getFunction().initCallback( context );
}
-
+
} else {
// we can only execute callbacks on known functions
- FunctionDelegator delegator = ( FunctionDelegator ) this.caller.getFunction();
+ FunctionDelegator delegator = (FunctionDelegator) this.caller.getFunction();
if ( delegator.getFunction() != null ) {
int length;
if ( this.caller == null || this.caller.getParameters() == null ) {
length = 0;
} else {
- length = ( this.caller == null ) ? 0 : this.caller.getParameters().length;
- }
- valueHandler = delegator.getFunction().addParameterCallback( length, valueHandler, context );
+ length = (this.caller == null) ? 0 : this.caller.getParameters().length;
+ }
+ valueHandler = delegator.getFunction().addParameterCallback( length,
+ valueHandler,
+ context );
}
this.caller.addParameter( valueHandler );
-
+
}
}
@@ -50,18 +54,18 @@
if ( this.caller == null || this.caller.getParameters() == null ) {
length = 0;
} else {
- length = ( this.caller == null ) ? 0 : this.caller.getParameters().length;
+ length = (this.caller == null) ? 0 : this.caller.getParameters().length;
}
-
+
LispList list = this.caller.createList( length );
-
+
list.setContext( this.context );
-
- return list;
+
+ return list;
}
public void setContext(ExecutionBuildContext context) {
this.context = context;
}
-
+
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispList.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispList.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/LispList.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,12 +1,12 @@
package org.drools.clp;
-public interface LispList {
+public interface LispList {
public void add(ValueHandler valueHandler);
-
+
public LispList createList();
-
+
public ValueHandler getValueHandler();
-
+
public void setContext(ExecutionBuildContext context);
-
+
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/ValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -3,32 +3,65 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-public interface ValueHandler {
- public boolean isResolved();
-
+public interface ValueHandler {
public int getValueType(ExecutionContext context);
-
+
public void setValue(ExecutionContext context,
Object object);
- public Object getValue(ExecutionContext context);
+ /**
+ *
+ */
+ public ValueHandler getValue(ExecutionContext context);
+
+ /**
+ * Resolves to a java Object
+ */
+ public Object getObject(ExecutionContext context);
+ /**
+ * Resolves to a String, if possible
+ */
public String getStringValue(ExecutionContext context);
+ /**
+ * Resolves to a boolean, if possible
+ */
public boolean getBooleanValue(ExecutionContext context) throws ClassCastException;
+ /**
+ * Resolves to a int, if possible
+ */
public int getIntValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a short, if possible
+ */
public short getShortValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a long, if possible
+ */
public long getLongValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a float, if possible
+ */
public float getFloatValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a double, if possible
+ */
public double getDoubleValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a BigInteger, if possible
+ */
public BigInteger getBigIntegerValue(ExecutionContext context) throws NumberFormatException;
+ /**
+ * Resolves to a BigDecimal, if possible
+ */
public BigDecimal getBigDecimalValue(ExecutionContext context) throws NumberFormatException;
-
+
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/VariableValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/VariableValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/VariableValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,6 +1,7 @@
package org.drools.clp;
-public interface VariableValueHandler extends ValueHandler {
- public String getIdentifier();
+public interface VariableValueHandler
+ extends
+ ValueHandler {
+ public String getIdentifier();
}
-
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/AddFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/AddFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/AddFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -4,28 +4,30 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
-import org.drools.clp.LispForm;
-import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
import org.drools.clp.valuehandlers.ObjectValueHandler;
-public class AddFunction extends BaseFunction implements Function {
+public class AddFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "+";
public AddFunction() {
-
+
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- BigDecimal bdval = new BigDecimal(0);
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+
+ BigDecimal bdval = new BigDecimal( 0 );
for ( int i = 0, length = args.length; i < length; i++ ) {
bdval = bdval.add( args[i].getBigDecimalValue( context ) );
- }
- return new ObjectValueHandler( new BigDecimal( bdval.intValue() ) );
- }
-
-
+ }
+
+ return new ObjectValueHandler( bdval );
+ }
+
public String getName() {
return name;
- }
+ }
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BaseFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BaseFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BaseFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,25 +1,30 @@
package org.drools.clp.functions;
import org.drools.clp.ExecutionBuildContext;
+import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
import org.drools.clp.LispForm;
import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
-public abstract class BaseFunction implements Function {
-
+public abstract class BaseFunction
+ implements
+ Function {
+
public void initCallback(ExecutionBuildContext context) {
-
+
}
-
- public ValueHandler addParameterCallback(int index, ValueHandler valueHandler, ExecutionBuildContext context ) {
+
+ public ValueHandler addParameterCallback(int index,
+ ValueHandler valueHandler,
+ ExecutionBuildContext context) {
return valueHandler;
}
-
+
public LispList createList(int index) {
return new LispForm();
}
-
+
public String toString() {
return "[Function '" + getName() + "']";
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BindFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BindFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/BindFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -3,44 +3,41 @@
import org.drools.clp.ExecutionBuildContext;
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
-import org.drools.clp.LispForm;
-import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
-import org.drools.clp.VariableValueHandler;
-import org.drools.clp.valuehandlers.FunctionCaller;
import org.drools.clp.valuehandlers.TempTokenVariable;
-public class BindFunction extends BaseFunction implements Function {
+public class BindFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "bind";
public BindFunction() {
-
+
}
- public ValueHandler addParameterCallback(int index, ValueHandler valueHandler, ExecutionBuildContext context ) {
+ public ValueHandler addParameterCallback(int index,
+ ValueHandler valueHandler,
+ ExecutionBuildContext context) {
// The first index in the 'bind' function is the variable
// register the variable, if it doesn't already exist, will be a TempTokenVariable if it does not already exist
- if ( index == 0 && ( valueHandler instanceof TempTokenVariable ) ) {
- TempTokenVariable temp = ( TempTokenVariable ) valueHandler;
- valueHandler= context.createLocalVariable( temp.getIdentifier() );
- }
-
+ if ( index == 0 && (valueHandler instanceof TempTokenVariable) ) {
+ TempTokenVariable temp = (TempTokenVariable) valueHandler;
+ valueHandler = context.createLocalVariable( temp.getIdentifier() );
+ }
+
return valueHandler;
}
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+ ValueHandler nested = args[1].getValue( context );
+ ValueHandler value = (nested != null ) ? nested : args[1];
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- args[0].setValue( context, args[1].getValue( context ));
-// Object object = args[1].getValue( context );
-// if ( object instanceof FunctionCaller || object instanceof VariableValueHandler) {
-// // this is if the paramter is a variable or a function, so we must resolve further
-// args[0].setValue( context, ( ( ValueHandler ) object).getValue( context ));
-// } else {
-// // thi sis if the parameter
-// args[0].setValue( context, object);
-// }
- return args[0];
+ args[0].setValue( context,
+ value );
+ return args[0];
}
-
+
public String getName() {
return name;
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/CreateListFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/CreateListFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/CreateListFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -3,40 +3,26 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
import org.drools.clp.ValueHandler;
-import org.drools.clp.valuehandlers.FunctionCaller;
import org.drools.clp.valuehandlers.ListValueHandler;
-public class CreateListFunction extends BaseFunction implements Function {
+public class CreateListFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "create$";
public CreateListFunction() {
-
+
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
ListValueHandler list = new ListValueHandler();
- addElements(list, args, context);
+ list.add( args,
+ context );
return list;
- }
-
- public void addElements(ListValueHandler list, ListValueHandler nested, ExecutionContext context) {
- addElements(list, nested.getList(), context);
}
-
- public void addElements(ListValueHandler list, ValueHandler[] args, ExecutionContext context) {
- for ( int i = 0, length = args.length; i < length; i++ ) {
- if ( args[i] instanceof ListValueHandler) {
- addElements(list, ( ListValueHandler ) args[i], context);
- } else if ( args[i] instanceof FunctionCaller && ((FunctionCaller)args[i]).getName().equals( "create$" ) ){
- addElements(list, (ListValueHandler)args[i].getValue( context ), context );
- } else {
- list.add( args[i] );
- }
- }
- }
-
-
+
public String getName() {
return name;
- }
+ }
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/IfFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/IfFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/IfFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -6,35 +6,36 @@
import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
import org.drools.clp.valuehandlers.BooleanValueHandler;
-import org.drools.clp.valuehandlers.ObjectValueHandler;
-public class IfFunction extends BaseFunction implements Function {
+public class IfFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "if";
public IfFunction() {
-
+
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
boolean result = args[0].getBooleanValue( context );
if ( result ) {
- return new ObjectValueHandler( args[2].getValue( context ) );
+ return args[2].getValue( context );
} else if ( args[3] != null && args[4] != null ) {
- return new ObjectValueHandler( args[4].getValue( context ) );
- } else {
+ return args[4].getValue( context );
+ } else {
return new BooleanValueHandler( result );
}
- }
-
-
+ }
+
public String getName() {
return name;
- }
-
+ }
+
public LispList createList(int index) {
return new LispForm();
}
-
+
public String toString() {
return "[Function '" + getName() + "']";
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/LessThanFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/LessThanFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/LessThanFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -2,24 +2,25 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
-import org.drools.clp.LispForm;
-import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
import org.drools.clp.valuehandlers.BooleanValueHandler;
-public class LessThanFunction extends BaseFunction implements Function {
+public class LessThanFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "<";
public LessThanFunction() {
-
- }
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- return new BooleanValueHandler( args[0].getBigDecimalValue( context ).compareTo( args[1].getBigDecimalValue( context ) ) < 0 );
}
-
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+ return new BooleanValueHandler( args[0].getBigDecimalValue( context ).compareTo( args[1].getBigDecimalValue( context ) ) < 0 );
+ }
+
public String getName() {
return name;
}
-
+
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/ModifyFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/ModifyFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/ModifyFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -5,30 +5,49 @@
import org.drools.clp.LispData;
import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
+import org.drools.clp.valuehandlers.ListValueHandler;
import org.mvel.PropertyAccessor;
-public class ModifyFunction extends BaseFunction implements Function {
- private static final String name = "modify";
-
+public class ModifyFunction extends BaseFunction
+ implements
+ Function {
+ private static final String name = "modify";
+
public ModifyFunction() {
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- Object object = args[0].getValue( context );
- for ( int i = 1, length = args.length; i < length; i++ ) {
- ValueHandler[] list = (ValueHandler[]) args[i].getValue( context );
-
- //FunctionCaller caller = ( FunctionCaller ) args[i];
- PropertyAccessor.set(object, list[0].getStringValue( context ), list[1].getValue( context ) );
- }
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+ Object object = args[0].getObject( context );
+ for ( int i = 1, length = args.length; i < length; i++ ) {
+ ValueHandler[] list = ((ListValueHandler) args[i]).getList();
+ PropertyAccessor.set( object,
+ list[0].getStringValue( context ),
+ list[1].getObject( context ) );
+ }
return null;
}
-
+
+ // public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
+ // Object object = resolveToObject( args[0], context ).getValue( context );
+ // for ( int i = 1, length = args.length; i < length; i++ ) {
+ // ValueHandler[] list = (ValueHandler[]) args[i].getValue( context );
+ //
+ // ValueHandler list1 = list[1];
+ //
+ // if ( !list1.isResolved() ) {
+ // list1 = ( ValueHandler) list1.getValue( context );
+ // }
+ //
+ // PropertyAccessor.set(object, resolveToObject( list[0], context ).getStringValue( context ), resolveToObject( list[1], context ).getValue( context ) );
+ // }
+ // return null;
+ // }
+
public LispList createList(int index) {
return new LispData();
}
-
+
public String getName() {
return name;
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/MultiplyFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/MultiplyFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/MultiplyFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -4,29 +4,29 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
-import org.drools.clp.LispForm;
-import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
import org.drools.clp.valuehandlers.ObjectValueHandler;
-public class MultiplyFunction extends BaseFunction implements Function {
+public class MultiplyFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "*";
public MultiplyFunction() {
-
+
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- BigDecimal bdval = new BigDecimal(0);
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+ BigDecimal bdval = new BigDecimal( 0 );
for ( int i = 0, length = args.length; i < length; i++ ) {
bdval = bdval.multiply( args[i].getBigDecimalValue( context ) );
- }
- return new ObjectValueHandler( bdval );
+ }
+ return new ObjectValueHandler( bdval );
}
-
-
+
public String getName() {
return name;
- }
+ }
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/WhileFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/WhileFunction.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/functions/WhileFunction.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -2,33 +2,32 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.Function;
-import org.drools.clp.LispForm;
-import org.drools.clp.LispList;
import org.drools.clp.ValueHandler;
-import org.drools.clp.valuehandlers.ObjectValueHandler;
-public class WhileFunction extends BaseFunction implements Function {
+public class WhileFunction extends BaseFunction
+ implements
+ Function {
private static final String name = "while";
public WhileFunction() {
-
+
}
-
- public ValueHandler execute(ValueHandler[] args, ExecutionContext context) {
- Object result = null;
-
- ValueHandler doHandler = args[ args.length - 1 ];
-
- while( args[0].getBooleanValue( context ) ) {
+
+ public ValueHandler execute(ValueHandler[] args,
+ ExecutionContext context) {
+ ValueHandler result = null;
+
+ ValueHandler doHandler = args[args.length - 1];
+
+ while ( args[0].getBooleanValue( context ) ) {
result = doHandler.getValue( context );
}
- return new ObjectValueHandler( result );
- }
-
-
+ return result;
+ }
+
public String getName() {
return name;
- }
+ }
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BaseValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BaseValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BaseValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -9,7 +9,7 @@
public abstract class BaseValueHandler implements ValueHandler {
public BigDecimal getBigDecimalValue(ExecutionContext context) throws NumberFormatException {
- Object object = getValue( context );
+ Object object = getObject( context );
if ( object instanceof BigDecimal ) {
return (BigDecimal) object;
} else {
@@ -18,7 +18,7 @@
}
public BigInteger getBigIntegerValue(ExecutionContext context) throws NumberFormatException {
- Object object = getValue( context );
+ Object object = getObject( context );
if ( object instanceof BigInteger ) {
return (BigInteger) object;
} else {
@@ -27,38 +27,38 @@
}
public boolean getBooleanValue(ExecutionContext context) throws ClassCastException {
- return ((Boolean) getValue(context)).booleanValue();
+ return ((Boolean) getObject(context)).booleanValue();
}
public double getDoubleValue(ExecutionContext context) throws NumberFormatException {
- return ((Double) getValue(context)).doubleValue();
+ return ((Double) getObject(context)).doubleValue();
}
public float getFloatValue(ExecutionContext context) throws NumberFormatException {
- return ((Float) getValue(context)).floatValue();
+ return ((Float) getObject(context)).floatValue();
}
public int getIntValue(ExecutionContext context) throws NumberFormatException {
- return ((Integer) getValue(context)).intValue();
+ return ((Integer) getObject(context)).intValue();
}
public long getLongValue(ExecutionContext context) throws NumberFormatException {
- return ((Long) getValue(context)).longValue();
+ return ((Long) getObject(context)).longValue();
}
public short getShortValue(ExecutionContext context) throws NumberFormatException {
- return ((Short) getValue(context)).shortValue();
+ return ((Short) getObject(context)).shortValue();
}
public String getStringValue(ExecutionContext context) {
- return (String) getValue(context);
+ return (String) getObject(context);
}
public String toString() {
String name = getClass().getName();
name = name.substring( name.lastIndexOf( "." ) + 1 );
try {
- return "[" + name + " value = '" + getValue(null) + "']";
+ return "[" + name + " value = '" + getObject(null) + "']";
} catch (Exception e) {
return "[" + name + " value = N/A]";
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BooleanValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BooleanValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/BooleanValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -8,7 +8,7 @@
import org.drools.clp.ValueHandler;
public class BooleanValueHandler implements ValueHandler {
- private boolean booleanValue;
+ private boolean booleanValue;
public BooleanValueHandler(String booleanValue) {
this.booleanValue = Boolean.valueOf( booleanValue ).booleanValue();
@@ -16,7 +16,11 @@
public BooleanValueHandler(boolean booleanValue) {
this.booleanValue = booleanValue;
- }
+ }
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
public int getValueType(ExecutionContext context) {
return SimpleValueType.BOOLEAN;
@@ -26,7 +30,7 @@
throw new RuntimeException( "LiteralValues cannot be set");
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return new Boolean( this.booleanValue );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPGlobalVariable.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPGlobalVariable.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPGlobalVariable.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,7 +1,8 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import org.drools.clp.CLPFactory;
import org.drools.clp.ExecutionContext;
+import org.drools.clp.ValueHandler;
import org.drools.clp.VariableValueHandler;
@@ -19,8 +20,12 @@
this.identifier = identifier;
this.factory = factory;
this.knownType = knownType;
- }
+ }
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
+
public String getIdentifier() {
return this.identifier;
}
@@ -33,7 +38,7 @@
return this.knownType;
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return this.factory.getValue( this.identifier );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPLocalDeclarationVariable.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPLocalDeclarationVariable.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPLocalDeclarationVariable.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,9 +1,10 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.drools.clp.ExecutionContext;
+import org.drools.clp.ValueHandler;
import org.drools.clp.VariableValueHandler;
import org.drools.rule.Declaration;
@@ -13,7 +14,12 @@
public CLPLocalDeclarationVariable(Declaration declaration) {
this.declaration = declaration;
- }
+ }
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
+
public String getIdentifier() {
return this.declaration.getIdentifier();
}
@@ -31,7 +37,7 @@
throw new UnsupportedOperationException( "External Variable identifer='" + getIdentifier() + "' type='" + getKnownType() + "' is final, it cannot be set" );
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return declaration.getValue( context.getObject() );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPPreviousDeclarationVariable.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPPreviousDeclarationVariable.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/CLPPreviousDeclarationVariable.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,9 +1,10 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.drools.clp.ExecutionContext;
+import org.drools.clp.ValueHandler;
import org.drools.clp.VariableValueHandler;
import org.drools.common.InternalFactHandle;
import org.drools.rule.Declaration;
@@ -15,6 +16,10 @@
public CLPPreviousDeclarationVariable(Declaration declaration) {
this.declaration = declaration;
}
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
public String getIdentifier() {
return this.declaration.getIdentifier();
@@ -33,7 +38,7 @@
throw new UnsupportedOperationException( "External Variable identifer='" + getIdentifier() + "' type='" + getKnownType() + "' is final, it cannot be set" );
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
InternalFactHandle handle = context.getTuple().get( this.declaration );
return declaration.getValue( handle.getObject() );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/DoubleValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/DoubleValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/DoubleValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -16,8 +16,12 @@
public DoubleValueHandler(double doubleValue) {
this.doubleValue = doubleValue;
- }
+ }
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
+
public int getValueType(ExecutionContext context) {
return SimpleValueType.DECIMAL;
}
@@ -26,7 +30,7 @@
throw new RuntimeException( "LiteralValues cannot be set");
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return new Double( this.doubleValue );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/FunctionCaller.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/FunctionCaller.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/FunctionCaller.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -25,6 +25,11 @@
this.function = function;
}
+ public ValueHandler getValue(ExecutionContext context) {
+ return this.function.execute( this.parameters,
+ context );
+ }
+
public int getValueType(ExecutionContext context) {
return SimpleValueType.FUNCTION;
}
@@ -64,21 +69,9 @@
return this.parameters;
}
- private ValueHandler resolveFunction(FunctionCaller caller,
- ExecutionContext context) {
- ValueHandler result = caller.getFunction().execute( caller.getParameters(),
- context );
- if ( result instanceof FunctionCaller ) {
- result = resolveFunction( (FunctionCaller) result,
- context );
- }
- return result;
+ public Object getObject(ExecutionContext context) {
+ return getValue( context ).getObject( context );
}
-
- public Object getValue(ExecutionContext context) {
- return resolveFunction( this,
- context ).getValue( context );
- }
public void setValue(ExecutionContext context,
Object object) {
@@ -99,39 +92,39 @@
}
public BigDecimal getBigDecimalValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getBigDecimalValue( context );
+ return getValue( context ).getBigDecimalValue( context );
}
public BigInteger getBigIntegerValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getBigIntegerValue( context );
+ return getValue( context ).getBigIntegerValue( context );
}
public boolean getBooleanValue(ExecutionContext context) throws ClassCastException {
- return resolveFunction( this, context ).getBooleanValue( context );
+ return getValue( context ).getBooleanValue( context );
}
public double getDoubleValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getDoubleValue( context );
+ return getValue( context ).getDoubleValue( context );
}
public float getFloatValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getFloatValue( context );
+ return getValue( context ).getFloatValue( context );
}
public int getIntValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getIntValue( context );
+ return getValue( context ).getIntValue( context );
}
public long getLongValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getLongValue( context );
+ return getValue( context ).getLongValue( context );
}
public short getShortValue(ExecutionContext context) throws NumberFormatException {
- return resolveFunction( this, context ).getShortValue( context );
+ return getValue( context ).getShortValue( context );
}
public String getStringValue(ExecutionContext context) {
- return resolveFunction( this, context ).getStringValue( context );
+ return getValue( context ).getStringValue( context );
}
public String toString() {
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ListValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ListValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ListValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -8,28 +8,64 @@
import org.drools.clp.ExecutionContext;
import org.drools.clp.ValueHandler;
-public class ListValueHandler implements ValueHandler {
+public class ListValueHandler
+ implements
+ ValueHandler {
private ValueHandler[] list;
-
+
public ListValueHandler() {
-
+
}
-
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
+
public int getValueType(ExecutionContext context) {
return SimpleValueType.LIST;
- }
-
+ }
+
+ public void add(ListValueHandler list,
+ ExecutionContext context) {
+ add( list.getList(),
+ context );
+ }
+
+ public void add(ValueHandler[] valueHandlers,
+ ExecutionContext context) {
+ for ( int i = 0, length = valueHandlers.length; i < length; i++ ) {
+ add( valueHandlers[i],
+ context );
+ }
+ }
+
+ public void add(ValueHandler valueHandler,
+ ExecutionContext context) {
+ ValueHandler nested = valueHandler.getValue( context );
+ valueHandler = (nested != null ) ? nested : valueHandler;
+ if ( valueHandler instanceof ListValueHandler ) {
+ add( (ListValueHandler) valueHandler,
+ context );
+ } else {
+ add( valueHandler );
+ }
+ }
+
public void add(ValueHandler valueHandler) {
- if (this.list == null) {
- this.list = new ValueHandler[] { valueHandler};
+ if ( this.list == null ) {
+ this.list = new ValueHandler[]{valueHandler};
} else {
- ValueHandler[] temp = new ValueHandler[ this.list.length + 1 ];
- System.arraycopy( this.list, 0, temp, 0, this.list.length );
- temp[ temp.length - 1] = valueHandler;
- this.list = temp;
- }
+ ValueHandler[] temp = new ValueHandler[this.list.length + 1];
+ System.arraycopy( this.list,
+ 0,
+ temp,
+ 0,
+ this.list.length );
+ temp[temp.length - 1] = valueHandler;
+ this.list = temp;
+ }
}
-
+
public ValueHandler[] getList() {
return this.list;
}
@@ -70,44 +106,49 @@
throw new RuntimeException( "ListValueHandler cannot return String" );
}
- public Object getValue(ExecutionContext context) {
- return this.list;
+ public Object getObject(ExecutionContext context) {
+ Object[] objects = new Object[this.list.length];
+ for ( int i = 0, length = this.list.length; i < length; i++ ) {
+ objects[i] = this.list[i].getObject( context );
+ }
+
+ return objects;
}
public void setValue(ExecutionContext context,
Object object) {
- throw new RuntimeException( "cannot set value on ListValueHandler" );
+ throw new RuntimeException( "cannot set value on ListValueHandler" );
}
-
+
public void replaceTempTokens(Map variables) {
for ( int i = 0, length = this.list.length; i < length; i++ ) {
if ( this.list[i] instanceof TempTokenVariable ) {
- TempTokenVariable var = ( TempTokenVariable ) this.list[i];
- this.list[i] = ( ValueHandler ) variables.get( var.getIdentifier() );
+ TempTokenVariable var = (TempTokenVariable) this.list[i];
+ this.list[i] = (ValueHandler) variables.get( var.getIdentifier() );
} else if ( this.list[i] instanceof FunctionCaller ) {
- ((FunctionCaller)list[i]).replaceTempTokens( variables );
+ ((FunctionCaller) list[i]).replaceTempTokens( variables );
} else if ( this.list[i] instanceof ListValueHandler ) {
- ((ListValueHandler)list[i]).replaceTempTokens( variables );
+ ((ListValueHandler) list[i]).replaceTempTokens( variables );
}
- }
- }
-
+ }
+ }
+
public int size() {
return (this.list == null) ? 0 : this.list.length;
}
-
+
public boolean isEmpty() {
- return (this.list == null) ? true : this.list.length > 0;
+ return (this.list == null) ? true : this.list.length > 0;
}
-
+
public String toString() {
StringBuffer b = new StringBuffer();
b.append( "[ListValueHandler " );
for ( int i = 0, length = this.list.length; i < length; i++ ) {
b.append( this.list[i] + " " );
}
- b.append("]");
-
+ b.append( "]" );
+
return b.toString();
}
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LocalVariableValue.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LocalVariableValue.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LocalVariableValue.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import org.drools.clp.ExecutionContext;
import org.drools.clp.ValueHandler;
@@ -22,7 +22,7 @@
this.identifier = identifier;
this.index = index;
}
-
+
/**
* Retrieve the variable's identifier.
*
@@ -36,15 +36,17 @@
return context.getLocalVariable( this.index ).getValueType( context );
}
- public Object getValue(ExecutionContext context) {
- Object object = context.getLocalVariable( this.index ).getValue( context );
- //if ( object instanceof )
- return object;
+ public Object getObject(ExecutionContext context) {
+ return getValue(context).getObject( context );
}
- public ValueHandler getRawValue(ExecutionContext context) {
- // this is a hack as some parts of the system need the ValueHandler and not the Value
- return context.getLocalVariable( this.index );
+ public ValueHandler getValue(ExecutionContext context) {
+ ValueHandler valueHandler = context.getLocalVariable( this.index );
+ ValueHandler nested;
+ while ( (nested = valueHandler.getValue( context ) ) != null ) {
+ valueHandler = nested;
+ }
+ return valueHandler;
}
public void setValue(ExecutionContext context,
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LongValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LongValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/LongValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,4 +1,4 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -20,13 +20,17 @@
public LongValueHandler(long longValue) {
this.longValue = longValue;
- }
+ }
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
public void setValue(ExecutionContext context, Object value) {
throw new RuntimeException( "LiteralValues cannot be set");
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return new Long( this.longValue );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ObjectValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ObjectValueHandler.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/ObjectValueHandler.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,63 +1,32 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import org.drools.base.SimpleValueType;
import org.drools.clp.ExecutionContext;
+import org.drools.clp.ValueHandler;
public class ObjectValueHandler extends BaseValueHandler {
public static final ObjectValueHandler NULL = new ObjectValueHandler( "null" );
- private Object objectValue;
+ private Object objectValue;
+ public ObjectValueHandler(Object objectValue) {
+ this.objectValue = objectValue;
+ }
+
public int getValueType(ExecutionContext context) {
return SimpleValueType.OBJECT;
}
- public ObjectValueHandler(Object objectValue) {
- this.objectValue = objectValue;
- }
-
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
+
public void setValue(ExecutionContext context, Object value) {
throw new RuntimeException( "LiteralValues cannot be set");
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
return this.objectValue;
}
- /*
- public BigDecimal getBigDecimalValue(ExecutionContext context) throws NumberFormatException {
- return (BigDecimal) getValue(context);
- }
- public BigInteger getBigIntegerValue(ExecutionContext context) throws NumberFormatException {
- return (BigInteger) getValue(context);
- }
-
- public boolean getBooleanValue(ExecutionContext context) throws ClassCastException {
- return ((Boolean) getValue(context)).booleanValue();
- }
-
- public double getDoubleValue(ExecutionContext context) throws NumberFormatException {
- return ((Double) getValue(context)).doubleValue();
- }
-
- public float getFloatValue(ExecutionContext context) throws NumberFormatException {
- return ((Float) getValue(context)).floatValue();
- }
-
- public int getIntValue(ExecutionContext context) throws NumberFormatException {
- return ((Integer) getValue(context)).intValue();
- }
-
- public long getLongValue(ExecutionContext context) throws NumberFormatException {
- return ((Long) getValue(context)).longValue();
- }
-
- public short getShortValue(ExecutionContext context) throws NumberFormatException {
- return ((Short) getValue(context)).shortValue();
- }
-
- public String getStringValue(ExecutionContext context) {
- return (String) getValue(context);
- } */
-
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/TempTokenVariable.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/TempTokenVariable.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/clp/valuehandlers/TempTokenVariable.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -1,7 +1,8 @@
-package org.drools.clp.ValueHandlers;
+package org.drools.clp.valuehandlers;
import org.drools.base.SimpleValueType;
import org.drools.clp.ExecutionContext;
+import org.drools.clp.ValueHandler;
import org.drools.clp.VariableValueHandler;
@@ -12,6 +13,10 @@
public TempTokenVariable(String identifier) {
this.identifier = identifier;
}
+
+ public ValueHandler getValue(ExecutionContext context) {
+ return null;
+ }
public String getIdentifier() {
return this.identifier;
@@ -21,7 +26,7 @@
return SimpleValueType.UNKNOWN;
}
- public Object getValue(ExecutionContext context) {
+ public Object getObject(ExecutionContext context) {
throw new UnsupportedOperationException( "TempTokenVariable Variable identifer='" + getIdentifier() + " cannot be read" );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/clp/CLP.g
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/clp/CLP.g 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/clp/CLP.g 2007-03-25 02:44:34 UTC (rev 10524)
@@ -2,6 +2,8 @@
@parser::header {
package org.drools.clp;
+
+ import org.drools.clp.valuehandlers.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
@@ -527,12 +529,12 @@
}
:
( t=VAR { value = context.getVariableValueHandler(t.getText() ); }
- | t=STRING { value = new ObjectLiteralValue( getString( t ) ); }
- | t=NAME { value = new ObjectLiteralValue( t.getText() ); }
- | t=FLOAT { value = new DoubleLiteralValue( t.getText() ); }
- | t=INT { value = new LongLiteralValue( t.getText() ); }
- | t=BOOL { value = new BooleanLiteralValue( t.getText() ); }
- | t=NULL { value = ObjectLiteralValue.NULL; }
+ | t=STRING { value = new ObjectValueHandler( getString( t ) ); }
+ | t=NAME { value = new ObjectValueHandler( t.getText() ); }
+ | t=FLOAT { value = new DoubleValueHandler( t.getText() ); }
+ | t=INT { value = new LongValueHandler( t.getText() ); }
+ | t=BOOL { value = new BooleanValueHandler( t.getText() ); }
+ | t=NULL { value = ObjectValueHandler.NULL; }
)
;
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/AddFunctionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/AddFunctionTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/AddFunctionTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -8,6 +8,12 @@
import org.drools.RuleBaseFactory;
import org.drools.base.ClassObjectType;
import org.drools.clp.functions.AddFunction;
+import org.drools.clp.valuehandlers.CLPLocalDeclarationVariable;
+import org.drools.clp.valuehandlers.CLPPreviousDeclarationVariable;
+import org.drools.clp.valuehandlers.FunctionCaller;
+import org.drools.clp.valuehandlers.LocalVariableValue;
+import org.drools.clp.valuehandlers.ObjectValueHandler;
+import org.drools.clp.valuehandlers.TempTokenVariable;
import org.drools.common.InternalFactHandle;
import org.drools.common.InternalWorkingMemory;
import org.drools.reteoo.ReteTuple;
@@ -28,7 +34,7 @@
assertEquals( new BigDecimal( 20 ),
add.execute( params,
- null ).getValue( null ) );
+ null ).getObject( null ) );
}
public void testNestedAdd() {
@@ -46,7 +52,7 @@
assertEquals( new BigDecimal( 30 ),
add.execute( params,
- null ).getValue( null ) );
+ null ).getObject( null ) );
}
public void testNestedAddWithVars() {
@@ -63,14 +69,14 @@
objectType );
ColumnExtractor extractor = new ColumnExtractor( objectType );
- VariableValueHandler pd = new CLPPreviousDeclarationVariable( new Declaration( "pd",
- extractor,
- column0 ) );
+// VariableValueHandler pd = new CLPPreviousDeclarationVariable( new Declaration( "pd",
+// extractor,
+// column0 ) );
+//
+// VariableValueHandler ld = new CLPLocalDeclarationVariable( new Declaration( "ld",
+// extractor,
+// column1 ) );
- VariableValueHandler ld = new CLPLocalDeclarationVariable( new Declaration( "ld",
- extractor,
- column1 ) );
-
Map variables = new HashMap();
variables.put( "pd",
new CLPPreviousDeclarationVariable( new Declaration( "pd",
@@ -106,7 +112,7 @@
f.replaceTempTokens( variables );
assertEquals( new BigDecimal( 30 ),
- f.getValue( context ) );
+ f.getBigDecimalValue( context ) );
}
}
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/BlockExecutionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/BlockExecutionTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/BlockExecutionTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -8,6 +8,10 @@
import org.drools.clp.functions.AddFunction;
import org.drools.clp.functions.BindFunction;
import org.drools.clp.functions.ModifyFunction;
+import org.drools.clp.valuehandlers.FunctionCaller;
+import org.drools.clp.valuehandlers.ListValueHandler;
+import org.drools.clp.valuehandlers.LongValueHandler;
+import org.drools.clp.valuehandlers.ObjectValueHandler;
public class BlockExecutionTest extends TestCase {
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ClpParserTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ClpParserTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ClpParserTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -11,6 +11,9 @@
import org.antlr.runtime.CharStream;
import org.antlr.runtime.Lexer;
import org.antlr.runtime.TokenStream;
+import org.drools.clp.valuehandlers.DoubleValueHandler;
+import org.drools.clp.valuehandlers.FunctionCaller;
+import org.drools.clp.valuehandlers.LongValueHandler;
import org.drools.compiler.SwitchingCommonTokenStream;
import org.drools.lang.descr.AndDescr;
import org.drools.lang.descr.AttributeDescr;
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/CompiledParserTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/CompiledParserTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/CompiledParserTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -12,6 +12,10 @@
import org.antlr.runtime.Lexer;
import org.antlr.runtime.TokenStream;
import org.drools.Person;
+import org.drools.clp.valuehandlers.ListValueHandler;
+import org.drools.clp.valuehandlers.LocalVariableValue;
+import org.drools.clp.valuehandlers.LongValueHandler;
+import org.drools.clp.valuehandlers.ObjectValueHandler;
import org.drools.compiler.SwitchingCommonTokenStream;
import junit.framework.TestCase;
@@ -38,7 +42,7 @@
ExecutionContext context = new ExecutionContext(null, null, 1);
engine.execute( context );
- ListValueHandler list = ( ListValueHandler ) context.getLocalVariable( 0 ).getValue( context );
+ ListValueHandler list = ( ListValueHandler ) context.getLocalVariable( 0 );
assertEquals( 3, list.size() );
@@ -48,24 +52,32 @@
}
public void testNestedCreate$() throws Exception {
- BlockExecutionEngine engine = ( BlockExecutionEngine ) parse("(bind ?x (create$ 1 2 3) ) (bind ?y (create$ 1 ?x (create$ a b ?x c) 3) )").rhs();
+ BlockExecutionEngine engine = ( BlockExecutionEngine ) parse("(bind ?x (create$ 1 2 (+ 1 2) ) ) (bind ?y (create$ (+ 1 0) ?x (create$ a b ?x (+ 1 1) ) 3) )").rhs();
ExecutionContext context = new ExecutionContext(null, null, 2);
engine.execute( context );
// check ?x
- ListValueHandler list = ( ListValueHandler ) context.getLocalVariable( 0 ).getValue( context );;
+ ListValueHandler list = ( ListValueHandler ) context.getLocalVariable( 0 );
assertEquals( 3, list.size() );
assertEquals( 1, list.getList()[0].getIntValue( context ) );
assertEquals( 2, list.getList()[1].getIntValue( context ) );
- assertEquals( 3, list.getList()[2].getIntValue( context ) );
+ assertEquals( new BigDecimal( 3 ), list.getList()[2].getBigDecimalValue( context ) );
// check ?y
- list = ( ListValueHandler ) context.getLocalVariable( 1 ).getValue( context );;
+ list = ( ListValueHandler ) context.getLocalVariable( 1 );
assertEquals( 11, list.size() );
-// assertEquals( 1, list.getList()[0].getIntValue( context ) );
-// assertEquals( 2, list.getList()[1].getIntValue( context ) );
-// assertEquals( 3, list.getList()[2].getIntValue( context ) );
+ assertEquals( new BigDecimal( 1 ), list.getList()[0].getBigDecimalValue( context ) );
+ assertEquals( 1, list.getList()[1].getIntValue( context ) );
+ assertEquals( 2, list.getList()[2].getIntValue( context ) );
+ assertEquals( new BigDecimal( 3 ), list.getList()[3].getBigDecimalValue( context ) );
+ assertEquals( "a", list.getList()[4].getStringValue( context ) );
+ assertEquals( "b", list.getList()[5].getStringValue( context ) );
+ assertEquals( 1, list.getList()[6].getIntValue( context ) );
+ assertEquals( 2, list.getList()[7].getIntValue( context ) );
+ assertEquals( new BigDecimal( 3 ), list.getList()[8].getBigDecimalValue( context ) );
+ assertEquals( new BigDecimal( 2 ), list.getList()[9].getBigDecimalValue( context ) );
+ assertEquals( 3, list.getList()[10].getIntValue( context ) );
}
public void testIf() throws Exception {
@@ -104,7 +116,7 @@
context.setLocalVariable( 1, new LongValueHandler( 10 ) );
engine.execute( context );
- assertEquals( new BigDecimal(10), context.getLocalVariable( 0 ).getValue( context ) );
+ assertEquals( new BigDecimal(10), context.getLocalVariable( 0 ).getObject( context ) );
}
private CLPParser parse(final String text) throws Exception {
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/DeffunctionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/DeffunctionTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/DeffunctionTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -3,6 +3,9 @@
import java.math.BigDecimal;
import org.drools.clp.functions.AddFunction;
+import org.drools.clp.valuehandlers.FunctionCaller;
+import org.drools.clp.valuehandlers.LocalVariableValue;
+import org.drools.clp.valuehandlers.LongValueHandler;
import junit.framework.TestCase;
@@ -30,7 +33,7 @@
ValueHandler w = new LocalVariableValue("w", 1);
w.setValue( context, new LongValueHandler( 7 ) );
- assertEquals( new BigDecimal( 17 ), function.execute( new ValueHandler[] { q, w }, context ).getValue( context ) );
+ assertEquals( new BigDecimal( 17 ), function.execute( new ValueHandler[] { q, w }, context ).getBigDecimalValue( context ) );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ModifyFunctionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ModifyFunctionTest.java 2007-03-24 22:28:07 UTC (rev 10523)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/clp/ModifyFunctionTest.java 2007-03-25 02:44:34 UTC (rev 10524)
@@ -2,6 +2,9 @@
import org.drools.Person;
import org.drools.clp.functions.ModifyFunction;
+import org.drools.clp.valuehandlers.ListValueHandler;
+import org.drools.clp.valuehandlers.LocalVariableValue;
+import org.drools.clp.valuehandlers.ObjectValueHandler;
import junit.framework.TestCase;
More information about the jboss-svn-commits
mailing list