[jboss-svn-commits] JBL Code SVN: r18181 - in labs/jbossrules/trunk/drools-clips/src: main/resources/org/drools/clp and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jan 29 02:47:57 EST 2008
Author: mark.proctor at jboss.com
Date: 2008-01-29 02:47:57 -0500 (Tue, 29 Jan 2008)
New Revision: 18181
Added:
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionContext.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELBuildContext.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintRouterContext.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableContext.java
Removed:
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BlockExecutionEngine.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuildContext.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuiltinFunctions.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPEval.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPFactory.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPLexer.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPParser.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPPredicate.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPReturnValue.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Deffunction.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionBuildContext.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContext.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContextImpl.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionEngine.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExpressionExecutionEngine.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Function.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionDelegator.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionRegistry.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispData.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispForm2.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispList.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ValueHandler.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/VariableValueHandler.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/DeffunctionFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELClipsContext.java
Modified:
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELLexer.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELParser.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ParserHandler.java
labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Shell.java
labs/jbossrules/trunk/drools-clips/src/main/resources/org/drools/clp/CLPMVEL.g
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/BlockExecutionTest.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/CompiledFunctionsTest.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/FunctionFactoryTest.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/LhsClpParserTest.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/BaseInfixFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/CreateListFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/Function.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionHandlers.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/IfFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/LispForm.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ModifyFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintoutFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrognFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ReturnFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/SwitchFunction.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/TestMVEL.java
labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableLispAtom.java
Log:
JBRULES-720 Clips Parser
-First working Lisp Shell, with MVEL underneath.
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BlockExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BlockExecutionEngine.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BlockExecutionEngine.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,87 +0,0 @@
-package org.drools.clp;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-import org.drools.spi.Consequence;
-import org.drools.spi.KnowledgeHelper;
-
-public class BlockExecutionEngine
- implements
- Consequence,
- ExecutionEngine {
- private FunctionCaller[] functions;
-
- private int index;
-
- public void addFunction(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;
- }
- }
-
- public FunctionCaller[] getFunctions() {
- return this.functions;
- }
-
- public void execute(InternalWorkingMemory workingMemory,
- ReteTuple tuple,
- Object object) {
- execute( new ExecutionContextImpl( workingMemory,
- tuple,
- object,
- this.index - 1 ) );
- }
-
- public void execute(InternalWorkingMemory workingMemory,
- ReteTuple tuple) {
- execute( new ExecutionContextImpl( workingMemory,
- tuple,
- this.index - 1 ) );
- }
-
- public void evaluate(KnowledgeHelper knowledgeHelper,
- WorkingMemory workingMemory) throws Exception {
- ExecutionContext context = new ExecutionContextImpl( (InternalWorkingMemory) workingMemory,
- (ReteTuple) knowledgeHelper.getTuple(),
- this.index );
- execute( context );
- }
-
- public void execute(ExecutionContext context) {
- if ( this.functions == null ) {
- return;
- }
-
- for ( int i = 0, length = functions.length; i < length; i++ ) {
- this.functions[i].getValue( context );
- }
- }
-
- public void replaceTempTokens(Map variables) {
- for ( int i = 0, length = functions.length; i < length; i++ ) {
- this.functions[i].replaceTempTokens( variables );
- }
- }
-
- public VariableValueHandler createLocalVariable(String identifier) {
- return new IndexedLocalVariableValue( identifier,
- this.index++ );
- }
-
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuildContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuildContext.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuildContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,22 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-
-public interface BuildContext {
-
- public FunctionRegistry getFunctionRegistry();
-
- public void addFunction(FunctionCaller function);
-
- public Object setProperty(Object key,
- Object value);
-
- public Object getProperty(Object key);
-
- public ValueHandler createLocalVariable(String identifier);
-
- public void addVariable(VariableValueHandler var);
-
- public ValueHandler getVariableValueHandler(String identifier);
-
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuiltinFunctions.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuiltinFunctions.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/BuiltinFunctions.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,49 +0,0 @@
-package org.drools.clp;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-
-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();
- loadFunctions();
- }
-
- public void loadFunctions() {
- BufferedReader reader = new BufferedReader( new InputStreamReader( getClass().getResourceAsStream( "functions.conf" ) ) );
- loadFunctions( reader );
- }
-
- public void loadFunctions(BufferedReader reader) {
- String line = null;
-
- try {
- while ( (line = reader.readLine()) != null ) {
- if ( line.startsWith( "#" ) || line.equals( "" )) {
- continue;
- }
- Class clazz = getClass().getClassLoader().loadClass( line );
- Function function = (Function) clazz.newInstance();
- this.functions.put( function.getName(),
- function );
- }
- } catch ( Exception e ) {
- throw new RuntimeException( "unable to find function '" + line +"'" );
- }
- }
-
- public Function getFunction(String name) {
- return (Function) this.functions.get( name );
- }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPEval.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPEval.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPEval.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,62 +0,0 @@
-/**
- *
- */
-package org.drools.clp;
-
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-import org.drools.rule.Declaration;
-import org.drools.spi.EvalExpression;
-import org.drools.spi.Tuple;
-
-public class CLPEval
- implements
- EvalExpression,
- ExecutionEngine {
- private FunctionCaller function;
- private int index;
-
- public CLPEval() {
-
- }
-
- public CLPEval(FunctionCaller function) {
- this.function = function;
- }
-
- public void setFunction(FunctionCaller function) {
- this.function = function;
- }
-
- public void addFunction(FunctionCaller function) {
- setFunction( function );
- }
-
- public FunctionCaller[] getFunctions() {
- return new FunctionCaller[]{this.function};
- }
-
- public VariableValueHandler createLocalVariable(String identifier) {
- return new IndexedLocalVariableValue( identifier,
- this.index++ );
- }
-
- public boolean evaluate(Tuple tuple,
- Declaration[] requiredDeclarations,
- WorkingMemory workingMemory) throws Exception {
- ExecutionContext context = new ExecutionContextImpl( (InternalWorkingMemory) workingMemory,
- (ReteTuple) tuple,
- this.index - 1 );
- return this.function.getBooleanValue( context );
- }
-
- public void replaceTempTokens(Map variables) {
- this.function.replaceTempTokens( variables );
- }
-
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPFactory.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPFactory.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPFactory.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,139 +0,0 @@
-package org.drools.clp;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.base.ValueType;
-import org.drools.clp.valuehandlers.CLPGlobalVariable;
-import org.drools.clp.valuehandlers.CLPLocalDeclarationVariable;
-import org.drools.clp.valuehandlers.CLPPreviousDeclarationVariable;
-import org.drools.common.InternalWorkingMemory;
-import org.drools.rule.Declaration;
-import org.drools.spi.Tuple;
-import org.mvel.integration.VariableResolver;
-
-public class CLPFactory {
- private Tuple tuple;
- private Object object;
- private Map localDeclarations;
- private Map previousDeclarations;
- private Map globals;
-
- private Map resolvers;
- //private
- private InternalWorkingMemory workingMemory;
-
- public CLPFactory() {
- this.resolvers = Collections.EMPTY_MAP;
- }
-
- public CLPFactory(Map previousDeclarations,
- Map localDeclarations,
- Map globals) {
-
- }
-
- public void setPreviousDeclarationMap(Map declarations) {
- this.previousDeclarations = declarations;
- }
-
- public void setLocalDeclarationMap(Map declarations) {
- this.localDeclarations = declarations;
- }
-
- public void setGlobalsMap(Map globals) {
- this.globals = globals;
- }
-
- public Object getObject() {
- return this.object;
- }
-
- public void setContext(Tuple tuple,
- Object object,
- InternalWorkingMemory workingMemory) {
- this.tuple = tuple;
- this.object = object;
- this.workingMemory = workingMemory;
- }
-
- public Object getValue(Declaration declaration) {
- return tuple.get( declaration ).getObject();
- }
-
- public Object getValue(String identifier) {
- return this.workingMemory.getGlobal( identifier );
- }
-
- public VariableResolver createVariable(String name,
- Object value) {
- throw new UnsupportedOperationException( "Variables cannot be created here" );
- }
-
- // public ValueHandler getVariableResolver(String name) {
- // return (ValueHandler) this.resolvers.get( name );
- // }
-
- public ValueHandler getVariableResolver(String name) {
- //return this.declarations.containsKey( name ) || this.globals.containsKey( name );
- if ( this.resolvers == Collections.EMPTY_MAP ) {
- this.resolvers = new HashMap();
- }
-
- ValueHandler resolver = (ValueHandler) this.resolvers.get( name );
-
- if ( resolver != null ) {
- return null;
- }
-
- if ( this.previousDeclarations != null && this.previousDeclarations.containsKey( name ) ) {
- resolver = new CLPPreviousDeclarationVariable( (Declaration) this.previousDeclarations.get( name ), workingMemory);
- } else if ( this.localDeclarations != null && this.localDeclarations.containsKey( name ) ) {
- resolver = new CLPLocalDeclarationVariable( (Declaration) this.localDeclarations.get( name ), workingMemory );
- } else {
- Class clazz = (Class) this.globals.get( name );
- resolver = new CLPGlobalVariable( name,
- clazz,
- ValueType.determineValueType( clazz ).getSimpleType(),
- this );
- }
-
- if ( resolver != null ) {
- this.resolvers.put( name,
- resolver );
- return resolver;
- } else {
- return null;
- }
- }
-
- // public boolean isTarget(String name) {
- // return this.resolvers.containsKey( name );
- // }
-
- // public ValueHandler createExternalVariable(String identifier) {
- // registerExternalVariable( identifier );
- // ValueHandler variable;
- // if ( this.declarations.containsKey( identifier )) {
- // variable = new DroolsMVELDeclarationVariable( (Declaration) this.declarations.get( identifier ), this );
- // } else {
- // variable = new DroolsMVELGlobalVariable( identifier, (Class) this.globals.get( identifier ), this );
- // }
- // return variable;
- // return null;
- // }
- //
- // public boolean isValidVariable(String identifier) {
- // return this.declarations.containsKey( identifier );
- // }
- //
- // public Declaration[] getRequiredDeclarations() {
- // List list = new ArrayList();
- // for (int i = 0, length = this.requiredVariables.length; i < length; i++) {
- // list.add( this.declarations.get( this.requiredVariables[i] ) );
- // }
- // return (Declaration[]) list.toArray( new Declaration[list.size() ] );
- // }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPLexer.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPLexer.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPLexer.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,2230 +0,0 @@
-// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2008-01-20 20:25:48
-
- 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;
-public class CLPLexer extends Lexer {
- public static final int RIGHT_SQUARE=38;
- public static final int RIGHT_CURLY=40;
- public static final int EQUALS=23;
- public static final int FLOAT=24;
- public static final int NOT=15;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=35;
- public static final int AND=13;
- public static final int EOF=-1;
- public static final int HexDigit=31;
- public static final int DEFFUNCTION=7;
- public static final int ASSIGN_OP=18;
- public static final int RIGHT_PAREN=6;
- public static final int NAME=5;
- public static final int EOL=27;
- public static final int DEFRULE=9;
- public static final int TILDE=21;
- public static final int PIPE=19;
- public static final int VAR=8;
- public static final int EXISTS=16;
- public static final int SYMBOL=34;
- public static final int NULL=26;
- public static final int BOOL=25;
- public static final int SALIENCE=11;
- public static final int AMPERSAND=20;
- public static final int INT=12;
- public static final int T43=43;
- public static final int Tokens=44;
- public static final int T42=42;
- public static final int MULTI_LINE_COMMENT=41;
- public static final int COLON=22;
- public static final int WS=28;
- public static final int UnicodeEscape=32;
- public static final int LEFT_CURLY=39;
- public static final int OR=14;
- public static final int TEST=17;
- public static final int LEFT_PAREN=4;
- public static final int DECLARE=29;
- public static final int LEFT_SQUARE=37;
- public static final int OctalEscape=33;
- public static final int EscapeSequence=30;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=36;
- public static final int STRING=10;
- public CLPLexer() {;}
- public CLPLexer(CharStream input) {
- super(input);
- ruleMemo = new HashMap[42+1];
- }
- public String getGrammarFileName() { return "C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g"; }
-
- // $ANTLR start T42
- public final void mT42() throws RecognitionException {
- try {
- int _type = T42;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:6:5: ( 'import' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:6:7: 'import'
- {
- match("import"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end T42
-
- // $ANTLR start T43
- public final void mT43() throws RecognitionException {
- try {
- int _type = T43;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:7:5: ( '=>' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:7:7: '=>'
- {
- match("=>"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end T43
-
- // $ANTLR start WS
- public final void mWS() throws RecognitionException {
- try {
- int _type = WS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:679:9: ( ( ' ' | '\\t' | '\\f' | EOL ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:679:17: ( ' ' | '\\t' | '\\f' | EOL )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:679: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("679:17: ( ' ' | '\\t' | '\\f' | EOL )", 1, 0, input);
-
- throw nvae;
- }
-
- switch (alt1) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:679:19: ' '
- {
- match(' '); if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:680:19: '\\t'
- {
- match('\t'); if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:681:19: '\\f'
- {
- match('\f'); if (failed) return ;
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:682:19: EOL
- {
- mEOL(); if (failed) return ;
-
- }
- break;
-
- }
-
- if ( backtracking==0 ) {
- channel=HIDDEN;
- }
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end WS
-
- // $ANTLR start DEFRULE
- public final void mDEFRULE() throws RecognitionException {
- try {
- int _type = DEFRULE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:687:10: ( 'defrule' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:687:12: 'defrule'
- {
- match("defrule"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DEFRULE
-
- // $ANTLR start DEFFUNCTION
- public final void mDEFFUNCTION() throws RecognitionException {
- try {
- int _type = DEFFUNCTION;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:688:13: ( 'deffunction' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:688:15: 'deffunction'
- {
- match("deffunction"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DEFFUNCTION
-
- // $ANTLR start OR
- public final void mOR() throws RecognitionException {
- try {
- int _type = OR;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:689:7: ( 'or' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:689:9: 'or'
- {
- match("or"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end OR
-
- // $ANTLR start AND
- public final void mAND() throws RecognitionException {
- try {
- int _type = AND;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:690:7: ( 'and' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:690:9: 'and'
- {
- match("and"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end AND
-
- // $ANTLR start NOT
- public final void mNOT() throws RecognitionException {
- try {
- int _type = NOT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:7: ( 'not' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:691:9: 'not'
- {
- match("not"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NOT
-
- // $ANTLR start EXISTS
- public final void mEXISTS() throws RecognitionException {
- try {
- int _type = EXISTS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:10: ( 'exists' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:692:12: 'exists'
- {
- match("exists"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end EXISTS
-
- // $ANTLR start TEST
- public final void mTEST() throws RecognitionException {
- try {
- int _type = TEST;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:693:8: ( 'test' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:693:10: 'test'
- {
- match("test"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end TEST
-
- // $ANTLR start NULL
- public final void mNULL() throws RecognitionException {
- try {
- int _type = NULL;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:695:7: ( 'null' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:695:9: 'null'
- {
- match("null"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NULL
-
- // $ANTLR start DECLARE
- public final void mDECLARE() throws RecognitionException {
- try {
- int _type = DECLARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:697:10: ( 'declare' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:697:12: 'declare'
- {
- match("declare"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DECLARE
-
- // $ANTLR start SALIENCE
- public final void mSALIENCE() throws RecognitionException {
- try {
- int _type = SALIENCE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:699:10: ( 'salience' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:699:12: 'salience'
- {
- match("salience"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end SALIENCE
-
- // $ANTLR start EOL
- public final void mEOL() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:704:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:705:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:705: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') && (synpred1())) {
- alt2=1;
- }
- else {
- alt2=2;}
- }
- else if ( (LA2_0=='\n') ) {
- alt2=3;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("705:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
-
- throw nvae;
- }
- switch (alt2) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:705:14: ( '\\r\\n' )=> '\\r\\n'
- {
- match("\r\n"); if (failed) return ;
-
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:706:25: '\\r'
- {
- match('\r'); if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:707:25: '\\n'
- {
- match('\n'); if (failed) return ;
-
- }
- break;
-
- }
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end EOL
-
- // $ANTLR start INT
- public final void mINT() throws RecognitionException {
- try {
- int _type = INT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712:2: ( ( '-' )? ( '0' .. '9' )+ )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712:4: ( '-' )? ( '0' .. '9' )+
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712:4: ( '-' )?
- int alt3=2;
- int LA3_0 = input.LA(1);
-
- if ( (LA3_0=='-') ) {
- alt3=1;
- }
- switch (alt3) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712:5: '-'
- {
- match('-'); if (failed) return ;
-
- }
- break;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:712:11: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
-
- }
- break;
-
- default :
- if ( cnt4 >= 1 ) break loop4;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(4, input);
- throw eee;
- }
- cnt4++;
- } while (true);
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end INT
-
- // $ANTLR start FLOAT
- public final void mFLOAT() throws RecognitionException {
- try {
- int _type = FLOAT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:2: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:4: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:4: ( '-' )?
- int alt5=2;
- int LA5_0 = input.LA(1);
-
- if ( (LA5_0=='-') ) {
- alt5=1;
- }
- switch (alt5) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:5: '-'
- {
- match('-'); if (failed) return ;
-
- }
- break;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:11: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
-
- }
- break;
-
- 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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:716:27: '0' .. '9'
- {
- matchRange('0','9'); if (failed) return ;
-
- }
- break;
-
- default :
- if ( cnt7 >= 1 ) break loop7;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(7, input);
- throw eee;
- }
- cnt7++;
- } while (true);
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end FLOAT
-
- // $ANTLR start STRING
- public final void mSTRING() throws RecognitionException {
- try {
- int _type = STRING;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720:5: ( ( '\"' ( 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("719:1: STRING : ( ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) | ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' ) );", 10, 0, input);
-
- throw nvae;
- }
- switch (alt10) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720:9: '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
- {
- match('\"'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720:15: EscapeSequence
- {
- mEscapeSequence(); if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:720: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);
-
- match('\"'); if (failed) return ;
-
- }
-
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721:9: '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\''
- {
- match('\''); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721:16: EscapeSequence
- {
- mEscapeSequence(); if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:721: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);
-
- match('\''); if (failed) return ;
-
- }
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end STRING
-
- // $ANTLR start HexDigit
- public final void mHexDigit() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:725:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:725: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;
- }
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end HexDigit
-
- // $ANTLR start EscapeSequence
- public final void mEscapeSequence() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:729:5: ( '\\\\' ( '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("727:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 1, input);
-
- throw nvae;
- }
-
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("727:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 0, input);
-
- throw nvae;
- }
- switch (alt11) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:729: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' ) {
- 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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:730:9: UnicodeEscape
- {
- mUnicodeEscape(); if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:731:9: OctalEscape
- {
- mOctalEscape(); if (failed) return ;
-
- }
- break;
-
- }
- }
- finally {
- }
- }
- // $ANTLR end EscapeSequence
-
- // $ANTLR start OctalEscape
- public final void mOctalEscape() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:5: ( '\\\\' ( '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;
- }
- else {
- alt12=2;}
- }
- 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 {
- alt12=3;}
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("734: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("734:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 0, input);
-
- throw nvae;
- }
- switch (alt12) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:14: ( '0' .. '3' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:15: '0' .. '3'
- {
- matchRange('0','3'); if (failed) return ;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:25: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:26: '0' .. '7'
- {
- matchRange('0','7'); if (failed) return ;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:36: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:736:37: '0' .. '7'
- {
- matchRange('0','7'); if (failed) return ;
-
- }
-
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:737:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:737:14: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:737:15: '0' .. '7'
- {
- matchRange('0','7'); if (failed) return ;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:737:25: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:737:26: '0' .. '7'
- {
- matchRange('0','7'); if (failed) return ;
-
- }
-
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:738:9: '\\\\' ( '0' .. '7' )
- {
- match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:738:14: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:738:15: '0' .. '7'
- {
- matchRange('0','7'); if (failed) return ;
-
- }
-
-
- }
- break;
-
- }
- }
- finally {
- }
- }
- // $ANTLR end OctalEscape
-
- // $ANTLR start UnicodeEscape
- public final void mUnicodeEscape() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:743:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:743: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 ;
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end UnicodeEscape
-
- // $ANTLR start BOOL
- public final void mBOOL() throws RecognitionException {
- try {
- int _type = BOOL;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:747:2: ( ( 'true' | 'false' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:747:4: ( 'true' | 'false' )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:747: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("747:4: ( 'true' | 'false' )", 13, 0, input);
-
- throw nvae;
- }
- switch (alt13) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:747:5: 'true'
- {
- match("true"); if (failed) return ;
-
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:747:12: 'false'
- {
- match("false"); if (failed) return ;
-
-
- }
- break;
-
- }
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end BOOL
-
- // $ANTLR start VAR
- public final void mVAR() throws RecognitionException {
- try {
- int _type = VAR;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:750:6: ( '?' ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '$' ) ( SYMBOL )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:750: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:750: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:750:38: SYMBOL
- {
- mSYMBOL(); if (failed) return ;
-
- }
- break;
-
- default :
- break loop14;
- }
- } while (true);
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end VAR
-
- // $ANTLR start SH_STYLE_SINGLE_LINE_COMMENT
- public final void mSH_STYLE_SINGLE_LINE_COMMENT() throws RecognitionException {
- try {
- int _type = SH_STYLE_SINGLE_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:754:2: ( '#' ( options {greedy=false; } : . )* EOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:754:4: '#' ( options {greedy=false; } : . )* EOL
- {
- match('#'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:754: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:754:35: .
- {
- matchAny(); if (failed) return ;
-
- }
- break;
-
- default :
- break loop15;
- }
- } while (true);
-
- mEOL(); if (failed) return ;
- if ( backtracking==0 ) {
- channel=HIDDEN;
- }
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end SH_STYLE_SINGLE_LINE_COMMENT
-
- // $ANTLR start C_STYLE_SINGLE_LINE_COMMENT
- public final void mC_STYLE_SINGLE_LINE_COMMENT() throws RecognitionException {
- try {
- int _type = C_STYLE_SINGLE_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:760:2: ( '//' ( options {greedy=false; } : . )* EOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:760:4: '//' ( options {greedy=false; } : . )* EOL
- {
- match("//"); if (failed) return ;
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:760: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:760:36: .
- {
- matchAny(); if (failed) return ;
-
- }
- break;
-
- default :
- break loop16;
- }
- } while (true);
-
- mEOL(); if (failed) return ;
- if ( backtracking==0 ) {
- channel=HIDDEN;
- }
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end C_STYLE_SINGLE_LINE_COMMENT
-
- // $ANTLR start LEFT_PAREN
- public final void mLEFT_PAREN() throws RecognitionException {
- try {
- int _type = LEFT_PAREN;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:766:2: ( '(' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:766:4: '('
- {
- match('('); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LEFT_PAREN
-
- // $ANTLR start RIGHT_PAREN
- public final void mRIGHT_PAREN() throws RecognitionException {
- try {
- int _type = RIGHT_PAREN;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:770:2: ( ')' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:770:4: ')'
- {
- match(')'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RIGHT_PAREN
-
- // $ANTLR start LEFT_SQUARE
- public final void mLEFT_SQUARE() throws RecognitionException {
- try {
- int _type = LEFT_SQUARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:774:2: ( '[' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:774:4: '['
- {
- match('['); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LEFT_SQUARE
-
- // $ANTLR start RIGHT_SQUARE
- public final void mRIGHT_SQUARE() throws RecognitionException {
- try {
- int _type = RIGHT_SQUARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:778:2: ( ']' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:778:4: ']'
- {
- match(']'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RIGHT_SQUARE
-
- // $ANTLR start LEFT_CURLY
- public final void mLEFT_CURLY() throws RecognitionException {
- try {
- int _type = LEFT_CURLY;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:782:2: ( '{' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:782:4: '{'
- {
- match('{'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LEFT_CURLY
-
- // $ANTLR start RIGHT_CURLY
- public final void mRIGHT_CURLY() throws RecognitionException {
- try {
- int _type = RIGHT_CURLY;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:786:2: ( '}' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:786:4: '}'
- {
- match('}'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RIGHT_CURLY
-
- // $ANTLR start TILDE
- public final void mTILDE() throws RecognitionException {
- try {
- int _type = TILDE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:789:7: ( '~' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:789:9: '~'
- {
- match('~'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end TILDE
-
- // $ANTLR start AMPERSAND
- public final void mAMPERSAND() throws RecognitionException {
- try {
- int _type = AMPERSAND;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:793:2: ( '&' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:793:4: '&'
- {
- match('&'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end AMPERSAND
-
- // $ANTLR start PIPE
- public final void mPIPE() throws RecognitionException {
- try {
- int _type = PIPE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:797:2: ( '|' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:797:4: '|'
- {
- match('|'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end PIPE
-
- // $ANTLR start ASSIGN_OP
- public final void mASSIGN_OP() throws RecognitionException {
- try {
- int _type = ASSIGN_OP;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:801:2: ( '<-' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:801:4: '<-'
- {
- match("<-"); if (failed) return ;
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end ASSIGN_OP
-
- // $ANTLR start COLON
- public final void mCOLON() throws RecognitionException {
- try {
- int _type = COLON;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:804:7: ( ':' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:804:9: ':'
- {
- match(':'); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end COLON
-
- // $ANTLR start EQUALS
- public final void mEQUALS() throws RecognitionException {
- try {
- int _type = EQUALS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:806:8: ( '=' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:806:10: '='
- {
- match('='); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end EQUALS
-
- // $ANTLR start MULTI_LINE_COMMENT
- public final void mMULTI_LINE_COMMENT() throws RecognitionException {
- try {
- int _type = MULTI_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:809:2: ( '/*' ( options {greedy=false; } : . )* '*/' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:809:4: '/*' ( options {greedy=false; } : . )* '*/'
- {
- match("/*"); if (failed) return ;
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:809: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;
- }
-
-
- switch (alt17) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:809:35: .
- {
- matchAny(); if (failed) return ;
-
- }
- break;
-
- default :
- break loop17;
- }
- } while (true);
-
- match("*/"); if (failed) return ;
-
- if ( backtracking==0 ) {
- channel=HIDDEN;
- }
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end MULTI_LINE_COMMENT
-
- // $ANTLR start NAME
- public final void mNAME() throws RecognitionException {
- try {
- int _type = NAME;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:813:6: ( SYMBOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:813:8: SYMBOL
- {
- mSYMBOL(); if (failed) return ;
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NAME
-
- // $ANTLR start SYMBOL
- public final void mSYMBOL() throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:2: ( ( (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '?' | '$' ) ) | ( '$' ~ ( '?' | ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' ) ) ) (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' | '?' ) )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:4: ( (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '?' | '$' ) ) | ( '$' ~ ( '?' | ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' ) ) ) (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' | '?' ) )*
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817: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("817:4: ( (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '?' | '$' ) ) | ( '$' ~ ( '?' | ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' ) ) )", 18, 0, input);
-
- throw nvae;
- }
- switch (alt18) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:5: (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '?' | '$' ) )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:5: (~ ( ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '?' | '$' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:65: ( '$' ~ ( '?' | ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' ) )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817:65: ( '$' ~ ( '?' | ' ' | '\\t' | '\\n' | '\\r' | '\"' | '(' | ')' | ';' | '&' | '|' | '~' | '<' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:817: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\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:818: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;
- }
-
-
- switch (alt19) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:818: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 {
- }
- }
- // $ANTLR end SYMBOL
-
- public void mTokens() throws RecognitionException {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:8: ( T42 | T43 | WS | DEFRULE | DEFFUNCTION | 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=34;
- alt20 = dfa20.predict(input);
- switch (alt20) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:10: T42
- {
- mT42(); if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:14: T43
- {
- mT43(); if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:18: WS
- {
- mWS(); if (failed) return ;
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:21: DEFRULE
- {
- mDEFRULE(); if (failed) return ;
-
- }
- break;
- case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:29: DEFFUNCTION
- {
- mDEFFUNCTION(); if (failed) return ;
-
- }
- break;
- case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:41: OR
- {
- mOR(); if (failed) return ;
-
- }
- break;
- case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:44: AND
- {
- mAND(); if (failed) return ;
-
- }
- break;
- case 8 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:48: NOT
- {
- mNOT(); if (failed) return ;
-
- }
- break;
- case 9 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:52: EXISTS
- {
- mEXISTS(); if (failed) return ;
-
- }
- break;
- case 10 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:59: TEST
- {
- mTEST(); if (failed) return ;
-
- }
- break;
- case 11 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:64: NULL
- {
- mNULL(); if (failed) return ;
-
- }
- break;
- case 12 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:69: DECLARE
- {
- mDECLARE(); if (failed) return ;
-
- }
- break;
- case 13 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:77: SALIENCE
- {
- mSALIENCE(); if (failed) return ;
-
- }
- break;
- case 14 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:86: INT
- {
- mINT(); if (failed) return ;
-
- }
- break;
- case 15 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:90: FLOAT
- {
- mFLOAT(); if (failed) return ;
-
- }
- break;
- case 16 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:96: STRING
- {
- mSTRING(); if (failed) return ;
-
- }
- break;
- case 17 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:103: BOOL
- {
- mBOOL(); if (failed) return ;
-
- }
- break;
- case 18 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:108: VAR
- {
- mVAR(); if (failed) return ;
-
- }
- break;
- case 19 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:112: SH_STYLE_SINGLE_LINE_COMMENT
- {
- mSH_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
-
- }
- break;
- case 20 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:141: C_STYLE_SINGLE_LINE_COMMENT
- {
- mC_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
-
- }
- break;
- case 21 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:169: LEFT_PAREN
- {
- mLEFT_PAREN(); if (failed) return ;
-
- }
- break;
- case 22 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:180: RIGHT_PAREN
- {
- mRIGHT_PAREN(); if (failed) return ;
-
- }
- break;
- case 23 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:192: LEFT_SQUARE
- {
- mLEFT_SQUARE(); if (failed) return ;
-
- }
- break;
- case 24 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:204: RIGHT_SQUARE
- {
- mRIGHT_SQUARE(); if (failed) return ;
-
- }
- break;
- case 25 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:217: LEFT_CURLY
- {
- mLEFT_CURLY(); if (failed) return ;
-
- }
- break;
- case 26 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:228: RIGHT_CURLY
- {
- mRIGHT_CURLY(); if (failed) return ;
-
- }
- break;
- case 27 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:240: TILDE
- {
- mTILDE(); if (failed) return ;
-
- }
- break;
- case 28 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:246: AMPERSAND
- {
- mAMPERSAND(); if (failed) return ;
-
- }
- break;
- case 29 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:256: PIPE
- {
- mPIPE(); if (failed) return ;
-
- }
- break;
- case 30 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:261: ASSIGN_OP
- {
- mASSIGN_OP(); if (failed) return ;
-
- }
- break;
- case 31 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:271: COLON
- {
- mCOLON(); if (failed) return ;
-
- }
- break;
- case 32 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:277: EQUALS
- {
- mEQUALS(); if (failed) return ;
-
- }
- break;
- case 33 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:284: MULTI_LINE_COMMENT
- {
- mMULTI_LINE_COMMENT(); if (failed) return ;
-
- }
- break;
- case 34 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:1:303: NAME
- {
- mNAME(); if (failed) return ;
-
- }
- break;
-
- }
-
- }
-
- // $ANTLR start synpred1
- public final void synpred1_fragment() throws RecognitionException {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:705:14: ( '\\r\\n' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:705:16: '\\r\\n'
- {
- match("\r\n"); if (failed) return ;
-
-
- }
- }
- // $ANTLR end synpred1
-
- public final boolean synpred1() {
- backtracking++;
- int start = input.mark();
- try {
- synpred1_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
-
-
- protected DFA20 dfa20 = new DFA20(this);
- static final String DFA20_eotS =
- "\1\uffff\1\37\1\42\1\uffff\1\3\10\37\1\55\1\uffff\2\37\1\uffff\2"+
- "\37\2\uffff\1\67\1\70\1\71\1\72\3\uffff\1\37\1\74\1\uffff\1\37\1"+
- "\76\1\uffff\1\37\1\101\7\37\1\55\1\uffff\3\37\1\16\1\37\1\uffff"+
- "\3\37\4\uffff\1\124\1\uffff\1\37\1\uffff\2\37\1\uffff\1\131\1\132"+
- "\5\37\1\140\5\37\1\uffff\2\37\1\uffff\1\37\1\uffff\4\37\2\uffff"+
- "\1\152\1\37\1\154\1\155\1\37\1\uffff\4\37\1\122\4\37\1\uffff\1\37"+
- "\2\uffff\3\37\1\154\1\171\3\37\1\175\2\37\1\uffff\1\37\1\u0081\1"+
- "\u0082\1\uffff\3\37\2\uffff\1\u0085\1\37\1\uffff\1\37\1\u0088\1"+
- "\uffff";
- static final String DFA20_eofS =
- "\u0089\uffff";
- static final String DFA20_minS =
- "\1\0\1\155\1\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\160\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\uffff\1\60\1\42\2\0\1\154\1\uffff"+
- "\3\0\4\uffff\1\0\1\uffff\1\157\1\uffff\1\146\1\154\1\uffff\2\0\1"+
- "\154\1\163\1\145\1\164\1\151\2\0\1\60\2\0\1\163\1\uffff\2\0\1\uffff"+
- "\1\0\1\uffff\1\162\2\165\1\141\2\uffff\1\0\1\164\2\0\1\145\1\uffff"+
- "\1\60\2\0\1\145\1\0\1\164\1\156\1\154\1\162\1\uffff\1\163\2\uffff"+
- "\1\156\1\60\3\0\1\143\2\145\1\0\1\143\1\60\1\uffff\1\164\2\0\1\uffff"+
- "\1\145\1\0\1\151\2\uffff\1\0\1\157\1\uffff\1\156\1\0\1\uffff";
- static final String DFA20_maxS =
- "\1\ufffe\1\155\1\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\160\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\uffff\1\71\1\165\2\ufffe\1\154\1\uffff\3\ufffe\4\uffff"+
- "\1\ufffe\1\uffff\1\157\1\uffff\1\162\1\154\1\uffff\2\ufffe\1\154"+
- "\1\163\1\145\1\164\1\151\2\ufffe\1\146\2\ufffe\1\163\1\uffff\2\ufffe"+
- "\1\uffff\1\ufffe\1\uffff\1\162\2\165\1\141\2\uffff\1\ufffe\1\164"+
- "\2\ufffe\1\145\1\uffff\1\146\2\ufffe\1\145\1\ufffe\1\164\1\156\1"+
- "\154\1\162\1\uffff\1\163\2\uffff\1\156\1\146\3\ufffe\1\143\2\145"+
- "\1\ufffe\1\143\1\146\1\uffff\1\164\2\ufffe\1\uffff\1\145\1\ufffe"+
- "\1\151\2\uffff\1\ufffe\1\157\1\uffff\1\156\1\ufffe\1\uffff";
- static final String DFA20_acceptS =
- "\3\uffff\1\3\12\uffff\1\20\2\uffff\1\22\2\uffff\1\25\1\26\4\uffff"+
- "\1\33\1\34\1\35\2\uffff\1\42\2\uffff\1\40\12\uffff\1\16\5\uffff"+
- "\1\23\3\uffff\1\27\1\30\1\31\1\32\1\uffff\1\37\1\uffff\1\2\2\uffff"+
- "\1\6\15\uffff\1\24\2\uffff\1\41\1\uffff\1\36\4\uffff\1\7\1\10\5"+
- "\uffff\1\17\11\uffff\1\13\1\uffff\1\21\1\12\13\uffff\1\1\3\uffff"+
- "\1\11\3\uffff\1\4\1\14\2\uffff\1\15\2\uffff\1\5";
- static final String DFA20_specialS =
- "\u0089\uffff}>";
- static final String[] DFA20_transitionS = {
- "\11\37\2\3\1\37\1\4\1\3\22\37\1\3\1\37\1\16\1\22\2\37\1\33\1"+
- "\17\1\24\1\25\3\37\1\14\1\37\1\23\12\15\1\36\1\uffff\1\35\1"+
- "\2\1\37\1\21\33\37\1\26\1\37\1\27\3\37\1\7\2\37\1\5\1\11\1\20"+
- "\2\37\1\1\4\37\1\10\1\6\3\37\1\13\1\12\6\37\1\30\1\34\1\31\1"+
- "\32\uff80\37",
- "\1\40",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\1\37\1\41\1\uffff\74\37"+
- "\1\uffff\1\37\1\uffff\uff80\37",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\43",
- "\1\44",
- "\1\45",
- "\1\46\5\uffff\1\47",
- "\1\50",
- "\1\52\14\uffff\1\51",
- "\1\53",
- "\12\54",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\4\37\1\56\1\37\12\54\1\37\2\uffff\2\37"+
- "\1\uffff\74\37\1\uffff\1\37\1\uffff\uff80\37",
- "",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\1\62",
- "",
- "\11\64\2\63\2\64\1\63\22\64\1\63\1\64\1\63\3\64\1\63\1\64\2"+
- "\63\21\64\2\63\2\64\1\63\74\64\1\63\1\64\1\63\uff80\64",
- "\1\66\4\uffff\1\65",
- "",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "",
- "",
- "",
- "\1\73",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "",
- "\1\75",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "",
- "\1\100\2\uffff\1\77",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\102",
- "\1\103",
- "\1\104",
- "\1\105",
- "\1\106",
- "\1\107",
- "\1\110",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\4\37\1\56\1\37\12\54\1\37\2\uffff\2\37"+
- "\1\uffff\74\37\1\uffff\1\37\1\uffff\uff80\37",
- "",
- "\12\111",
- "\1\16\4\uffff\1\112\10\uffff\4\114\4\115\44\uffff\1\112\5\uffff"+
- "\1\112\3\uffff\1\112\7\uffff\1\112\3\uffff\1\112\1\uffff\1\112"+
- "\1\113",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\116",
- "",
- "\11\64\2\63\2\64\1\63\22\64\1\63\1\64\1\63\3\64\1\63\1\64\2"+
- "\63\21\64\2\63\2\64\1\63\74\64\1\63\1\64\1\63\uff80\64",
- "\11\120\2\117\2\120\1\117\22\120\1\117\1\120\1\117\3\120\1\117"+
- "\1\120\2\117\21\120\2\117\2\120\1\117\74\120\1\117\1\120\1\117"+
- "\uff80\120",
- "\11\123\2\122\2\123\1\122\22\123\1\122\1\123\1\122\3\123\1\122"+
- "\1\123\2\122\1\121\20\123\2\122\2\123\1\122\74\123\1\122\1\123"+
- "\1\122\uff80\123",
- "",
- "",
- "",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "",
- "\1\125",
- "",
- "\1\126\13\uffff\1\127",
- "\1\130",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\133",
- "\1\134",
- "\1\135",
- "\1\136",
- "\1\137",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\6\37\12\111\1\37\2\uffff\2\37\1\uffff"+
- "\74\37\1\uffff\1\37\1\uffff\uff80\37",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\12\141\7\uffff\6\141\32\uffff\6\141",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\6\60\10\142\3\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1"+
- "\60\1\16\uff80\60",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\6\60\10\143\3\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1"+
- "\60\1\16\uff80\60",
- "\1\144",
- "",
- "\11\120\2\117\2\120\1\117\22\120\1\117\1\120\1\117\3\120\1\117"+
- "\1\120\2\117\21\120\2\117\2\120\1\117\74\120\1\117\1\120\1\117"+
- "\uff80\120",
- "\11\123\2\122\2\123\1\122\22\123\1\122\1\123\1\122\3\123\1\122"+
- "\1\123\2\122\1\121\4\123\1\145\13\123\2\122\2\123\1\122\74\123"+
- "\1\122\1\123\1\122\uff80\123",
- "",
- "\11\123\2\122\2\123\1\122\22\123\1\122\1\123\1\122\3\123\1\122"+
- "\1\123\2\122\1\121\20\123\2\122\2\123\1\122\74\123\1\122\1\123"+
- "\1\122\uff80\123",
- "",
- "\1\146",
- "\1\147",
- "\1\150",
- "\1\151",
- "",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\153",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\156",
- "",
- "\12\157\7\uffff\6\157\32\uffff\6\157",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\6\60\10\160\3\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1"+
- "\60\1\16\uff80\60",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\1\161",
- "\11\123\2\uffff\2\123\1\uffff\22\123\1\uffff\1\123\1\uffff\3"+
- "\123\1\uffff\1\123\2\uffff\1\121\20\123\2\uffff\2\123\1\uffff"+
- "\74\123\1\uffff\1\123\1\uffff\uff80\123",
- "\1\162",
- "\1\163",
- "\1\164",
- "\1\165",
- "",
- "\1\166",
- "",
- "",
- "\1\167",
- "\12\170\7\uffff\6\170\32\uffff\6\170",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\172",
- "\1\173",
- "\1\174",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\176",
- "\12\177\7\uffff\6\177\32\uffff\6\177",
- "",
- "\1\u0080",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "",
- "\1\u0083",
- "\11\60\2\16\2\60\1\16\22\60\1\16\1\60\1\16\3\60\1\16\1\61\2"+
- "\16\21\60\2\16\2\60\1\16\34\60\1\57\37\60\1\16\1\60\1\16\uff80"+
- "\60",
- "\1\u0084",
- "",
- "",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- "\1\u0086",
- "",
- "\1\u0087",
- "\11\37\2\uffff\2\37\1\uffff\22\37\1\uffff\1\37\1\uffff\3\37"+
- "\1\uffff\1\37\2\uffff\21\37\2\uffff\2\37\1\uffff\74\37\1\uffff"+
- "\1\37\1\uffff\uff80\37",
- ""
- };
-
- static final short[] DFA20_eot = DFA.unpackEncodedString(DFA20_eotS);
- static final short[] DFA20_eof = DFA.unpackEncodedString(DFA20_eofS);
- static final char[] DFA20_min = DFA.unpackEncodedStringToUnsignedChars(DFA20_minS);
- static final char[] DFA20_max = DFA.unpackEncodedStringToUnsignedChars(DFA20_maxS);
- static final short[] DFA20_accept = DFA.unpackEncodedString(DFA20_acceptS);
- static final short[] DFA20_special = DFA.unpackEncodedString(DFA20_specialS);
- static final short[][] DFA20_transition;
-
- static {
- int numStates = DFA20_transitionS.length;
- DFA20_transition = new short[numStates][];
- for (int i=0; i<numStates; i++) {
- DFA20_transition[i] = DFA.unpackEncodedString(DFA20_transitionS[i]);
- }
- }
-
- class DFA20 extends DFA {
-
- public DFA20(BaseRecognizer recognizer) {
- this.recognizer = recognizer;
- this.decisionNumber = 20;
- this.eot = DFA20_eot;
- this.eof = DFA20_eof;
- this.min = DFA20_min;
- this.max = DFA20_max;
- this.accept = DFA20_accept;
- this.special = DFA20_special;
- this.transition = DFA20_transition;
- }
- public String getDescription() {
- return "1:1: Tokens : ( T42 | T43 | WS | DEFRULE | DEFFUNCTION | 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-clips/src/main/java/org/drools/clp/CLPMVELLexer.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELLexer.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELLexer.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g 2008-01-26 17:55:37
+// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g 2008-01-29 07:31:27
package org.drools.clp;
@@ -10,60 +10,61 @@
import java.util.Map;
import java.util.HashMap;
public class CLPMVELLexer extends Lexer {
- public static final int RIGHT_SQUARE=37;
- public static final int RIGHT_CURLY=39;
- public static final int EQUALS=22;
- public static final int FLOAT=23;
- public static final int NOT=13;
- public static final int SYMBOL_CHAR=33;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=34;
- public static final int AND=11;
- public static final int FIRST_SYMBOL_CHAR=42;
+ public static final int RIGHT_SQUARE=38;
+ public static final int RIGHT_CURLY=40;
+ public static final int EQUALS=23;
+ public static final int FLOAT=24;
+ public static final int SH_STYLE_SINGLE_LINE_COMMENT=35;
+ public static final int SYMBOL_CHAR=34;
+ public static final int NOT=14;
+ public static final int AND=12;
+ public static final int FIRST_SYMBOL_CHAR=43;
public static final int EOF=-1;
- public static final int HexDigit=30;
- public static final int ASSIGN_OP=17;
+ public static final int HexDigit=31;
+ public static final int DEFFUNCTION=7;
+ public static final int ASSIGN_OP=18;
public static final int RIGHT_PAREN=6;
public static final int NAME=5;
- public static final int EOL=26;
- public static final int DEFRULE=7;
- public static final int TILDE=20;
- public static final int PIPE=18;
- public static final int VAR=16;
- public static final int EXISTS=14;
- public static final int SYMBOL=41;
- public static final int NULL=25;
- public static final int BOOL=24;
- public static final int AMPERSAND=19;
- public static final int SALIENCE=9;
- public static final int INT=10;
- public static final int T43=43;
- public static final int Tokens=45;
- public static final int MULTI_LINE_COMMENT=40;
+ public static final int EOL=27;
+ public static final int DEFRULE=8;
+ public static final int TILDE=21;
+ public static final int PIPE=19;
+ public static final int VAR=17;
+ public static final int EXISTS=15;
+ public static final int SYMBOL=42;
+ public static final int NULL=26;
+ public static final int BOOL=25;
+ public static final int SALIENCE=10;
+ public static final int AMPERSAND=20;
+ public static final int INT=11;
+ public static final int Tokens=46;
+ public static final int MULTI_LINE_COMMENT=41;
+ public static final int T45=45;
public static final int T44=44;
- public static final int COLON=21;
- public static final int WS=27;
- public static final int UnicodeEscape=31;
- public static final int LEFT_CURLY=38;
- public static final int OR=12;
- public static final int TEST=15;
+ public static final int COLON=22;
+ public static final int WS=28;
+ public static final int UnicodeEscape=32;
+ public static final int LEFT_CURLY=39;
+ public static final int OR=13;
+ public static final int TEST=16;
public static final int LEFT_PAREN=4;
- public static final int DECLARE=28;
- public static final int LEFT_SQUARE=36;
- public static final int OctalEscape=32;
- public static final int EscapeSequence=29;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=35;
- public static final int STRING=8;
+ public static final int DECLARE=29;
+ public static final int LEFT_SQUARE=37;
+ public static final int EscapeSequence=30;
+ public static final int OctalEscape=33;
+ public static final int C_STYLE_SINGLE_LINE_COMMENT=36;
+ public static final int STRING=9;
public CLPMVELLexer() {;}
public CLPMVELLexer(CharStream input) {
super(input);
- ruleMemo = new HashMap[43+1];
+ ruleMemo = new HashMap[44+1];
}
public String getGrammarFileName() { return "C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g"; }
- // $ANTLR start T43
- public final void mT43() throws RecognitionException {
+ // $ANTLR start T44
+ public final void mT44() throws RecognitionException {
try {
- int _type = T43;
+ int _type = T44;
// C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:6:5: ( 'import' )
// C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:6:7: 'import'
{
@@ -77,12 +78,12 @@
finally {
}
}
- // $ANTLR end T43
+ // $ANTLR end T44
- // $ANTLR start T44
- public final void mT44() throws RecognitionException {
+ // $ANTLR start T45
+ public final void mT45() throws RecognitionException {
try {
- int _type = T44;
+ int _type = T45;
// C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:7:5: ( '=>' )
// C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:7:7: '=>'
{
@@ -96,16 +97,16 @@
finally {
}
}
- // $ANTLR end T44
+ // $ANTLR end T45
// $ANTLR start WS
public final void mWS() throws RecognitionException {
try {
int _type = WS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:680:9: ( ( ' ' | '\\t' | '\\f' | EOL ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:680:17: ( ' ' | '\\t' | '\\f' | EOL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:699:9: ( ( ' ' | '\\t' | '\\f' | EOL ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:699:17: ( ' ' | '\\t' | '\\f' | EOL )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:680:17: ( ' ' | '\\t' | '\\f' | EOL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:699:17: ( ' ' | '\\t' | '\\f' | EOL )
int alt1=4;
switch ( input.LA(1) ) {
case ' ':
@@ -132,35 +133,35 @@
default:
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("680:17: ( ' ' | '\\t' | '\\f' | EOL )", 1, 0, input);
+ new NoViableAltException("699:17: ( ' ' | '\\t' | '\\f' | EOL )", 1, 0, input);
throw nvae;
}
switch (alt1) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:680:19: ' '
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:699:19: ' '
{
match(' '); if (failed) return ;
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:681:19: '\\t'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:700:19: '\\t'
{
match('\t'); if (failed) return ;
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:682:19: '\\f'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:701:19: '\\f'
{
match('\f'); if (failed) return ;
}
break;
case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:683:19: EOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:702:19: EOL
{
mEOL(); if (failed) return ;
@@ -186,8 +187,8 @@
public final void mDEFRULE() throws RecognitionException {
try {
int _type = DEFRULE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:688:10: ( 'defrule' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:688:12: 'defrule'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:707:10: ( 'defrule' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:707:12: 'defrule'
{
match("defrule"); if (failed) return ;
@@ -201,12 +202,31 @@
}
// $ANTLR end DEFRULE
+ // $ANTLR start DEFFUNCTION
+ public final void mDEFFUNCTION() throws RecognitionException {
+ try {
+ int _type = DEFFUNCTION;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:708:13: ( 'deffunction' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:708:15: 'deffunction'
+ {
+ match("deffunction"); if (failed) return ;
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DEFFUNCTION
+
// $ANTLR start OR
public final void mOR() throws RecognitionException {
try {
int _type = OR;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:7: ( 'or' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:9: 'or'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:709:7: ( 'or' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:709:9: 'or'
{
match("or"); if (failed) return ;
@@ -224,8 +244,8 @@
public final void mAND() throws RecognitionException {
try {
int _type = AND;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:691:7: ( 'and' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:691:9: 'and'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:710:7: ( 'and' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:710:9: 'and'
{
match("and"); if (failed) return ;
@@ -243,8 +263,8 @@
public final void mNOT() throws RecognitionException {
try {
int _type = NOT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:692:7: ( 'not' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:692:9: 'not'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:711:7: ( 'not' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:711:9: 'not'
{
match("not"); if (failed) return ;
@@ -262,8 +282,8 @@
public final void mEXISTS() throws RecognitionException {
try {
int _type = EXISTS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:693:10: ( 'exists' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:693:12: 'exists'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:712:10: ( 'exists' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:712:12: 'exists'
{
match("exists"); if (failed) return ;
@@ -281,8 +301,8 @@
public final void mTEST() throws RecognitionException {
try {
int _type = TEST;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:694:8: ( 'test' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:694:10: 'test'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:8: ( 'test' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:10: 'test'
{
match("test"); if (failed) return ;
@@ -300,8 +320,8 @@
public final void mNULL() throws RecognitionException {
try {
int _type = NULL;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:696:7: ( 'null' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:696:9: 'null'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:715:7: ( 'null' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:715:9: 'null'
{
match("null"); if (failed) return ;
@@ -319,8 +339,8 @@
public final void mDECLARE() throws RecognitionException {
try {
int _type = DECLARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:698:10: ( 'declare' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:698:12: 'declare'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:10: ( 'declare' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:12: 'declare'
{
match("declare"); if (failed) return ;
@@ -338,8 +358,8 @@
public final void mSALIENCE() throws RecognitionException {
try {
int _type = SALIENCE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:700:10: ( 'salience' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:700:12: 'salience'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:719:10: ( 'salience' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:719:12: 'salience'
{
match("salience"); if (failed) return ;
@@ -356,10 +376,10 @@
// $ANTLR start EOL
public final void mEOL() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:705:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:706:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:724:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:725:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:706:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:725:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
int alt2=3;
int LA2_0 = input.LA(1);
@@ -378,13 +398,13 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("706:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
+ new NoViableAltException("725:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:706:14: ( '\\r\\n' )=> '\\r\\n'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:725:14: ( '\\r\\n' )=> '\\r\\n'
{
match("\r\n"); if (failed) return ;
@@ -392,14 +412,14 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:707:25: '\\r'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:726:25: '\\r'
{
match('\r'); if (failed) return ;
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:708:25: '\\n'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:727:25: '\\n'
{
match('\n'); if (failed) return ;
@@ -421,10 +441,10 @@
public final void mINT() throws RecognitionException {
try {
int _type = INT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:2: ( ( '-' )? ( '0' .. '9' )+ )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:4: ( '-' )? ( '0' .. '9' )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:2: ( ( '-' )? ( '0' .. '9' )+ )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:4: ( '-' )? ( '0' .. '9' )+
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:4: ( '-' )?
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:4: ( '-' )?
int alt3=2;
int LA3_0 = input.LA(1);
@@ -433,7 +453,7 @@
}
switch (alt3) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:5: '-'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:5: '-'
{
match('-'); if (failed) return ;
@@ -442,7 +462,7 @@
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:10: ( '0' .. '9' )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:10: ( '0' .. '9' )+
int cnt4=0;
loop4:
do {
@@ -456,7 +476,7 @@
switch (alt4) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:713:11: '0' .. '9'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:11: '0' .. '9'
{
matchRange('0','9'); if (failed) return ;
@@ -487,10 +507,10 @@
public final void mFLOAT() throws RecognitionException {
try {
int _type = FLOAT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:2: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:4: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:2: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:4: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:4: ( '-' )?
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:4: ( '-' )?
int alt5=2;
int LA5_0 = input.LA(1);
@@ -499,7 +519,7 @@
}
switch (alt5) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:5: '-'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:5: '-'
{
match('-'); if (failed) return ;
@@ -508,7 +528,7 @@
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:10: ( '0' .. '9' )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:10: ( '0' .. '9' )+
int cnt6=0;
loop6:
do {
@@ -522,7 +542,7 @@
switch (alt6) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:11: '0' .. '9'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:11: '0' .. '9'
{
matchRange('0','9'); if (failed) return ;
@@ -540,7 +560,7 @@
} while (true);
match('.'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:26: ( '0' .. '9' )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:26: ( '0' .. '9' )+
int cnt7=0;
loop7:
do {
@@ -554,7 +574,7 @@
switch (alt7) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:717:27: '0' .. '9'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:736:27: '0' .. '9'
{
matchRange('0','9'); if (failed) return ;
@@ -585,7 +605,7 @@
public final void mSTRING() throws RecognitionException {
try {
int _type = STRING;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:5: ( ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) | ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:5: ( ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) | ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' ) )
int alt10=2;
int LA10_0 = input.LA(1);
@@ -598,19 +618,19 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("720:1: STRING : ( ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) | ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' ) );", 10, 0, input);
+ new NoViableAltException("739:1: STRING : ( ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' ) | ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' ) );", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:9: '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:8: ( '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:9: '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
{
match('\"'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:13: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:13: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
loop8:
do {
int alt8=3;
@@ -626,14 +646,14 @@
switch (alt8) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:15: EscapeSequence
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:15: EscapeSequence
{
mEscapeSequence(); if (failed) return ;
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:721:32: ~ ( '\\\\' | '\"' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:740:32: ~ ( '\\\\' | '\"' )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
input.consume();
@@ -663,13 +683,13 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:9: '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\''
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:8: ( '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\'' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:9: '\\'' ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )* '\\''
{
match('\''); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:14: ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:14: ( EscapeSequence | ~ ( '\\\\' | '\\'' ) )*
loop9:
do {
int alt9=3;
@@ -685,14 +705,14 @@
switch (alt9) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:16: EscapeSequence
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:16: EscapeSequence
{
mEscapeSequence(); if (failed) return ;
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:722:33: ~ ( '\\\\' | '\\'' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:741:33: ~ ( '\\\\' | '\\'' )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
input.consume();
@@ -733,8 +753,8 @@
// $ANTLR start HexDigit
public final void mHexDigit() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:726:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:726:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:745:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:745: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();
@@ -759,7 +779,7 @@
// $ANTLR start EscapeSequence
public final void mEscapeSequence() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:730:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:749:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape )
int alt11=3;
int LA11_0 = input.LA(1);
@@ -797,7 +817,7 @@
default:
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("728:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 1, input);
+ new NoViableAltException("747:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 1, input);
throw nvae;
}
@@ -806,13 +826,13 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("728:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 0, input);
+ new NoViableAltException("747:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UnicodeEscape | OctalEscape );", 11, 0, input);
throw nvae;
}
switch (alt11) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:730:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:749: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' ) {
@@ -830,14 +850,14 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:731:9: UnicodeEscape
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:750:9: UnicodeEscape
{
mUnicodeEscape(); if (failed) return ;
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:732:9: OctalEscape
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:751:9: OctalEscape
{
mOctalEscape(); if (failed) return ;
@@ -854,7 +874,7 @@
// $ANTLR start OctalEscape
public final void mOctalEscape() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
int alt12=3;
int LA12_0 = input.LA(1);
@@ -888,7 +908,7 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("735:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 1, input);
+ new NoViableAltException("754:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 1, input);
throw nvae;
}
@@ -896,31 +916,31 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("735:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 0, input);
+ new NoViableAltException("754:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
{
match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:14: ( '0' .. '3' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:15: '0' .. '3'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:14: ( '0' .. '3' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:15: '0' .. '3'
{
matchRange('0','3'); if (failed) return ;
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:25: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:26: '0' .. '7'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:25: ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:26: '0' .. '7'
{
matchRange('0','7'); if (failed) return ;
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:36: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:737:37: '0' .. '7'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:36: ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:756:37: '0' .. '7'
{
matchRange('0','7'); if (failed) return ;
@@ -930,18 +950,18 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:738:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:757:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
{
match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:738:14: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:738:15: '0' .. '7'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:757:14: ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:757:15: '0' .. '7'
{
matchRange('0','7'); if (failed) return ;
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:738:25: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:738:26: '0' .. '7'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:757:25: ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:757:26: '0' .. '7'
{
matchRange('0','7'); if (failed) return ;
@@ -951,11 +971,11 @@
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:739:9: '\\\\' ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:758:9: '\\\\' ( '0' .. '7' )
{
match('\\'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:739:14: ( '0' .. '7' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:739:15: '0' .. '7'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:758:14: ( '0' .. '7' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:758:15: '0' .. '7'
{
matchRange('0','7'); if (failed) return ;
@@ -975,8 +995,8 @@
// $ANTLR start UnicodeEscape
public final void mUnicodeEscape() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:744:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:744:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:763:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:763:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
{
match('\\'); if (failed) return ;
match('u'); if (failed) return ;
@@ -997,10 +1017,10 @@
public final void mBOOL() throws RecognitionException {
try {
int _type = BOOL;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:748:2: ( ( 'true' | 'false' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:748:4: ( 'true' | 'false' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:2: ( ( 'true' | 'false' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:4: ( 'true' | 'false' )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:748:4: ( 'true' | 'false' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:4: ( 'true' | 'false' )
int alt13=2;
int LA13_0 = input.LA(1);
@@ -1013,13 +1033,13 @@
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("748:4: ( 'true' | 'false' )", 13, 0, input);
+ new NoViableAltException("767:4: ( 'true' | 'false' )", 13, 0, input);
throw nvae;
}
switch (alt13) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:748:5: 'true'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:5: 'true'
{
match("true"); if (failed) return ;
@@ -1027,7 +1047,7 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:748:12: 'false'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:12: 'false'
{
match("false"); if (failed) return ;
@@ -1051,11 +1071,11 @@
public final void mVAR() throws RecognitionException {
try {
int _type = VAR;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:751:6: ( '?' ( SYMBOL_CHAR )+ )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:751:8: '?' ( SYMBOL_CHAR )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:770:6: ( '?' ( SYMBOL_CHAR )+ )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:770:8: '?' ( SYMBOL_CHAR )+
{
match('?'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:751:12: ( SYMBOL_CHAR )+
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:770:12: ( SYMBOL_CHAR )+
int cnt14=0;
loop14:
do {
@@ -1069,7 +1089,7 @@
switch (alt14) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:751:12: SYMBOL_CHAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:770:12: SYMBOL_CHAR
{
mSYMBOL_CHAR(); if (failed) return ;
@@ -1100,11 +1120,11 @@
public final void mSH_STYLE_SINGLE_LINE_COMMENT() throws RecognitionException {
try {
int _type = SH_STYLE_SINGLE_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:755:2: ( '#' ( options {greedy=false; } : . )* EOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:755:4: '#' ( options {greedy=false; } : . )* EOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:774:2: ( '#' ( options {greedy=false; } : . )* EOL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:774:4: '#' ( options {greedy=false; } : . )* EOL
{
match('#'); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:755:8: ( options {greedy=false; } : . )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:774:8: ( options {greedy=false; } : . )*
loop15:
do {
int alt15=2;
@@ -1123,7 +1143,7 @@
switch (alt15) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:755:35: .
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:774:35: .
{
matchAny(); if (failed) return ;
@@ -1153,12 +1173,12 @@
public final void mC_STYLE_SINGLE_LINE_COMMENT() throws RecognitionException {
try {
int _type = C_STYLE_SINGLE_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:761:2: ( '//' ( options {greedy=false; } : . )* EOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:761:4: '//' ( options {greedy=false; } : . )* EOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:780:2: ( '//' ( options {greedy=false; } : . )* EOL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:780:4: '//' ( options {greedy=false; } : . )* EOL
{
match("//"); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:761:9: ( options {greedy=false; } : . )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:780:9: ( options {greedy=false; } : . )*
loop16:
do {
int alt16=2;
@@ -1177,7 +1197,7 @@
switch (alt16) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:761:36: .
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:780:36: .
{
matchAny(); if (failed) return ;
@@ -1207,8 +1227,8 @@
public final void mLEFT_PAREN() throws RecognitionException {
try {
int _type = LEFT_PAREN;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:2: ( '(' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:767:4: '('
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:786:2: ( '(' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:786:4: '('
{
match('('); if (failed) return ;
@@ -1225,8 +1245,8 @@
public final void mRIGHT_PAREN() throws RecognitionException {
try {
int _type = RIGHT_PAREN;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:771:2: ( ')' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:771:4: ')'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:790:2: ( ')' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:790:4: ')'
{
match(')'); if (failed) return ;
@@ -1243,8 +1263,8 @@
public final void mLEFT_SQUARE() throws RecognitionException {
try {
int _type = LEFT_SQUARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:775:2: ( '[' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:775:4: '['
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:794:2: ( '[' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:794:4: '['
{
match('['); if (failed) return ;
@@ -1261,8 +1281,8 @@
public final void mRIGHT_SQUARE() throws RecognitionException {
try {
int _type = RIGHT_SQUARE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:779:2: ( ']' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:779:4: ']'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:798:2: ( ']' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:798:4: ']'
{
match(']'); if (failed) return ;
@@ -1279,8 +1299,8 @@
public final void mLEFT_CURLY() throws RecognitionException {
try {
int _type = LEFT_CURLY;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:783:2: ( '{' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:783:4: '{'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:802:2: ( '{' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:802:4: '{'
{
match('{'); if (failed) return ;
@@ -1297,8 +1317,8 @@
public final void mRIGHT_CURLY() throws RecognitionException {
try {
int _type = RIGHT_CURLY;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:787:2: ( '}' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:787:4: '}'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:806:2: ( '}' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:806:4: '}'
{
match('}'); if (failed) return ;
@@ -1315,8 +1335,8 @@
public final void mTILDE() throws RecognitionException {
try {
int _type = TILDE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:790:7: ( '~' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:790:9: '~'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:809:7: ( '~' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:809:9: '~'
{
match('~'); if (failed) return ;
@@ -1333,8 +1353,8 @@
public final void mAMPERSAND() throws RecognitionException {
try {
int _type = AMPERSAND;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:794:2: ( '&' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:794:4: '&'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:813:2: ( '&' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:813:4: '&'
{
match('&'); if (failed) return ;
@@ -1351,8 +1371,8 @@
public final void mPIPE() throws RecognitionException {
try {
int _type = PIPE;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:798:2: ( '|' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:798:4: '|'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:2: ( '|' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:4: '|'
{
match('|'); if (failed) return ;
@@ -1369,8 +1389,8 @@
public final void mASSIGN_OP() throws RecognitionException {
try {
int _type = ASSIGN_OP;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:802:2: ( '<-' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:802:4: '<-'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:821:2: ( '<-' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:821:4: '<-'
{
match("<-"); if (failed) return ;
@@ -1388,8 +1408,8 @@
public final void mCOLON() throws RecognitionException {
try {
int _type = COLON;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:805:7: ( ':' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:805:9: ':'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:824:7: ( ':' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:824:9: ':'
{
match(':'); if (failed) return ;
@@ -1406,8 +1426,8 @@
public final void mEQUALS() throws RecognitionException {
try {
int _type = EQUALS;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:807:8: ( '=' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:807:10: '='
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:826:8: ( '=' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:826:10: '='
{
match('='); if (failed) return ;
@@ -1424,12 +1444,12 @@
public final void mMULTI_LINE_COMMENT() throws RecognitionException {
try {
int _type = MULTI_LINE_COMMENT;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:810:2: ( '/*' ( options {greedy=false; } : . )* '*/' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:810:4: '/*' ( options {greedy=false; } : . )* '*/'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:829:2: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:829:4: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*"); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:810:9: ( options {greedy=false; } : . )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:829:9: ( options {greedy=false; } : . )*
loop17:
do {
int alt17=2;
@@ -1454,7 +1474,7 @@
switch (alt17) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:810:35: .
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:829:35: .
{
matchAny(); if (failed) return ;
@@ -1485,8 +1505,8 @@
public final void mNAME() throws RecognitionException {
try {
int _type = NAME;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:814:6: ( SYMBOL )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:814:8: SYMBOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:833:6: ( SYMBOL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:833:8: SYMBOL
{
mSYMBOL(); if (failed) return ;
@@ -1502,11 +1522,11 @@
// $ANTLR start SYMBOL
public final void mSYMBOL() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:8: ( FIRST_SYMBOL_CHAR ( SYMBOL_CHAR )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:10: FIRST_SYMBOL_CHAR ( SYMBOL_CHAR )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:836:8: ( FIRST_SYMBOL_CHAR ( SYMBOL_CHAR )* )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:836:10: FIRST_SYMBOL_CHAR ( SYMBOL_CHAR )*
{
mFIRST_SYMBOL_CHAR(); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:28: ( SYMBOL_CHAR )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:836:28: ( SYMBOL_CHAR )*
loop18:
do {
int alt18=2;
@@ -1519,7 +1539,7 @@
switch (alt18) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:817:28: SYMBOL_CHAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:836:28: SYMBOL_CHAR
{
mSYMBOL_CHAR(); if (failed) return ;
@@ -1543,8 +1563,8 @@
// $ANTLR start FIRST_SYMBOL_CHAR
public final void mFIRST_SYMBOL_CHAR() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:822:19: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | '<' | ',' | '.' | '[' | ']' | '{' | '}' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:822:21: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | '<' | ',' | '.' | '[' | ']' | '{' | '}' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:841:19: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | '<' | ',' | '.' | '[' | ']' | '{' | '}' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:841:21: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | '<' | ',' | '.' | '[' | ']' | '{' | '}' )
{
if ( 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)>='a' && input.LA(1)<='{')||input.LA(1)=='}' ) {
input.consume();
@@ -1569,8 +1589,8 @@
// $ANTLR start SYMBOL_CHAR
public final void mSYMBOL_CHAR() throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:827:13: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | ',' | '.' | '[' | ']' | '{' | '}' | '?' ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:827:15: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | ',' | '.' | '[' | ']' | '{' | '}' | '?' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:846:13: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | ',' | '.' | '[' | ']' | '{' | '}' | '?' ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:846:15: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '!' | '$' | '%' | '^' | '*' | '_' | '-' | '+' | '=' | '\\\\' | '/' | '@' | '#' | ':' | '>' | ',' | '.' | '[' | ']' | '{' | '}' | '?' )
{
if ( input.LA(1)=='!'||(input.LA(1)>='#' && input.LA(1)<='%')||(input.LA(1)>='*' && input.LA(1)<=':')||(input.LA(1)>='=' && input.LA(1)<='_')||(input.LA(1)>='a' && input.LA(1)<='{')||input.LA(1)=='}' ) {
input.consume();
@@ -1593,21 +1613,21 @@
// $ANTLR end SYMBOL_CHAR
public void mTokens() throws RecognitionException {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:8: ( T43 | T44 | 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 alt19=33;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:8: ( T44 | T45 | WS | DEFRULE | DEFFUNCTION | 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 alt19=34;
alt19 = dfa19.predict(input);
switch (alt19) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:10: T43
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:10: T44
{
- mT43(); if (failed) return ;
+ mT44(); if (failed) return ;
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:14: T44
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:14: T45
{
- mT44(); if (failed) return ;
+ mT45(); if (failed) return ;
}
break;
@@ -1626,204 +1646,211 @@
}
break;
case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:29: OR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:29: DEFFUNCTION
{
- mOR(); if (failed) return ;
+ mDEFFUNCTION(); if (failed) return ;
}
break;
case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:32: AND
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:41: OR
{
- mAND(); if (failed) return ;
+ mOR(); if (failed) return ;
}
break;
case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:36: NOT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:44: AND
{
- mNOT(); if (failed) return ;
+ mAND(); if (failed) return ;
}
break;
case 8 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:40: EXISTS
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:48: NOT
{
- mEXISTS(); if (failed) return ;
+ mNOT(); if (failed) return ;
}
break;
case 9 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:47: TEST
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:52: EXISTS
{
- mTEST(); if (failed) return ;
+ mEXISTS(); if (failed) return ;
}
break;
case 10 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:52: NULL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:59: TEST
{
- mNULL(); if (failed) return ;
+ mTEST(); if (failed) return ;
}
break;
case 11 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:57: DECLARE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:64: NULL
{
- mDECLARE(); if (failed) return ;
+ mNULL(); if (failed) return ;
}
break;
case 12 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:65: SALIENCE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:69: DECLARE
{
- mSALIENCE(); if (failed) return ;
+ mDECLARE(); if (failed) return ;
}
break;
case 13 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:74: INT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:77: SALIENCE
{
- mINT(); if (failed) return ;
+ mSALIENCE(); if (failed) return ;
}
break;
case 14 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:78: FLOAT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:86: INT
{
- mFLOAT(); if (failed) return ;
+ mINT(); if (failed) return ;
}
break;
case 15 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:84: STRING
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:90: FLOAT
{
- mSTRING(); if (failed) return ;
+ mFLOAT(); if (failed) return ;
}
break;
case 16 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:91: BOOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:96: STRING
{
- mBOOL(); if (failed) return ;
+ mSTRING(); if (failed) return ;
}
break;
case 17 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:96: VAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:103: BOOL
{
- mVAR(); if (failed) return ;
+ mBOOL(); if (failed) return ;
}
break;
case 18 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:100: SH_STYLE_SINGLE_LINE_COMMENT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:108: VAR
{
- mSH_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
+ mVAR(); if (failed) return ;
}
break;
case 19 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:129: C_STYLE_SINGLE_LINE_COMMENT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:112: SH_STYLE_SINGLE_LINE_COMMENT
{
- mC_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
+ mSH_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
}
break;
case 20 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:157: LEFT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:141: C_STYLE_SINGLE_LINE_COMMENT
{
- mLEFT_PAREN(); if (failed) return ;
+ mC_STYLE_SINGLE_LINE_COMMENT(); if (failed) return ;
}
break;
case 21 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:168: RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:169: LEFT_PAREN
{
- mRIGHT_PAREN(); if (failed) return ;
+ mLEFT_PAREN(); if (failed) return ;
}
break;
case 22 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:180: LEFT_SQUARE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:180: RIGHT_PAREN
{
- mLEFT_SQUARE(); if (failed) return ;
+ mRIGHT_PAREN(); if (failed) return ;
}
break;
case 23 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:192: RIGHT_SQUARE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:192: LEFT_SQUARE
{
- mRIGHT_SQUARE(); if (failed) return ;
+ mLEFT_SQUARE(); if (failed) return ;
}
break;
case 24 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:205: LEFT_CURLY
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:204: RIGHT_SQUARE
{
- mLEFT_CURLY(); if (failed) return ;
+ mRIGHT_SQUARE(); if (failed) return ;
}
break;
case 25 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:216: RIGHT_CURLY
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:217: LEFT_CURLY
{
- mRIGHT_CURLY(); if (failed) return ;
+ mLEFT_CURLY(); if (failed) return ;
}
break;
case 26 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:228: TILDE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:228: RIGHT_CURLY
{
- mTILDE(); if (failed) return ;
+ mRIGHT_CURLY(); if (failed) return ;
}
break;
case 27 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:234: AMPERSAND
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:240: TILDE
{
- mAMPERSAND(); if (failed) return ;
+ mTILDE(); if (failed) return ;
}
break;
case 28 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:244: PIPE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:246: AMPERSAND
{
- mPIPE(); if (failed) return ;
+ mAMPERSAND(); if (failed) return ;
}
break;
case 29 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:249: ASSIGN_OP
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:256: PIPE
{
- mASSIGN_OP(); if (failed) return ;
+ mPIPE(); if (failed) return ;
}
break;
case 30 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:259: COLON
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:261: ASSIGN_OP
{
- mCOLON(); if (failed) return ;
+ mASSIGN_OP(); if (failed) return ;
}
break;
case 31 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:265: EQUALS
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:271: COLON
{
- mEQUALS(); if (failed) return ;
+ mCOLON(); if (failed) return ;
}
break;
case 32 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:272: MULTI_LINE_COMMENT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:277: EQUALS
{
- mMULTI_LINE_COMMENT(); if (failed) return ;
+ mEQUALS(); if (failed) return ;
}
break;
case 33 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:291: NAME
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:284: MULTI_LINE_COMMENT
{
+ mMULTI_LINE_COMMENT(); if (failed) return ;
+
+ }
+ break;
+ case 34 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:1:303: NAME
+ {
mNAME(); if (failed) return ;
}
@@ -1835,8 +1862,8 @@
// $ANTLR start synpred1
public final void synpred1_fragment() throws RecognitionException {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:706:14: ( '\\r\\n' )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:706:16: '\\r\\n'
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:725:14: ( '\\r\\n' )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:725:16: '\\r\\n'
{
match("\r\n"); if (failed) return ;
@@ -1866,43 +1893,45 @@
"\1\uffff\1\35\1\40\1\uffff\10\35\1\54\1\uffff\1\35\1\uffff\2\35"+
"\2\uffff\1\62\1\63\1\64\1\65\3\uffff\1\35\1\67\1\uffff\1\35\1\71"+
"\1\uffff\1\35\1\74\7\35\1\54\1\35\1\uffff\2\35\1\uffff\2\35\4\uffff"+
- "\1\113\1\uffff\1\35\1\uffff\2\35\1\uffff\1\117\1\120\5\35\1\126"+
- "\2\35\1\uffff\1\35\1\uffff\1\35\1\uffff\3\35\2\uffff\1\134\1\35"+
- "\1\136\1\137\1\35\1\uffff\1\35\1\111\3\35\1\uffff\1\35\2\uffff\1"+
- "\35\1\136\1\147\2\35\1\152\1\35\1\uffff\1\154\1\155\1\uffff\1\35"+
- "\2\uffff\1\157\1\uffff";
+ "\1\113\1\uffff\1\35\1\uffff\2\35\1\uffff\1\120\1\35\1\122\4\35\1"+
+ "\127\2\35\1\uffff\1\35\1\uffff\1\35\1\uffff\4\35\1\uffff\1\136\1"+
+ "\uffff\1\35\1\140\1\141\1\35\1\uffff\1\35\1\111\4\35\1\uffff\1\35"+
+ "\2\uffff\1\35\1\140\1\152\3\35\1\156\1\35\1\uffff\1\35\1\161\1\162"+
+ "\1\uffff\2\35\2\uffff\1\165\1\35\1\uffff\1\35\1\170\1\uffff";
static final String DFA19_eofS =
- "\160\uffff";
+ "\171\uffff";
static final String DFA19_minS =
"\1\11\1\155\1\41\1\uffff\1\145\1\162\1\156\1\157\1\170\1\145\1\141"+
"\1\60\1\41\1\uffff\1\141\1\uffff\1\0\1\52\2\uffff\4\41\3\uffff\1"+
- "\55\1\41\1\uffff\1\160\1\41\1\uffff\1\143\1\41\1\144\1\164\1\154"+
+ "\55\1\41\1\uffff\1\160\1\41\1\uffff\1\143\1\41\1\144\1\154\1\164"+
"\1\151\1\165\1\163\1\154\1\41\1\60\1\uffff\1\154\1\0\1\uffff\2\0"+
- "\4\uffff\1\41\1\uffff\1\157\1\uffff\1\154\1\162\1\uffff\2\41\1\154"+
- "\1\163\1\145\1\164\1\151\1\41\1\163\1\0\1\uffff\1\0\1\uffff\1\0"+
- "\1\uffff\1\162\1\141\1\165\2\uffff\1\41\1\164\2\41\1\145\1\uffff"+
- "\1\145\1\41\1\164\1\162\1\154\1\uffff\1\163\2\uffff\1\156\2\41\2"+
- "\145\1\41\1\143\1\uffff\2\41\1\uffff\1\145\2\uffff\1\41\1\uffff";
+ "\4\uffff\1\41\1\uffff\1\157\1\uffff\1\146\1\154\1\uffff\1\41\1\154"+
+ "\1\41\1\163\1\145\1\164\1\151\1\41\1\163\1\0\1\uffff\1\0\1\uffff"+
+ "\1\0\1\uffff\1\162\2\165\1\141\1\uffff\1\41\1\uffff\1\164\2\41\1"+
+ "\145\1\uffff\1\145\1\41\1\164\1\156\1\154\1\162\1\uffff\1\163\2"+
+ "\uffff\1\156\2\41\1\143\2\145\1\41\1\143\1\uffff\1\164\2\41\1\uffff"+
+ "\1\145\1\151\2\uffff\1\41\1\157\1\uffff\1\156\1\41\1\uffff";
static final String DFA19_maxS =
"\1\176\1\155\1\175\1\uffff\1\145\1\162\1\156\1\165\1\170\1\162\1"+
"\141\1\71\1\175\1\uffff\1\141\1\uffff\1\ufffe\1\57\2\uffff\4\175"+
"\3\uffff\1\55\1\175\1\uffff\1\160\1\175\1\uffff\1\146\1\175\1\144"+
- "\1\164\1\154\1\151\1\165\1\163\1\154\1\175\1\71\1\uffff\1\154\1"+
- "\ufffe\1\uffff\2\ufffe\4\uffff\1\175\1\uffff\1\157\1\uffff\1\154"+
- "\1\162\1\uffff\2\175\1\154\1\163\1\145\1\164\1\151\1\175\1\163\1"+
- "\ufffe\1\uffff\1\ufffe\1\uffff\1\ufffe\1\uffff\1\162\1\141\1\165"+
- "\2\uffff\1\175\1\164\2\175\1\145\1\uffff\1\145\1\175\1\164\1\162"+
- "\1\154\1\uffff\1\163\2\uffff\1\156\2\175\2\145\1\175\1\143\1\uffff"+
- "\2\175\1\uffff\1\145\2\uffff\1\175\1\uffff";
+ "\1\154\1\164\1\151\1\165\1\163\1\154\1\175\1\71\1\uffff\1\154\1"+
+ "\ufffe\1\uffff\2\ufffe\4\uffff\1\175\1\uffff\1\157\1\uffff\1\162"+
+ "\1\154\1\uffff\1\175\1\154\1\175\1\163\1\145\1\164\1\151\1\175\1"+
+ "\163\1\ufffe\1\uffff\1\ufffe\1\uffff\1\ufffe\1\uffff\1\162\2\165"+
+ "\1\141\1\uffff\1\175\1\uffff\1\164\2\175\1\145\1\uffff\1\145\1\175"+
+ "\1\164\1\156\1\154\1\162\1\uffff\1\163\2\uffff\1\156\2\175\1\143"+
+ "\2\145\1\175\1\143\1\uffff\1\164\2\175\1\uffff\1\145\1\151\2\uffff"+
+ "\1\175\1\157\1\uffff\1\156\1\175\1\uffff";
static final String DFA19_acceptS =
- "\3\uffff\1\3\11\uffff\1\17\1\uffff\1\21\2\uffff\1\24\1\25\4\uffff"+
- "\1\32\1\33\1\34\2\uffff\1\41\2\uffff\1\37\13\uffff\1\15\2\uffff"+
- "\1\22\2\uffff\1\26\1\27\1\30\1\31\1\uffff\1\36\1\uffff\1\2\2\uffff"+
- "\1\5\12\uffff\1\23\1\uffff\1\40\1\uffff\1\35\3\uffff\1\6\1\7\5\uffff"+
- "\1\16\5\uffff\1\12\1\uffff\1\20\1\11\7\uffff\1\1\2\uffff\1\10\1"+
- "\uffff\1\13\1\4\1\uffff\1\14";
+ "\3\uffff\1\3\11\uffff\1\20\1\uffff\1\22\2\uffff\1\25\1\26\4\uffff"+
+ "\1\33\1\34\1\35\2\uffff\1\42\2\uffff\1\40\13\uffff\1\16\2\uffff"+
+ "\1\23\2\uffff\1\27\1\30\1\31\1\32\1\uffff\1\37\1\uffff\1\2\2\uffff"+
+ "\1\6\12\uffff\1\24\1\uffff\1\41\1\uffff\1\36\4\uffff\1\7\1\uffff"+
+ "\1\10\4\uffff\1\17\6\uffff\1\13\1\uffff\1\21\1\12\10\uffff\1\1\3"+
+ "\uffff\1\11\2\uffff\1\4\1\14\2\uffff\1\15\2\uffff\1\5";
static final String DFA19_specialS =
- "\160\uffff}>";
+ "\171\uffff}>";
static final String[] DFA19_transitionS = {
"\2\3\1\uffff\2\3\22\uffff\1\3\1\35\1\15\1\20\2\35\1\31\1\15"+
"\1\22\1\23\3\35\1\13\1\35\1\21\12\14\1\34\1\uffff\1\33\1\2\1"+
@@ -1916,7 +1945,7 @@
"\1\41",
"\1\42",
"\1\43",
- "\1\44\5\uffff\1\45",
+ "\1\45\5\uffff\1\44",
"\1\46",
"\1\50\14\uffff\1\47",
"\1\51",
@@ -1950,7 +1979,7 @@
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"",
- "\1\72\2\uffff\1\73",
+ "\1\73\2\uffff\1\72",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"\1\75",
@@ -1981,75 +2010,85 @@
"",
"\1\114",
"",
- "\1\115",
- "\1\116",
+ "\1\115\13\uffff\1\116",
+ "\1\117",
"",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
+ "\1\121",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
- "\1\121",
- "\1\122",
"\1\123",
"\1\124",
"\1\125",
+ "\1\126",
"\1\35\1\uffff\3\35\4\uffff\6\35\12\104\1\35\2\uffff\43\35\1"+
"\uffff\33\35\1\uffff\1\35",
- "\1\127",
+ "\1\130",
"\41\107\1\106\1\107\3\106\4\107\21\106\2\107\43\106\1\107\33"+
"\106\1\107\1\106\uff81\107",
"",
- "\41\111\1\112\1\111\3\112\4\111\1\110\4\112\1\130\13\112\2\111"+
+ "\41\111\1\112\1\111\3\112\4\111\1\110\4\112\1\131\13\112\2\111"+
"\43\112\1\111\33\112\1\111\1\112\uff81\111",
"",
"\41\111\1\112\1\111\3\112\4\111\1\110\20\112\2\111\43\112\1"+
"\111\33\112\1\111\1\112\uff81\111",
"",
- "\1\131",
"\1\132",
"\1\133",
+ "\1\134",
+ "\1\135",
"",
- "",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
- "\1\135",
+ "",
+ "\1\137",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
- "\1\140",
+ "\1\142",
"",
- "\1\141",
+ "\1\143",
"\1\112\1\uffff\3\112\4\uffff\1\110\20\112\2\uffff\43\112\1\uffff"+
"\33\112\1\uffff\1\112",
- "\1\142",
- "\1\143",
"\1\144",
- "",
"\1\145",
+ "\1\146",
+ "\1\147",
"",
+ "\1\150",
"",
- "\1\146",
+ "",
+ "\1\151",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
- "\1\150",
- "\1\151",
+ "\1\153",
+ "\1\154",
+ "\1\155",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
- "\1\153",
+ "\1\157",
"",
+ "\1\160",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
"",
- "\1\156",
+ "\1\163",
+ "\1\164",
"",
"",
"\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
"\1\uffff\1\35",
+ "\1\166",
+ "",
+ "\1\167",
+ "\1\35\1\uffff\3\35\4\uffff\21\35\2\uffff\43\35\1\uffff\33\35"+
+ "\1\uffff\1\35",
""
};
@@ -2083,7 +2122,7 @@
this.transition = DFA19_transition;
}
public String getDescription() {
- return "1:1: Tokens : ( T43 | T44 | 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 );";
+ return "1:1: Tokens : ( T44 | T45 | WS | DEFRULE | DEFFUNCTION | 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 );";
}
}
Modified: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELParser.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELParser.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPMVELParser.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,10 +1,10 @@
-// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g 2008-01-26 17:55:37
+// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g 2008-01-29 07:31:27
package org.drools.clp;
-
+
+ import org.drools.clp.*;
import org.drools.clp.mvel.*;
- import org.drools.clp.valuehandlers.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
@@ -24,48 +24,49 @@
import java.util.HashMap;
public class CLPMVELParser extends Parser {
public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "LEFT_PAREN", "NAME", "RIGHT_PAREN", "DEFRULE", "STRING", "SALIENCE", "INT", "AND", "OR", "NOT", "EXISTS", "TEST", "VAR", "ASSIGN_OP", "PIPE", "AMPERSAND", "TILDE", "COLON", "EQUALS", "FLOAT", "BOOL", "NULL", "EOL", "WS", "DECLARE", "EscapeSequence", "HexDigit", "UnicodeEscape", "OctalEscape", "SYMBOL_CHAR", "SH_STYLE_SINGLE_LINE_COMMENT", "C_STYLE_SINGLE_LINE_COMMENT", "LEFT_SQUARE", "RIGHT_SQUARE", "LEFT_CURLY", "RIGHT_CURLY", "MULTI_LINE_COMMENT", "SYMBOL", "FIRST_SYMBOL_CHAR", "'import'", "'=>'"
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "LEFT_PAREN", "NAME", "RIGHT_PAREN", "DEFFUNCTION", "DEFRULE", "STRING", "SALIENCE", "INT", "AND", "OR", "NOT", "EXISTS", "TEST", "VAR", "ASSIGN_OP", "PIPE", "AMPERSAND", "TILDE", "COLON", "EQUALS", "FLOAT", "BOOL", "NULL", "EOL", "WS", "DECLARE", "EscapeSequence", "HexDigit", "UnicodeEscape", "OctalEscape", "SYMBOL_CHAR", "SH_STYLE_SINGLE_LINE_COMMENT", "C_STYLE_SINGLE_LINE_COMMENT", "LEFT_SQUARE", "RIGHT_SQUARE", "LEFT_CURLY", "RIGHT_CURLY", "MULTI_LINE_COMMENT", "SYMBOL", "FIRST_SYMBOL_CHAR", "'import'", "'=>'"
};
- public static final int RIGHT_SQUARE=37;
- public static final int RIGHT_CURLY=39;
- public static final int SYMBOL=41;
- public static final int NULL=25;
- public static final int BOOL=24;
- public static final int SALIENCE=9;
- public static final int AMPERSAND=19;
- public static final int FLOAT=23;
- public static final int EQUALS=22;
- public static final int INT=10;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=34;
- public static final int SYMBOL_CHAR=33;
- public static final int NOT=13;
- public static final int AND=11;
- public static final int FIRST_SYMBOL_CHAR=42;
+ public static final int RIGHT_SQUARE=38;
+ public static final int RIGHT_CURLY=40;
+ public static final int EQUALS=23;
+ public static final int FLOAT=24;
+ public static final int NOT=14;
+ public static final int SYMBOL_CHAR=34;
+ public static final int SH_STYLE_SINGLE_LINE_COMMENT=35;
+ public static final int AND=12;
public static final int EOF=-1;
- public static final int HexDigit=30;
- public static final int MULTI_LINE_COMMENT=40;
- public static final int COLON=21;
- public static final int ASSIGN_OP=17;
+ public static final int FIRST_SYMBOL_CHAR=43;
+ public static final int HexDigit=31;
+ public static final int DEFFUNCTION=7;
+ public static final int ASSIGN_OP=18;
public static final int RIGHT_PAREN=6;
public static final int NAME=5;
- public static final int WS=27;
- public static final int EOL=26;
- public static final int UnicodeEscape=31;
- public static final int LEFT_CURLY=38;
- public static final int DEFRULE=7;
- public static final int OR=12;
- public static final int TILDE=20;
- public static final int TEST=15;
+ public static final int EOL=27;
+ public static final int DEFRULE=8;
+ public static final int TILDE=21;
+ public static final int PIPE=19;
+ public static final int VAR=17;
+ public static final int EXISTS=15;
+ public static final int SYMBOL=42;
+ public static final int NULL=26;
+ public static final int BOOL=25;
+ public static final int SALIENCE=10;
+ public static final int AMPERSAND=20;
+ public static final int INT=11;
+ public static final int MULTI_LINE_COMMENT=41;
+ public static final int COLON=22;
+ public static final int WS=28;
+ public static final int UnicodeEscape=32;
+ public static final int LEFT_CURLY=39;
+ public static final int OR=13;
+ public static final int TEST=16;
public static final int LEFT_PAREN=4;
- public static final int DECLARE=28;
- public static final int PIPE=18;
- public static final int VAR=16;
- public static final int EXISTS=14;
- public static final int LEFT_SQUARE=36;
- public static final int OctalEscape=32;
- public static final int EscapeSequence=29;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=35;
- public static final int STRING=8;
+ public static final int DECLARE=29;
+ public static final int LEFT_SQUARE=37;
+ public static final int EscapeSequence=30;
+ public static final int OctalEscape=33;
+ public static final int C_STYLE_SINGLE_LINE_COMMENT=36;
+ public static final int STRING=9;
public CLPMVELParser(TokenStream input) {
super(input);
@@ -82,14 +83,10 @@
private String source = "unknown";
private int lineOffset = 0;
private DescrFactory factory = new DescrFactory();
+ private MVELBuildContext context;
private boolean parserDebug = false;
- private FunctionRegistry functionRegistry;
private Location location = new Location( Location.LOCATION_UNKNOWN );
- public void setFunctionRegistry(FunctionRegistry functionRegistry) {
- this.functionRegistry = functionRegistry;
- }
-
public void setParserDebug(boolean parserDebug) {
this.parserDebug = parserDebug;
}
@@ -229,42 +226,158 @@
- // $ANTLR start eval_script
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:228:1: eval_script[Shell shell] : ;
- public final void eval_script(Shell shell) throws RecognitionException {
+ // $ANTLR start eval
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:224:1: eval[ParserHandler handler, MVELBuildContext context] : (i= importDescr | f= deffunction | r= defrule | form= lisp_form ) ;
+ public final void eval(ParserHandler handler, MVELBuildContext context) throws RecognitionException {
+ ImportDescr i = null;
+
+ FunctionDescr f = null;
+
+ RuleDescr r = null;
+
+ LispForm form = null;
+
+
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:229:2: ()
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:234:2:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:225:2: ( (i= importDescr | f= deffunction | r= defrule | form= lisp_form ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:226:2: (i= importDescr | f= deffunction | r= defrule | form= lisp_form )
{
+ if ( backtracking==0 ) {
+ this.context = context;
}
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:227:2: (i= importDescr | f= deffunction | r= defrule | form= lisp_form )
+ int alt1=4;
+ int LA1_0 = input.LA(1);
+ if ( (LA1_0==LEFT_PAREN) ) {
+ switch ( input.LA(2) ) {
+ case DEFFUNCTION:
+ {
+ alt1=2;
+ }
+ break;
+ case 44:
+ {
+ alt1=1;
+ }
+ break;
+ case DEFRULE:
+ {
+ alt1=3;
+ }
+ break;
+ case NAME:
+ case VAR:
+ {
+ alt1=4;
+ }
+ break;
+ default:
+ if (backtracking>0) {failed=true; return ;}
+ NoViableAltException nvae =
+ new NoViableAltException("227:2: (i= importDescr | f= deffunction | r= defrule | form= lisp_form )", 1, 1, input);
+
+ throw nvae;
+ }
+
+ }
+ else {
+ if (backtracking>0) {failed=true; return ;}
+ NoViableAltException nvae =
+ new NoViableAltException("227:2: (i= importDescr | f= deffunction | r= defrule | form= lisp_form )", 1, 0, input);
+
+ throw nvae;
+ }
+ switch (alt1) {
+ case 1 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:227:7: i= importDescr
+ {
+ pushFollow(FOLLOW_importDescr_in_eval60);
+ i=importDescr();
+ _fsp--;
+ if (failed) return ;
+ if ( backtracking==0 ) {
+ handler.importHandler( i );
+ }
+
+ }
+ break;
+ case 2 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:228:7: f= deffunction
+ {
+ pushFollow(FOLLOW_deffunction_in_eval71);
+ f=deffunction();
+ _fsp--;
+ if (failed) return ;
+ if ( backtracking==0 ) {
+ handler.functionHandler( f );
+ }
+
+ }
+ break;
+ case 3 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:229:7: r= defrule
+ {
+ pushFollow(FOLLOW_defrule_in_eval84);
+ r=defrule();
+ _fsp--;
+ if (failed) return ;
+ if ( backtracking==0 ) {
+ handler.ruleHandler( r );
+ }
+
+ }
+ break;
+ case 4 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:230:7: form= lisp_form
+ {
+ pushFollow(FOLLOW_lisp_form_in_eval96);
+ form=lisp_form();
+ _fsp--;
+ if (failed) return ;
+ if ( backtracking==0 ) {
+ handler.lispFormHandler( form );
+ }
+
+ }
+ break;
+
+ }
+
+
+ }
+
}
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ }
finally {
}
return ;
}
- // $ANTLR end eval_script
+ // $ANTLR end eval
// $ANTLR start importDescr
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:236:1: importDescr returns [ImportDescr importDescr] : LEFT_PAREN 'import' importName= NAME RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:247:1: importDescr returns [ImportDescr importDescr] : LEFT_PAREN 'import' importName= NAME RIGHT_PAREN ;
public final ImportDescr importDescr() throws RecognitionException {
ImportDescr importDescr = null;
Token importName=null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:237:2: ( LEFT_PAREN 'import' importName= NAME RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:237:4: LEFT_PAREN 'import' importName= NAME RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:248:2: ( LEFT_PAREN 'import' importName= NAME RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:248:4: LEFT_PAREN 'import' importName= NAME RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_importDescr63); if (failed) return importDescr;
- match(input,43,FOLLOW_43_in_importDescr65); if (failed) return importDescr;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_importDescr123); if (failed) return importDescr;
+ match(input,44,FOLLOW_44_in_importDescr125); if (failed) return importDescr;
importName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_importDescr69); if (failed) return importDescr;
+ match(input,NAME,FOLLOW_NAME_in_importDescr129); if (failed) return importDescr;
if ( backtracking==0 ) {
importDescr = new ImportDescr( importName.getText() );
}
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_importDescr72); if (failed) return importDescr;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_importDescr133); if (failed) return importDescr;
}
@@ -280,15 +393,103 @@
// $ANTLR end importDescr
+ // $ANTLR start deffunction
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:296:1: deffunction returns [FunctionDescr functionDescr] : LEFT_PAREN t= DEFFUNCTION name= lisp_atom params= lisp_form (form= lisp_form )+ RIGHT_PAREN ;
+ public final FunctionDescr deffunction() throws RecognitionException {
+ FunctionDescr functionDescr = null;
+
+ Token t=null;
+ SExpression name = null;
+
+ LispForm params = null;
+
+ LispForm form = null;
+
+
+
+ List content = null;
+ functionDescr = null;
+
+ try {
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:301:2: ( LEFT_PAREN t= DEFFUNCTION name= lisp_atom params= lisp_form (form= lisp_form )+ RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:301:4: LEFT_PAREN t= DEFFUNCTION name= lisp_atom params= lisp_form (form= lisp_form )+ RIGHT_PAREN
+ {
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_deffunction168); if (failed) return functionDescr;
+ t=(Token)input.LT(1);
+ match(input,DEFFUNCTION,FOLLOW_DEFFUNCTION_in_deffunction178); if (failed) return functionDescr;
+ pushFollow(FOLLOW_lisp_atom_in_deffunction188);
+ name=lisp_atom();
+ _fsp--;
+ if (failed) return functionDescr;
+ pushFollow(FOLLOW_lisp_form_in_deffunction198);
+ params=lisp_form();
+ _fsp--;
+ if (failed) return functionDescr;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:305:3: (form= lisp_form )+
+ int cnt2=0;
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==LEFT_PAREN) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:305:4: form= lisp_form
+ {
+ pushFollow(FOLLOW_lisp_form_in_deffunction207);
+ form=lisp_form();
+ _fsp--;
+ if (failed) return functionDescr;
+ if ( backtracking==0 ) {
+ if ( content == null ) content = new ArrayList(); content.add( form );
+ }
+
+ }
+ break;
+
+ default :
+ if ( cnt2 >= 1 ) break loop2;
+ if (backtracking>0) {failed=true; return functionDescr;}
+ EarlyExitException eee =
+ new EarlyExitException(2, input);
+ throw eee;
+ }
+ cnt2++;
+ } while (true);
+
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_deffunction229); if (failed) return functionDescr;
+ if ( backtracking==0 ) {
+ functionDescr = FunctionHandlers.createFunctionDescr( name, params, content );
+ }
+
+ }
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ }
+ finally {
+ }
+ return functionDescr;
+ }
+ // $ANTLR end deffunction
+
+
// $ANTLR start defrule
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:284:1: defrule returns [RuleDescr rule] : loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_list RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:311:1: defrule returns [RuleDescr rule] : loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_form RIGHT_PAREN ;
public final RuleDescr defrule() throws RecognitionException {
RuleDescr rule = null;
Token loc=null;
Token ruleName=null;
Token documentation=null;
- SExpression t = null;
+ LispForm t = null;
@@ -299,14 +500,14 @@
Set declarations = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:292:2: (loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_list RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:292:4: loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_list RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:319:2: (loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_form RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:319:4: loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' t= lisp_form RIGHT_PAREN
{
loc=(Token)input.LT(1);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_defrule106); if (failed) return rule;
- match(input,DEFRULE,FOLLOW_DEFRULE_in_defrule114); if (failed) return rule;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_defrule266); if (failed) return rule;
+ match(input,DEFRULE,FOLLOW_DEFRULE_in_defrule274); if (failed) return rule;
ruleName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_defrule118); if (failed) return rule;
+ match(input,NAME,FOLLOW_NAME_in_defrule278); if (failed) return rule;
if ( backtracking==0 ) {
debug( "start rule: " + ruleName.getText() );
@@ -341,32 +542,32 @@
}
documentation=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_defrule130); if (failed) return rule;
+ match(input,STRING,FOLLOW_STRING_in_defrule290); if (failed) return rule;
if ( backtracking==0 ) {
// do nothing here for now
}
- pushFollow(FOLLOW_ruleAttribute_in_defrule136);
+ pushFollow(FOLLOW_ruleAttribute_in_defrule296);
ruleAttribute(rule);
_fsp--;
if (failed) return rule;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:331:3: ( ce[lhs, declarations] )*
- loop1:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:358:3: ( ce[lhs, declarations] )*
+ loop3:
do {
- int alt1=2;
- int LA1_0 = input.LA(1);
+ int alt3=2;
+ int LA3_0 = input.LA(1);
- if ( (LA1_0==LEFT_PAREN||LA1_0==VAR) ) {
- alt1=1;
+ if ( (LA3_0==LEFT_PAREN||LA3_0==VAR) ) {
+ alt3=1;
}
- switch (alt1) {
+ switch (alt3) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:331:3: ce[lhs, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:358:3: ce[lhs, declarations]
{
- pushFollow(FOLLOW_ce_in_defrule144);
+ pushFollow(FOLLOW_ce_in_defrule304);
ce(lhs, declarations);
_fsp--;
if (failed) return rule;
@@ -375,19 +576,19 @@
break;
default :
- break loop1;
+ break loop3;
}
} while (true);
- match(input,44,FOLLOW_44_in_defrule153); if (failed) return rule;
- pushFollow(FOLLOW_lisp_list_in_defrule162);
- t=lisp_list();
+ match(input,45,FOLLOW_45_in_defrule313); if (failed) return rule;
+ pushFollow(FOLLOW_lisp_form_in_defrule322);
+ t=lisp_form();
_fsp--;
if (failed) return rule;
if ( backtracking==0 ) {
rule.setConsequence( t );
}
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_defrule171); if (failed) return rule;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_defrule331); if (failed) return rule;
}
@@ -404,59 +605,59 @@
// $ANTLR start ruleAttribute
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:341:1: ruleAttribute[RuleDescr rule] : ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:368:1: ruleAttribute[RuleDescr rule] : ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? ;
public final void ruleAttribute(RuleDescr rule) throws RecognitionException {
AttributeDescr d = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:342:2: ( ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:343:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:369:2: ( ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:370:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:343:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
- int alt3=2;
- int LA3_0 = input.LA(1);
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:370:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
- if ( (LA3_0==LEFT_PAREN) ) {
- int LA3_1 = input.LA(2);
+ if ( (LA5_0==LEFT_PAREN) ) {
+ int LA5_1 = input.LA(2);
- if ( (LA3_1==DECLARE) ) {
- alt3=1;
+ if ( (LA5_1==DECLARE) ) {
+ alt5=1;
}
}
- switch (alt3) {
+ switch (alt5) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:343:5: LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:370:5: LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute188); if (failed) return ;
- match(input,DECLARE,FOLLOW_DECLARE_in_ruleAttribute190); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:344:4: ( LEFT_PAREN d= salience RIGHT_PAREN )?
- int alt2=2;
- int LA2_0 = input.LA(1);
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute348); if (failed) return ;
+ match(input,DECLARE,FOLLOW_DECLARE_in_ruleAttribute350); if (failed) return ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:371:4: ( LEFT_PAREN d= salience RIGHT_PAREN )?
+ int alt4=2;
+ int LA4_0 = input.LA(1);
- if ( (LA2_0==LEFT_PAREN) ) {
- alt2=1;
+ if ( (LA4_0==LEFT_PAREN) ) {
+ alt4=1;
}
- switch (alt2) {
+ switch (alt4) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:344:6: LEFT_PAREN d= salience RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:371:6: LEFT_PAREN d= salience RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute197); if (failed) return ;
- pushFollow(FOLLOW_salience_in_ruleAttribute201);
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute357); if (failed) return ;
+ pushFollow(FOLLOW_salience_in_ruleAttribute361);
d=salience();
_fsp--;
if (failed) return ;
if ( backtracking==0 ) {
rule.addAttribute( d );
}
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute205); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute365); if (failed) return ;
}
break;
}
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute212); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute372); if (failed) return ;
}
break;
@@ -479,7 +680,7 @@
// $ANTLR start salience
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:348:1: salience returns [AttributeDescr d ] : loc= SALIENCE i= INT ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:375:1: salience returns [AttributeDescr d ] : loc= SALIENCE i= INT ;
public final AttributeDescr salience() throws RecognitionException {
AttributeDescr d = null;
@@ -490,13 +691,13 @@
d = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:352:2: (loc= SALIENCE i= INT )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:353:3: loc= SALIENCE i= INT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:379:2: (loc= SALIENCE i= INT )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:380:3: loc= SALIENCE i= INT
{
loc=(Token)input.LT(1);
- match(input,SALIENCE,FOLLOW_SALIENCE_in_salience242); if (failed) return d;
+ match(input,SALIENCE,FOLLOW_SALIENCE_in_salience402); if (failed) return d;
i=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_salience246); if (failed) return d;
+ match(input,INT,FOLLOW_INT_in_salience406); if (failed) return d;
if ( backtracking==0 ) {
d = new AttributeDescr( "salience", i.getText() );
@@ -521,72 +722,72 @@
// $ANTLR start ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:363:1: ce[ConditionalElementDescr in_ce, Set declarations] : ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:390:1: ce[ConditionalElementDescr in_ce, Set declarations] : ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) ;
public final void ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:364:2: ( ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:364:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:2: ( ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:364:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
- int alt4=7;
- int LA4_0 = input.LA(1);
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
+ int alt6=7;
+ int LA6_0 = input.LA(1);
- if ( (LA4_0==LEFT_PAREN) ) {
+ if ( (LA6_0==LEFT_PAREN) ) {
switch ( input.LA(2) ) {
case NOT:
{
- alt4=3;
+ alt6=3;
}
break;
- case OR:
+ case EXISTS:
{
- alt4=2;
+ alt6=4;
}
break;
- case TEST:
+ case OR:
{
- alt4=5;
+ alt6=2;
}
break;
- case NAME:
+ case AND:
{
- alt4=6;
+ alt6=1;
}
break;
- case EXISTS:
+ case NAME:
{
- alt4=4;
+ alt6=6;
}
break;
- case AND:
+ case TEST:
{
- alt4=1;
+ alt6=5;
}
break;
default:
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("364:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 4, 1, input);
+ new NoViableAltException("391:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 6, 1, input);
throw nvae;
}
}
- else if ( (LA4_0==VAR) ) {
- alt4=7;
+ else if ( (LA6_0==VAR) ) {
+ alt6=7;
}
else {
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("364:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 4, 0, input);
+ new NoViableAltException("391:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 6, 0, input);
throw nvae;
}
- switch (alt4) {
+ switch (alt6) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:364:8: and_ce[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:8: and_ce[in_ce, declarations]
{
- pushFollow(FOLLOW_and_ce_in_ce272);
+ pushFollow(FOLLOW_and_ce_in_ce432);
and_ce(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -594,9 +795,9 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:365:7: or_ce[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:392:7: or_ce[in_ce, declarations]
{
- pushFollow(FOLLOW_or_ce_in_ce282);
+ pushFollow(FOLLOW_or_ce_in_ce442);
or_ce(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -604,9 +805,9 @@
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:366:7: not_ce[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:393:7: not_ce[in_ce, declarations]
{
- pushFollow(FOLLOW_not_ce_in_ce291);
+ pushFollow(FOLLOW_not_ce_in_ce451);
not_ce(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -614,9 +815,9 @@
}
break;
case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:367:7: exists_ce[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:394:7: exists_ce[in_ce, declarations]
{
- pushFollow(FOLLOW_exists_ce_in_ce300);
+ pushFollow(FOLLOW_exists_ce_in_ce460);
exists_ce(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -624,9 +825,9 @@
}
break;
case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:368:8: eval_ce[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:395:8: eval_ce[in_ce, declarations]
{
- pushFollow(FOLLOW_eval_ce_in_ce314);
+ pushFollow(FOLLOW_eval_ce_in_ce474);
eval_ce(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -634,9 +835,9 @@
}
break;
case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:369:7: normal_pattern[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:396:7: normal_pattern[in_ce, declarations]
{
- pushFollow(FOLLOW_normal_pattern_in_ce328);
+ pushFollow(FOLLOW_normal_pattern_in_ce488);
normal_pattern(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -644,9 +845,9 @@
}
break;
case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:370:7: bound_pattern[in_ce, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:397:7: bound_pattern[in_ce, declarations]
{
- pushFollow(FOLLOW_bound_pattern_in_ce337);
+ pushFollow(FOLLOW_bound_pattern_in_ce497);
bound_pattern(in_ce, declarations);
_fsp--;
if (failed) return ;
@@ -672,40 +873,40 @@
// $ANTLR start and_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:374:1: and_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:401:1: and_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN ;
public final void and_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
AndDescr andDescr= null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:378:2: ( LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:378:4: LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:405:2: ( LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:405:4: LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_and_ce364); if (failed) return ;
- match(input,AND,FOLLOW_AND_in_and_ce369); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_and_ce524); if (failed) return ;
+ match(input,AND,FOLLOW_AND_in_and_ce529); if (failed) return ;
if ( backtracking==0 ) {
andDescr = new AndDescr();
in_ce.addDescr( andDescr );
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:383:3: ( ce[andDescr, declarations] )+
- int cnt5=0;
- loop5:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:410:3: ( ce[andDescr, declarations] )+
+ int cnt7=0;
+ loop7:
do {
- int alt5=2;
- int LA5_0 = input.LA(1);
+ int alt7=2;
+ int LA7_0 = input.LA(1);
- if ( (LA5_0==LEFT_PAREN||LA5_0==VAR) ) {
- alt5=1;
+ if ( (LA7_0==LEFT_PAREN||LA7_0==VAR) ) {
+ alt7=1;
}
- switch (alt5) {
+ switch (alt7) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:383:3: ce[andDescr, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:410:3: ce[andDescr, declarations]
{
- pushFollow(FOLLOW_ce_in_and_ce375);
+ pushFollow(FOLLOW_ce_in_and_ce535);
ce(andDescr, declarations);
_fsp--;
if (failed) return ;
@@ -714,16 +915,16 @@
break;
default :
- if ( cnt5 >= 1 ) break loop5;
+ if ( cnt7 >= 1 ) break loop7;
if (backtracking>0) {failed=true; return ;}
EarlyExitException eee =
- new EarlyExitException(5, input);
+ new EarlyExitException(7, input);
throw eee;
}
- cnt5++;
+ cnt7++;
} while (true);
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_and_ce384); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_and_ce544); if (failed) return ;
}
@@ -740,40 +941,40 @@
// $ANTLR start or_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:387:1: or_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:414:1: or_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN ;
public final void or_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
OrDescr orDescr= null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:2: ( LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:391:4: LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:418:2: ( LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:418:4: LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_or_ce412); if (failed) return ;
- match(input,OR,FOLLOW_OR_in_or_ce417); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_or_ce572); if (failed) return ;
+ match(input,OR,FOLLOW_OR_in_or_ce577); if (failed) return ;
if ( backtracking==0 ) {
orDescr = new OrDescr();
in_ce.addDescr( orDescr );
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:396:3: ( ce[orDescr, declarations] )+
- int cnt6=0;
- loop6:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:423:3: ( ce[orDescr, declarations] )+
+ int cnt8=0;
+ loop8:
do {
- int alt6=2;
- int LA6_0 = input.LA(1);
+ int alt8=2;
+ int LA8_0 = input.LA(1);
- if ( (LA6_0==LEFT_PAREN||LA6_0==VAR) ) {
- alt6=1;
+ if ( (LA8_0==LEFT_PAREN||LA8_0==VAR) ) {
+ alt8=1;
}
- switch (alt6) {
+ switch (alt8) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:396:3: ce[orDescr, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:423:3: ce[orDescr, declarations]
{
- pushFollow(FOLLOW_ce_in_or_ce423);
+ pushFollow(FOLLOW_ce_in_or_ce583);
ce(orDescr, declarations);
_fsp--;
if (failed) return ;
@@ -782,16 +983,16 @@
break;
default :
- if ( cnt6 >= 1 ) break loop6;
+ if ( cnt8 >= 1 ) break loop8;
if (backtracking>0) {failed=true; return ;}
EarlyExitException eee =
- new EarlyExitException(6, input);
+ new EarlyExitException(8, input);
throw eee;
}
- cnt6++;
+ cnt8++;
} while (true);
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_or_ce432); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_or_ce592); if (failed) return ;
}
@@ -808,28 +1009,28 @@
// $ANTLR start not_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:400:1: not_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:427:1: not_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN ;
public final void not_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
NotDescr notDescr= null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:404:2: ( LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:404:4: LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:431:2: ( LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:431:4: LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_not_ce460); if (failed) return ;
- match(input,NOT,FOLLOW_NOT_in_not_ce465); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_not_ce620); if (failed) return ;
+ match(input,NOT,FOLLOW_NOT_in_not_ce625); if (failed) return ;
if ( backtracking==0 ) {
notDescr = new NotDescr();
in_ce.addDescr( notDescr );
}
- pushFollow(FOLLOW_ce_in_not_ce471);
+ pushFollow(FOLLOW_ce_in_not_ce631);
ce(notDescr, declarations);
_fsp--;
if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_not_ce479); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_not_ce639); if (failed) return ;
}
@@ -846,28 +1047,28 @@
// $ANTLR start exists_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:413:1: exists_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:440:1: exists_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN ;
public final void exists_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
ExistsDescr existsDescr= null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:417:2: ( LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:417:4: LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:444:2: ( LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:444:4: LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_exists_ce508); if (failed) return ;
- match(input,EXISTS,FOLLOW_EXISTS_in_exists_ce513); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_exists_ce668); if (failed) return ;
+ match(input,EXISTS,FOLLOW_EXISTS_in_exists_ce673); if (failed) return ;
if ( backtracking==0 ) {
existsDescr = new ExistsDescr();
in_ce.addDescr( existsDescr );
}
- pushFollow(FOLLOW_ce_in_exists_ce519);
+ pushFollow(FOLLOW_ce_in_exists_ce679);
ce(existsDescr, declarations);
_fsp--;
if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_exists_ce527); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_exists_ce687); if (failed) return ;
}
@@ -884,25 +1085,25 @@
// $ANTLR start eval_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:426:1: eval_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN TEST t= lisp_list RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:453:1: eval_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN TEST t= lisp_form RIGHT_PAREN ;
public final void eval_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
- SExpression t = null;
+ LispForm t = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:427:2: ( LEFT_PAREN TEST t= lisp_list RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:427:4: LEFT_PAREN TEST t= lisp_list RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:454:2: ( LEFT_PAREN TEST t= lisp_form RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:454:4: LEFT_PAREN TEST t= lisp_form RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_eval_ce546); if (failed) return ;
- match(input,TEST,FOLLOW_TEST_in_eval_ce551); if (failed) return ;
- pushFollow(FOLLOW_lisp_list_in_eval_ce558);
- t=lisp_list();
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_eval_ce706); if (failed) return ;
+ match(input,TEST,FOLLOW_TEST_in_eval_ce711); if (failed) return ;
+ pushFollow(FOLLOW_lisp_form_in_eval_ce718);
+ t=lisp_form();
_fsp--;
if (failed) return ;
if ( backtracking==0 ) {
EvalDescr evalDescr = new EvalDescr(); evalDescr.setContent( t ); in_ce.addDescr( evalDescr );
}
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_eval_ce568); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_eval_ce728); if (failed) return ;
}
@@ -919,7 +1120,7 @@
// $ANTLR start normal_pattern
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:433:1: normal_pattern[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:460:1: normal_pattern[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
public final void normal_pattern(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
Token name=null;
@@ -928,12 +1129,12 @@
ConditionalElementDescr top = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:438:2: ( LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:438:4: LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:465:2: ( LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:465:4: LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_normal_pattern596); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_normal_pattern756); if (failed) return ;
name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_normal_pattern603); if (failed) return ;
+ match(input,NAME,FOLLOW_NAME_in_normal_pattern763); if (failed) return ;
if ( backtracking==0 ) {
pattern = new PatternDescr(name.getText());
@@ -942,22 +1143,22 @@
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:445:3: ( field_constriant[top, declarations] )*
- loop7:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:472:3: ( field_constriant[top, declarations] )*
+ loop9:
do {
- int alt7=2;
- int LA7_0 = input.LA(1);
+ int alt9=2;
+ int LA9_0 = input.LA(1);
- if ( (LA7_0==LEFT_PAREN) ) {
- alt7=1;
+ if ( (LA9_0==LEFT_PAREN) ) {
+ alt9=1;
}
- switch (alt7) {
+ switch (alt9) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:445:3: field_constriant[top, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:472:3: field_constriant[top, declarations]
{
- pushFollow(FOLLOW_field_constriant_in_normal_pattern609);
+ pushFollow(FOLLOW_field_constriant_in_normal_pattern769);
field_constriant(top, declarations);
_fsp--;
if (failed) return ;
@@ -966,11 +1167,11 @@
break;
default :
- break loop7;
+ break loop9;
}
} while (true);
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_normal_pattern619); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_normal_pattern779); if (failed) return ;
}
@@ -987,7 +1188,7 @@
// $ANTLR start bound_pattern
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:451:1: bound_pattern[ConditionalElementDescr in_ce, Set declarations] : var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:478:1: bound_pattern[ConditionalElementDescr in_ce, Set declarations] : var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
public final void bound_pattern(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
Token var=null;
Token name=null;
@@ -998,20 +1199,20 @@
ConditionalElementDescr top = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:457:2: (var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:457:4: var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:484:2: (var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:484:4: var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
{
var=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_bound_pattern647); if (failed) return ;
+ match(input,VAR,FOLLOW_VAR_in_bound_pattern807); if (failed) return ;
if ( backtracking==0 ) {
identifier = var.getText();
}
- match(input,ASSIGN_OP,FOLLOW_ASSIGN_OP_in_bound_pattern653); if (failed) return ;
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_bound_pattern655); if (failed) return ;
+ match(input,ASSIGN_OP,FOLLOW_ASSIGN_OP_in_bound_pattern813); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_bound_pattern815); if (failed) return ;
name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_bound_pattern659); if (failed) return ;
+ match(input,NAME,FOLLOW_NAME_in_bound_pattern819); if (failed) return ;
if ( backtracking==0 ) {
pattern = new PatternDescr(name.getText());
@@ -1020,22 +1221,22 @@
top = pattern.getConstraint();
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:467:3: ( field_constriant[top, declarations] )*
- loop8:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:494:3: ( field_constriant[top, declarations] )*
+ loop10:
do {
- int alt8=2;
- int LA8_0 = input.LA(1);
+ int alt10=2;
+ int LA10_0 = input.LA(1);
- if ( (LA8_0==LEFT_PAREN) ) {
- alt8=1;
+ if ( (LA10_0==LEFT_PAREN) ) {
+ alt10=1;
}
- switch (alt8) {
+ switch (alt10) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:467:3: field_constriant[top, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:494:3: field_constriant[top, declarations]
{
- pushFollow(FOLLOW_field_constriant_in_bound_pattern668);
+ pushFollow(FOLLOW_field_constriant_in_bound_pattern828);
field_constriant(top, declarations);
_fsp--;
if (failed) return ;
@@ -1044,11 +1245,11 @@
break;
default :
- break loop8;
+ break loop10;
}
} while (true);
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_bound_pattern675); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_bound_pattern835); if (failed) return ;
}
@@ -1065,7 +1266,7 @@
// $ANTLR start field_constriant
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:471:1: field_constriant[ConditionalElementDescr base, Set declarations] : LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:498:1: field_constriant[ConditionalElementDescr base, Set declarations] : LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN ;
public final void field_constriant(ConditionalElementDescr base, Set declarations) throws RecognitionException {
Token f=null;
@@ -1077,12 +1278,12 @@
String op = "==";
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:479:2: ( LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:480:3: LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:506:2: ( LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:507:3: LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_field_constriant706); if (failed) return ;
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_field_constriant866); if (failed) return ;
f=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_field_constriant710); if (failed) return ;
+ match(input,NAME,FOLLOW_NAME_in_field_constriant870); if (failed) return ;
if ( backtracking==0 ) {
fc = new FieldConstraintDescr(f.getText());
@@ -1092,11 +1293,11 @@
top = fc.getRestriction();
}
- pushFollow(FOLLOW_or_restr_connective_in_field_constriant725);
+ pushFollow(FOLLOW_or_restr_connective_in_field_constriant885);
or_restr_connective(top, base, fc, declarations);
_fsp--;
if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_field_constriant731); if (failed) return ;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_field_constriant891); if (failed) return ;
}
@@ -1113,41 +1314,41 @@
// $ANTLR start or_restr_connective
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:507:1: or_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] options {backtrack=true; } : and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:534:1: or_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] options {backtrack=true; } : and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* ;
public final void or_restr_connective(RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
RestrictionConnectiveDescr or = new RestrictionConnectiveDescr(RestrictionConnectiveDescr.OR);
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:514:2: ( and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:515:3: and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:541:2: ( and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:542:3: and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
{
- pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective770);
+ pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective930);
and_restr_connective(or, ceBase, fcBase, declarations);
_fsp--;
if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:516:3: ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
- loop9:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:543:3: ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
+ loop11:
do {
- int alt9=2;
- int LA9_0 = input.LA(1);
+ int alt11=2;
+ int LA11_0 = input.LA(1);
- if ( (LA9_0==PIPE) ) {
- alt9=1;
+ if ( (LA11_0==PIPE) ) {
+ alt11=1;
}
- switch (alt9) {
+ switch (alt11) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:518:6: PIPE and_restr_connective[or, ceBase, fcBase, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:545:6: PIPE and_restr_connective[or, ceBase, fcBase, declarations]
{
- match(input,PIPE,FOLLOW_PIPE_in_or_restr_connective794); if (failed) return ;
+ match(input,PIPE,FOLLOW_PIPE_in_or_restr_connective954); if (failed) return ;
if ( backtracking==0 ) {
location.setType(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
}
- pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective804);
+ pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective964);
and_restr_connective(or, ceBase, fcBase, declarations);
_fsp--;
if (failed) return ;
@@ -1156,7 +1357,7 @@
break;
default :
- break loop9;
+ break loop11;
}
} while (true);
@@ -1183,36 +1384,36 @@
// $ANTLR start and_restr_connective
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:533:1: and_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:560:1: and_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* ;
public final void and_restr_connective(RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
RestrictionConnectiveDescr and = new RestrictionConnectiveDescr(RestrictionConnectiveDescr.AND);
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:537:2: ( restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:538:3: restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:564:2: ( restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:565:3: restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
{
- pushFollow(FOLLOW_restriction_in_and_restr_connective836);
+ pushFollow(FOLLOW_restriction_in_and_restr_connective996);
restriction(and, ceBase, fcBase, declarations);
_fsp--;
if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:539:3: ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
- loop10:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:566:3: ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
+ loop12:
do {
- int alt10=2;
- int LA10_0 = input.LA(1);
+ int alt12=2;
+ int LA12_0 = input.LA(1);
- if ( (LA10_0==AMPERSAND) ) {
- alt10=1;
+ if ( (LA12_0==AMPERSAND) ) {
+ alt12=1;
}
- switch (alt10) {
+ switch (alt12) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:539:5: AMPERSAND restriction[and, ceBase, fcBase, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:566:5: AMPERSAND restriction[and, ceBase, fcBase, declarations]
{
- match(input,AMPERSAND,FOLLOW_AMPERSAND_in_and_restr_connective844); if (failed) return ;
- pushFollow(FOLLOW_restriction_in_and_restr_connective846);
+ match(input,AMPERSAND,FOLLOW_AMPERSAND_in_and_restr_connective1004); if (failed) return ;
+ pushFollow(FOLLOW_restriction_in_and_restr_connective1006);
restriction(and, ceBase, fcBase, declarations);
_fsp--;
if (failed) return ;
@@ -1221,7 +1422,7 @@
break;
default :
- break loop10;
+ break loop12;
}
} while (true);
@@ -1248,7 +1449,7 @@
// $ANTLR start restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:558:1: restriction[RestrictionConnectiveDescr rc, ConditionalElementDescr base, FieldConstraintDescr fcBase, Set declarations ] : ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:585:1: restriction[RestrictionConnectiveDescr rc, ConditionalElementDescr base, FieldConstraintDescr fcBase, Set declarations ] : ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) ;
public final void restriction(RestrictionConnectiveDescr rc, ConditionalElementDescr base, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
String lc = null;
@@ -1257,21 +1458,21 @@
String op = "==";
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:562:2: ( ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:562:4: ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:589:2: ( ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:589:4: ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:562:4: ( TILDE )?
- int alt11=2;
- int LA11_0 = input.LA(1);
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:589:4: ( TILDE )?
+ int alt13=2;
+ int LA13_0 = input.LA(1);
- if ( (LA11_0==TILDE) ) {
- alt11=1;
+ if ( (LA13_0==TILDE) ) {
+ alt13=1;
}
- switch (alt11) {
+ switch (alt13) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:562:5: TILDE
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:589:5: TILDE
{
- match(input,TILDE,FOLLOW_TILDE_in_restriction879); if (failed) return ;
+ match(input,TILDE,FOLLOW_TILDE_in_restriction1039); if (failed) return ;
if ( backtracking==0 ) {
op = "!=";
}
@@ -1281,22 +1482,22 @@
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:563:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
- int alt12=4;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:590:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
+ int alt14=4;
switch ( input.LA(1) ) {
case COLON:
{
- alt12=1;
+ alt14=1;
}
break;
case EQUALS:
{
- alt12=2;
+ alt14=2;
}
break;
case VAR:
{
- alt12=3;
+ alt14=3;
}
break;
case NAME:
@@ -1306,22 +1507,22 @@
case BOOL:
case NULL:
{
- alt12=4;
+ alt14=4;
}
break;
default:
if (backtracking>0) {failed=true; return ;}
NoViableAltException nvae =
- new NoViableAltException("563:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )", 12, 0, input);
+ new NoViableAltException("590:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )", 14, 0, input);
throw nvae;
}
- switch (alt12) {
+ switch (alt14) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:563:5: predicate_constraint[rc, op, base]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:590:5: predicate_constraint[rc, op, base]
{
- pushFollow(FOLLOW_predicate_constraint_in_restriction895);
+ pushFollow(FOLLOW_predicate_constraint_in_restriction1055);
predicate_constraint(rc, op, base);
_fsp--;
if (failed) return ;
@@ -1329,9 +1530,9 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:564:7: return_value_restriction[op, rc]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:591:7: return_value_restriction[op, rc]
{
- pushFollow(FOLLOW_return_value_restriction_in_restriction911);
+ pushFollow(FOLLOW_return_value_restriction_in_restriction1071);
return_value_restriction(op, rc);
_fsp--;
if (failed) return ;
@@ -1339,9 +1540,9 @@
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:565:7: variable_restriction[op, rc, base, fcBase, declarations]
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:592:7: variable_restriction[op, rc, base, fcBase, declarations]
{
- pushFollow(FOLLOW_variable_restriction_in_restriction920);
+ pushFollow(FOLLOW_variable_restriction_in_restriction1080);
variable_restriction(op, rc, base, fcBase, declarations);
_fsp--;
if (failed) return ;
@@ -1349,9 +1550,9 @@
}
break;
case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:566:8: lc= literal_restriction
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:593:8: lc= literal_restriction
{
- pushFollow(FOLLOW_literal_restriction_in_restriction932);
+ pushFollow(FOLLOW_literal_restriction_in_restriction1092);
lc=literal_restriction();
_fsp--;
if (failed) return ;
@@ -1383,18 +1584,18 @@
// $ANTLR start predicate_constraint
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:573:1: predicate_constraint[RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base] : COLON t= lisp_list ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:600:1: predicate_constraint[RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base] : COLON t= lisp_form ;
public final void predicate_constraint(RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base) throws RecognitionException {
- SExpression t = null;
+ LispForm t = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:574:2: ( COLON t= lisp_list )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:574:4: COLON t= lisp_list
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:601:2: ( COLON t= lisp_form )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:601:4: COLON t= lisp_form
{
- match(input,COLON,FOLLOW_COLON_in_predicate_constraint965); if (failed) return ;
- pushFollow(FOLLOW_lisp_list_in_predicate_constraint971);
- t=lisp_list();
+ match(input,COLON,FOLLOW_COLON_in_predicate_constraint1125); if (failed) return ;
+ pushFollow(FOLLOW_lisp_form_in_predicate_constraint1131);
+ t=lisp_form();
_fsp--;
if (failed) return ;
if ( backtracking==0 ) {
@@ -1416,18 +1617,18 @@
// $ANTLR start return_value_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:580:1: return_value_restriction[String op, RestrictionConnectiveDescr rc] : EQUALS t= lisp_list ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:607:1: return_value_restriction[String op, RestrictionConnectiveDescr rc] : EQUALS t= lisp_form ;
public final void return_value_restriction(String op, RestrictionConnectiveDescr rc) throws RecognitionException {
- SExpression t = null;
+ LispForm t = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:581:2: ( EQUALS t= lisp_list )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:581:4: EQUALS t= lisp_list
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:608:2: ( EQUALS t= lisp_form )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:608:4: EQUALS t= lisp_form
{
- match(input,EQUALS,FOLLOW_EQUALS_in_return_value_restriction990); if (failed) return ;
- pushFollow(FOLLOW_lisp_list_in_return_value_restriction997);
- t=lisp_list();
+ match(input,EQUALS,FOLLOW_EQUALS_in_return_value_restriction1150); if (failed) return ;
+ pushFollow(FOLLOW_lisp_form_in_return_value_restriction1157);
+ t=lisp_form();
_fsp--;
if (failed) return ;
if ( backtracking==0 ) {
@@ -1449,16 +1650,16 @@
// $ANTLR start variable_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:586:1: variable_restriction[String op, RestrictionConnectiveDescr rc, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : VAR ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:613:1: variable_restriction[String op, RestrictionConnectiveDescr rc, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : VAR ;
public final void variable_restriction(String op, RestrictionConnectiveDescr rc, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
Token VAR1=null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:587:2: ( VAR )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:587:4: VAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:614:2: ( VAR )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:614:4: VAR
{
VAR1=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_variable_restriction1016); if (failed) return ;
+ match(input,VAR,FOLLOW_VAR_in_variable_restriction1176); if (failed) return ;
if ( backtracking==0 ) {
if ( declarations.contains( VAR1.getText() ) ) {
@@ -1488,7 +1689,7 @@
// $ANTLR start literal_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:601:1: literal_restriction returns [String text] : t= literal ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:628:1: literal_restriction returns [String text] : t= literal ;
public final String literal_restriction() throws RecognitionException {
String text = null;
@@ -1499,10 +1700,10 @@
text = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:605:2: (t= literal )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:606:6: t= literal
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:632:2: (t= literal )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:633:6: t= literal
{
- pushFollow(FOLLOW_literal_in_literal_restriction1049);
+ pushFollow(FOLLOW_literal_in_literal_restriction1209);
t=literal();
_fsp--;
if (failed) return text;
@@ -1526,108 +1727,49 @@
// $ANTLR end literal_restriction
- // $ANTLR start eval_sExpressions
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:612:1: eval_sExpressions returns [List<SExpression> list] : (a= lisp_list )* ;
- public final List<SExpression> eval_sExpressions() throws RecognitionException {
- List<SExpression> list = null;
+ // $ANTLR start lisp_form
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:650:1: lisp_form returns [LispForm lispForm] : LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | l= lisp_form )* RIGHT_PAREN ;
+ public final LispForm lisp_form() throws RecognitionException {
+ LispForm lispForm = null;
+ Token t=null;
SExpression a = null;
+ LispForm l = null;
-
- list = new ArrayList<SExpression>();
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:616:2: ( (a= lisp_list )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:617:3: (a= lisp_list )*
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:617:3: (a= lisp_list )*
- loop13:
- do {
- int alt13=2;
- int LA13_0 = input.LA(1);
- if ( (LA13_0==LEFT_PAREN) ) {
- alt13=1;
- }
-
-
- switch (alt13) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:617:4: a= lisp_list
- {
- pushFollow(FOLLOW_lisp_list_in_eval_sExpressions1081);
- a=lisp_list();
- _fsp--;
- if (failed) return list;
- if ( backtracking==0 ) {
- list.add( a );
- }
-
- }
- break;
-
- default :
- break loop13;
- }
- } while (true);
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return list;
- }
- // $ANTLR end eval_sExpressions
-
-
- // $ANTLR start lisp_list
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:621:1: lisp_list returns [SExpression sExpression] : LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | a= lisp_list )* RIGHT_PAREN ;
- public final SExpression lisp_list() throws RecognitionException {
- SExpression sExpression = null;
-
- Token t=null;
- SExpression a = null;
-
-
List list = new ArrayList();
- sExpression = null;
+ lispForm = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:626:2: ( LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | a= lisp_list )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:626:4: LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | a= lisp_list )* RIGHT_PAREN
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:655:2: ( LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | l= lisp_form )* RIGHT_PAREN )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:655:4: LEFT_PAREN (t= NAME | t= VAR ) (a= lisp_atom | l= lisp_form )* RIGHT_PAREN
{
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_lisp_list1110); if (failed) return sExpression;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:628:3: (t= NAME | t= VAR )
- int alt14=2;
- int LA14_0 = input.LA(1);
+ match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_lisp_form1237); if (failed) return lispForm;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:657:3: (t= NAME | t= VAR )
+ int alt15=2;
+ int LA15_0 = input.LA(1);
- if ( (LA14_0==NAME) ) {
- alt14=1;
+ if ( (LA15_0==NAME) ) {
+ alt15=1;
}
- else if ( (LA14_0==VAR) ) {
- alt14=2;
+ else if ( (LA15_0==VAR) ) {
+ alt15=2;
}
else {
- if (backtracking>0) {failed=true; return sExpression;}
+ if (backtracking>0) {failed=true; return lispForm;}
NoViableAltException nvae =
- new NoViableAltException("628:3: (t= NAME | t= VAR )", 14, 0, input);
+ new NoViableAltException("657:3: (t= NAME | t= VAR )", 15, 0, input);
throw nvae;
}
- switch (alt14) {
+ switch (alt15) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:629:7: t= NAME
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:658:7: t= NAME
{
t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_lisp_list1127); if (failed) return sExpression;
+ match(input,NAME,FOLLOW_NAME_in_lisp_form1254); if (failed) return lispForm;
if ( backtracking==0 ) {
list.add( new SymbolLispAtom( t.getText() ) );
}
@@ -1635,12 +1777,12 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:631:7: t= VAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:660:7: t= VAR
{
t=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_lisp_list1147); if (failed) return sExpression;
+ match(input,VAR,FOLLOW_VAR_in_lisp_form1274); if (failed) return lispForm;
if ( backtracking==0 ) {
- list.add( new VariableLispAtom( t.getText() ) );
+ list.add( new VariableLispAtom( t.getText(), context ) );
}
}
@@ -1648,28 +1790,28 @@
}
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:633:3: (a= lisp_atom | a= lisp_list )*
- loop15:
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:662:3: (a= lisp_atom | l= lisp_form )*
+ loop16:
do {
- int alt15=3;
- int LA15_0 = input.LA(1);
+ int alt16=3;
+ int LA16_0 = input.LA(1);
- if ( (LA15_0==NAME||LA15_0==STRING||LA15_0==INT||LA15_0==VAR||(LA15_0>=FLOAT && LA15_0<=NULL)) ) {
- alt15=1;
+ if ( (LA16_0==NAME||LA16_0==STRING||LA16_0==INT||LA16_0==VAR||(LA16_0>=FLOAT && LA16_0<=NULL)) ) {
+ alt16=1;
}
- else if ( (LA15_0==LEFT_PAREN) ) {
- alt15=2;
+ else if ( (LA16_0==LEFT_PAREN) ) {
+ alt16=2;
}
- switch (alt15) {
+ switch (alt16) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:633:6: a= lisp_atom
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:662:6: a= lisp_atom
{
- pushFollow(FOLLOW_lisp_atom_in_lisp_list1170);
+ pushFollow(FOLLOW_lisp_atom_in_lisp_form1297);
a=lisp_atom();
_fsp--;
- if (failed) return sExpression;
+ if (failed) return lispForm;
if ( backtracking==0 ) {
list.add( a );
}
@@ -1677,27 +1819,27 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:634:6: a= lisp_list
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:663:6: l= lisp_form
{
- pushFollow(FOLLOW_lisp_list_in_lisp_list1181);
- a=lisp_list();
+ pushFollow(FOLLOW_lisp_form_in_lisp_form1308);
+ l=lisp_form();
_fsp--;
- if (failed) return sExpression;
+ if (failed) return lispForm;
if ( backtracking==0 ) {
- list.add( a );
+ list.add( l );
}
}
break;
default :
- break loop15;
+ break loop16;
}
} while (true);
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_lisp_list1208); if (failed) return sExpression;
+ match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_lisp_form1335); if (failed) return lispForm;
if ( backtracking==0 ) {
- sExpression = new LispForm( ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ) );
+ lispForm = new LispForm( ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ) );
}
}
@@ -1709,13 +1851,13 @@
}
finally {
}
- return sExpression;
+ return lispForm;
}
- // $ANTLR end lisp_list
+ // $ANTLR end lisp_form
// $ANTLR start lisp_atom
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:640:1: lisp_atom returns [SExpression sExpression] : (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME ) ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:669:1: lisp_atom returns [SExpression sExpression] : (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME ) ;
public final SExpression lisp_atom() throws RecognitionException {
SExpression sExpression = null;
@@ -1725,72 +1867,72 @@
sExpression = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:644:2: ( (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:655:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:673:2: ( (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:674:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:655:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )
- int alt16=7;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:674:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )
+ int alt17=7;
switch ( input.LA(1) ) {
case VAR:
{
- alt16=1;
+ alt17=1;
}
break;
case STRING:
{
- alt16=2;
+ alt17=2;
}
break;
case FLOAT:
{
- alt16=3;
+ alt17=3;
}
break;
case INT:
{
- alt16=4;
+ alt17=4;
}
break;
case BOOL:
{
- alt16=5;
+ alt17=5;
}
break;
case NULL:
{
- alt16=6;
+ alt17=6;
}
break;
case NAME:
{
- alt16=7;
+ alt17=7;
}
break;
default:
if (backtracking>0) {failed=true; return sExpression;}
NoViableAltException nvae =
- new NoViableAltException("655:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )", 16, 0, input);
+ new NoViableAltException("674:3: (t= VAR | t= STRING | t= FLOAT | t= INT | t= BOOL | t= NULL | t= NAME )", 17, 0, input);
throw nvae;
}
- switch (alt16) {
+ switch (alt17) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:656:6: t= VAR
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:675:6: t= VAR
{
t=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_lisp_atom1258); if (failed) return sExpression;
+ match(input,VAR,FOLLOW_VAR_in_lisp_atom1379); if (failed) return sExpression;
if ( backtracking==0 ) {
- sExpression = new VariableLispAtom( t.getText() );
+ sExpression = new VariableLispAtom( t.getText(), context );
}
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:657:6: t= STRING
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:676:6: t= STRING
{
t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_lisp_atom1270); if (failed) return sExpression;
+ match(input,STRING,FOLLOW_STRING_in_lisp_atom1391); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new StringLispAtom( getString( t ) );
}
@@ -1798,10 +1940,10 @@
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:658:6: t= FLOAT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:677:6: t= FLOAT
{
t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_lisp_atom1292); if (failed) return sExpression;
+ match(input,FLOAT,FOLLOW_FLOAT_in_lisp_atom1413); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new FloatLispAtom( t.getText() );
}
@@ -1809,10 +1951,10 @@
}
break;
case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:659:6: t= INT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:678:6: t= INT
{
t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_lisp_atom1304); if (failed) return sExpression;
+ match(input,INT,FOLLOW_INT_in_lisp_atom1425); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new IntLispAtom( t.getText() );
}
@@ -1820,10 +1962,10 @@
}
break;
case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:660:7: t= BOOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:679:7: t= BOOL
{
t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_lisp_atom1317); if (failed) return sExpression;
+ match(input,BOOL,FOLLOW_BOOL_in_lisp_atom1438); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new BoolLispAtom( t.getText() );
}
@@ -1831,10 +1973,10 @@
}
break;
case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:661:7: t= NULL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:680:7: t= NULL
{
t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_lisp_atom1333); if (failed) return sExpression;
+ match(input,NULL,FOLLOW_NULL_in_lisp_atom1454); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new NullLispAtom( null );
}
@@ -1842,10 +1984,10 @@
}
break;
case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:662:14: t= NAME
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:681:14: t= NAME
{
t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_lisp_atom1359); if (failed) return sExpression;
+ match(input,NAME,FOLLOW_NAME_in_lisp_atom1480); if (failed) return sExpression;
if ( backtracking==0 ) {
sExpression = new SymbolLispAtom( "\"" +t.getText() + "\"");
}
@@ -1871,7 +2013,7 @@
// $ANTLR start literal
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:667:1: literal returns [String text] : (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) ;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:686:1: literal returns [String text] : (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) ;
public final String literal() throws RecognitionException {
String text = null;
@@ -1881,56 +2023,56 @@
text = null;
try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:671:2: ( (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:671:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:2: ( (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) )
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
{
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:671:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
- int alt17=6;
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
+ int alt18=6;
switch ( input.LA(1) ) {
case STRING:
{
- alt17=1;
+ alt18=1;
}
break;
case NAME:
{
- alt17=2;
+ alt18=2;
}
break;
case INT:
{
- alt17=3;
+ alt18=3;
}
break;
case FLOAT:
{
- alt17=4;
+ alt18=4;
}
break;
case BOOL:
{
- alt17=5;
+ alt18=5;
}
break;
case NULL:
{
- alt17=6;
+ alt18=6;
}
break;
default:
if (backtracking>0) {failed=true; return text;}
NoViableAltException nvae =
- new NoViableAltException("671:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )", 17, 0, input);
+ new NoViableAltException("690:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )", 18, 0, input);
throw nvae;
}
- switch (alt17) {
+ switch (alt18) {
case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:671:8: t= STRING
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:690:8: t= STRING
{
t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_literal1403); if (failed) return text;
+ match(input,STRING,FOLLOW_STRING_in_literal1524); if (failed) return text;
if ( backtracking==0 ) {
text = getString( t );
}
@@ -1938,10 +2080,10 @@
}
break;
case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:672:7: t= NAME
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:691:7: t= NAME
{
t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_literal1416); if (failed) return text;
+ match(input,NAME,FOLLOW_NAME_in_literal1537); if (failed) return text;
if ( backtracking==0 ) {
text = t.getText();
}
@@ -1949,10 +2091,10 @@
}
break;
case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:673:7: t= INT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:692:7: t= INT
{
t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_literal1432); if (failed) return text;
+ match(input,INT,FOLLOW_INT_in_literal1553); if (failed) return text;
if ( backtracking==0 ) {
text = t.getText();
}
@@ -1960,10 +2102,10 @@
}
break;
case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:674:7: t= FLOAT
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:693:7: t= FLOAT
{
t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_literal1447); if (failed) return text;
+ match(input,FLOAT,FOLLOW_FLOAT_in_literal1568); if (failed) return text;
if ( backtracking==0 ) {
text = t.getText();
}
@@ -1971,10 +2113,10 @@
}
break;
case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:675:7: t= BOOL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:694:7: t= BOOL
{
t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_literal1460); if (failed) return text;
+ match(input,BOOL,FOLLOW_BOOL_in_literal1581); if (failed) return text;
if ( backtracking==0 ) {
text = t.getText();
}
@@ -1982,10 +2124,10 @@
}
break;
case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:676:7: t= NULL
+ // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLPMVEL.g:695:7: t= NULL
{
t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_literal1474); if (failed) return text;
+ match(input,NULL,FOLLOW_NULL_in_literal1595); if (failed) return text;
if ( backtracking==0 ) {
text = null;
}
@@ -2012,104 +2154,113 @@
- public static final BitSet FOLLOW_LEFT_PAREN_in_importDescr63 = new BitSet(new long[]{0x0000080000000000L});
- public static final BitSet FOLLOW_43_in_importDescr65 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_importDescr69 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_importDescr72 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_defrule106 = new BitSet(new long[]{0x0000000000000080L});
- public static final BitSet FOLLOW_DEFRULE_in_defrule114 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_defrule118 = new BitSet(new long[]{0x0000000000000100L});
- public static final BitSet FOLLOW_STRING_in_defrule130 = new BitSet(new long[]{0x0000100000010010L});
- public static final BitSet FOLLOW_ruleAttribute_in_defrule136 = new BitSet(new long[]{0x0000100000010010L});
- public static final BitSet FOLLOW_ce_in_defrule144 = new BitSet(new long[]{0x0000100000010010L});
- public static final BitSet FOLLOW_44_in_defrule153 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_defrule162 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_defrule171 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute188 = new BitSet(new long[]{0x0000000010000000L});
- public static final BitSet FOLLOW_DECLARE_in_ruleAttribute190 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute197 = new BitSet(new long[]{0x0000000000000200L});
- public static final BitSet FOLLOW_salience_in_ruleAttribute201 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute205 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute212 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SALIENCE_in_salience242 = new BitSet(new long[]{0x0000000000000400L});
- public static final BitSet FOLLOW_INT_in_salience246 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_and_ce_in_ce272 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_or_ce_in_ce282 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_not_ce_in_ce291 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_exists_ce_in_ce300 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_eval_ce_in_ce314 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_normal_pattern_in_ce328 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_bound_pattern_in_ce337 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_and_ce364 = new BitSet(new long[]{0x0000000000000800L});
- public static final BitSet FOLLOW_AND_in_and_ce369 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_and_ce375 = new BitSet(new long[]{0x0000000000010050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_and_ce384 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_or_ce412 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_OR_in_or_ce417 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_or_ce423 = new BitSet(new long[]{0x0000000000010050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_or_ce432 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_not_ce460 = new BitSet(new long[]{0x0000000000002000L});
- public static final BitSet FOLLOW_NOT_in_not_ce465 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_not_ce471 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_not_ce479 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_exists_ce508 = new BitSet(new long[]{0x0000000000004000L});
- public static final BitSet FOLLOW_EXISTS_in_exists_ce513 = new BitSet(new long[]{0x0000000000010010L});
- public static final BitSet FOLLOW_ce_in_exists_ce519 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_exists_ce527 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_eval_ce546 = new BitSet(new long[]{0x0000000000008000L});
- public static final BitSet FOLLOW_TEST_in_eval_ce551 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_eval_ce558 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_eval_ce568 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_normal_pattern596 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_normal_pattern603 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_field_constriant_in_normal_pattern609 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_normal_pattern619 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_bound_pattern647 = new BitSet(new long[]{0x0000000000020000L});
- public static final BitSet FOLLOW_ASSIGN_OP_in_bound_pattern653 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_bound_pattern655 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_bound_pattern659 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_field_constriant_in_bound_pattern668 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_bound_pattern675 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_field_constriant706 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_field_constriant710 = new BitSet(new long[]{0x0000000003F10520L});
- public static final BitSet FOLLOW_or_restr_connective_in_field_constriant725 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_field_constriant731 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective770 = new BitSet(new long[]{0x0000000000040002L});
- public static final BitSet FOLLOW_PIPE_in_or_restr_connective794 = new BitSet(new long[]{0x0000000003F10520L});
- public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective804 = new BitSet(new long[]{0x0000000000040002L});
- public static final BitSet FOLLOW_restriction_in_and_restr_connective836 = new BitSet(new long[]{0x0000000000080002L});
- public static final BitSet FOLLOW_AMPERSAND_in_and_restr_connective844 = new BitSet(new long[]{0x0000000003F10520L});
- public static final BitSet FOLLOW_restriction_in_and_restr_connective846 = new BitSet(new long[]{0x0000000000080002L});
- public static final BitSet FOLLOW_TILDE_in_restriction879 = new BitSet(new long[]{0x0000000003E10520L});
- public static final BitSet FOLLOW_predicate_constraint_in_restriction895 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_return_value_restriction_in_restriction911 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_variable_restriction_in_restriction920 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_restriction_in_restriction932 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_COLON_in_predicate_constraint965 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_predicate_constraint971 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_EQUALS_in_return_value_restriction990 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_return_value_restriction997 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_variable_restriction1016 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_in_literal_restriction1049 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_lisp_list_in_eval_sExpressions1081 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_lisp_list1110 = new BitSet(new long[]{0x0000000000010020L});
- public static final BitSet FOLLOW_NAME_in_lisp_list1127 = new BitSet(new long[]{0x0000000003810570L});
- public static final BitSet FOLLOW_VAR_in_lisp_list1147 = new BitSet(new long[]{0x0000000003810570L});
- public static final BitSet FOLLOW_lisp_atom_in_lisp_list1170 = new BitSet(new long[]{0x0000000003810570L});
- public static final BitSet FOLLOW_lisp_list_in_lisp_list1181 = new BitSet(new long[]{0x0000000003810570L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_lisp_list1208 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_lisp_atom1258 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_lisp_atom1270 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_lisp_atom1292 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_lisp_atom1304 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_lisp_atom1317 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_lisp_atom1333 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_lisp_atom1359 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_literal1403 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_literal1416 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_literal1432 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_literal1447 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_literal1460 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_literal1474 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_importDescr_in_eval60 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_deffunction_in_eval71 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_defrule_in_eval84 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_lisp_form_in_eval96 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_importDescr123 = new BitSet(new long[]{0x0000100000000000L});
+ public static final BitSet FOLLOW_44_in_importDescr125 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_NAME_in_importDescr129 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_importDescr133 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_deffunction168 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_DEFFUNCTION_in_deffunction178 = new BitSet(new long[]{0x0000000007020A20L});
+ public static final BitSet FOLLOW_lisp_atom_in_deffunction188 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_deffunction198 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_deffunction207 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_deffunction229 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_defrule266 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_DEFRULE_in_defrule274 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_NAME_in_defrule278 = new BitSet(new long[]{0x0000000000000200L});
+ public static final BitSet FOLLOW_STRING_in_defrule290 = new BitSet(new long[]{0x0000200000020010L});
+ public static final BitSet FOLLOW_ruleAttribute_in_defrule296 = new BitSet(new long[]{0x0000200000020010L});
+ public static final BitSet FOLLOW_ce_in_defrule304 = new BitSet(new long[]{0x0000200000020010L});
+ public static final BitSet FOLLOW_45_in_defrule313 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_defrule322 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_defrule331 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute348 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_DECLARE_in_ruleAttribute350 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute357 = new BitSet(new long[]{0x0000000000000400L});
+ public static final BitSet FOLLOW_salience_in_ruleAttribute361 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute365 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute372 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SALIENCE_in_salience402 = new BitSet(new long[]{0x0000000000000800L});
+ public static final BitSet FOLLOW_INT_in_salience406 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_and_ce_in_ce432 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_or_ce_in_ce442 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_not_ce_in_ce451 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_exists_ce_in_ce460 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_eval_ce_in_ce474 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_normal_pattern_in_ce488 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_bound_pattern_in_ce497 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_and_ce524 = new BitSet(new long[]{0x0000000000001000L});
+ public static final BitSet FOLLOW_AND_in_and_ce529 = new BitSet(new long[]{0x0000000000020010L});
+ public static final BitSet FOLLOW_ce_in_and_ce535 = new BitSet(new long[]{0x0000000000020050L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_and_ce544 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_or_ce572 = new BitSet(new long[]{0x0000000000002000L});
+ public static final BitSet FOLLOW_OR_in_or_ce577 = new BitSet(new long[]{0x0000000000020010L});
+ public static final BitSet FOLLOW_ce_in_or_ce583 = new BitSet(new long[]{0x0000000000020050L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_or_ce592 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_not_ce620 = new BitSet(new long[]{0x0000000000004000L});
+ public static final BitSet FOLLOW_NOT_in_not_ce625 = new BitSet(new long[]{0x0000000000020010L});
+ public static final BitSet FOLLOW_ce_in_not_ce631 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_not_ce639 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_exists_ce668 = new BitSet(new long[]{0x0000000000008000L});
+ public static final BitSet FOLLOW_EXISTS_in_exists_ce673 = new BitSet(new long[]{0x0000000000020010L});
+ public static final BitSet FOLLOW_ce_in_exists_ce679 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_exists_ce687 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_eval_ce706 = new BitSet(new long[]{0x0000000000010000L});
+ public static final BitSet FOLLOW_TEST_in_eval_ce711 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_eval_ce718 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_eval_ce728 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_normal_pattern756 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_NAME_in_normal_pattern763 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_field_constriant_in_normal_pattern769 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_normal_pattern779 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_VAR_in_bound_pattern807 = new BitSet(new long[]{0x0000000000040000L});
+ public static final BitSet FOLLOW_ASSIGN_OP_in_bound_pattern813 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_bound_pattern815 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_NAME_in_bound_pattern819 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_field_constriant_in_bound_pattern828 = new BitSet(new long[]{0x0000000000000050L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_bound_pattern835 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_field_constriant866 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_NAME_in_field_constriant870 = new BitSet(new long[]{0x0000000007E20A20L});
+ public static final BitSet FOLLOW_or_restr_connective_in_field_constriant885 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_field_constriant891 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective930 = new BitSet(new long[]{0x0000000000080002L});
+ public static final BitSet FOLLOW_PIPE_in_or_restr_connective954 = new BitSet(new long[]{0x0000000007E20A20L});
+ public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective964 = new BitSet(new long[]{0x0000000000080002L});
+ public static final BitSet FOLLOW_restriction_in_and_restr_connective996 = new BitSet(new long[]{0x0000000000100002L});
+ public static final BitSet FOLLOW_AMPERSAND_in_and_restr_connective1004 = new BitSet(new long[]{0x0000000007E20A20L});
+ public static final BitSet FOLLOW_restriction_in_and_restr_connective1006 = new BitSet(new long[]{0x0000000000100002L});
+ public static final BitSet FOLLOW_TILDE_in_restriction1039 = new BitSet(new long[]{0x0000000007C20A20L});
+ public static final BitSet FOLLOW_predicate_constraint_in_restriction1055 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_return_value_restriction_in_restriction1071 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_variable_restriction_in_restriction1080 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_literal_restriction_in_restriction1092 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_COLON_in_predicate_constraint1125 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_predicate_constraint1131 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_EQUALS_in_return_value_restriction1150 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_lisp_form_in_return_value_restriction1157 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_VAR_in_variable_restriction1176 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_literal_in_literal_restriction1209 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LEFT_PAREN_in_lisp_form1237 = new BitSet(new long[]{0x0000000000020020L});
+ public static final BitSet FOLLOW_NAME_in_lisp_form1254 = new BitSet(new long[]{0x0000000007020A70L});
+ public static final BitSet FOLLOW_VAR_in_lisp_form1274 = new BitSet(new long[]{0x0000000007020A70L});
+ public static final BitSet FOLLOW_lisp_atom_in_lisp_form1297 = new BitSet(new long[]{0x0000000007020A70L});
+ public static final BitSet FOLLOW_lisp_form_in_lisp_form1308 = new BitSet(new long[]{0x0000000007020A70L});
+ public static final BitSet FOLLOW_RIGHT_PAREN_in_lisp_form1335 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_VAR_in_lisp_atom1379 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_lisp_atom1391 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FLOAT_in_lisp_atom1413 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INT_in_lisp_atom1425 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BOOL_in_lisp_atom1438 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NULL_in_lisp_atom1454 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NAME_in_lisp_atom1480 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_literal1524 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NAME_in_literal1537 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INT_in_literal1553 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FLOAT_in_literal1568 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BOOL_in_literal1581 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NULL_in_literal1595 = new BitSet(new long[]{0x0000000000000002L});
}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPParser.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPParser.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPParser.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,2308 +0,0 @@
-// $ANTLR 3.0.1 C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g 2008-01-20 20:25:48
-
- 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.Set;
- import java.util.HashSet;
- import java.util.StringTokenizer;
- import org.drools.lang.descr.*;
- import org.drools.lang.Location;
-
-
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-public class CLPParser extends Parser {
- public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "LEFT_PAREN", "NAME", "RIGHT_PAREN", "DEFFUNCTION", "VAR", "DEFRULE", "STRING", "SALIENCE", "INT", "AND", "OR", "NOT", "EXISTS", "TEST", "ASSIGN_OP", "PIPE", "AMPERSAND", "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", "'import'", "'=>'"
- };
- public static final int RIGHT_SQUARE=38;
- public static final int RIGHT_CURLY=40;
- public static final int SYMBOL=34;
- public static final int NULL=26;
- public static final int BOOL=25;
- public static final int AMPERSAND=20;
- public static final int SALIENCE=11;
- public static final int FLOAT=24;
- public static final int EQUALS=23;
- public static final int INT=12;
- public static final int SH_STYLE_SINGLE_LINE_COMMENT=35;
- public static final int NOT=15;
- public static final int AND=13;
- public static final int EOF=-1;
- public static final int HexDigit=31;
- public static final int MULTI_LINE_COMMENT=41;
- public static final int DEFFUNCTION=7;
- public static final int COLON=22;
- public static final int ASSIGN_OP=18;
- public static final int RIGHT_PAREN=6;
- public static final int NAME=5;
- public static final int WS=28;
- public static final int EOL=27;
- public static final int UnicodeEscape=32;
- public static final int LEFT_CURLY=39;
- public static final int DEFRULE=9;
- public static final int OR=14;
- public static final int TILDE=21;
- public static final int TEST=17;
- public static final int LEFT_PAREN=4;
- public static final int DECLARE=29;
- public static final int PIPE=19;
- public static final int VAR=8;
- public static final int EXISTS=16;
- public static final int LEFT_SQUARE=37;
- public static final int OctalEscape=33;
- public static final int EscapeSequence=30;
- public static final int C_STYLE_SINGLE_LINE_COMMENT=36;
- public static final int STRING=10;
-
- public CLPParser(TokenStream input) {
- super(input);
- ruleMemo = new HashMap[27+1];
- }
-
-
- public String[] getTokenNames() { return tokenNames; }
- public String getGrammarFileName() { return "C:\\dev\\drools\\trunk\\drools-clips\\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;
- private Location location = new Location( Location.LOCATION_UNKNOWN );
-
- 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+ FIXME
- "; 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 eval_script
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:226:1: eval_script[Shell shell] : (i= importDescr | r= defrule | fc= lisp_list[shell, new LispForm(shell) ] )* ;
- public final void eval_script(Shell shell) throws RecognitionException {
- ImportDescr i = null;
-
- RuleDescr r = null;
-
- ValueHandler fc = null;
-
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:227:2: ( (i= importDescr | r= defrule | fc= lisp_list[shell, new LispForm(shell) ] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:227:4: (i= importDescr | r= defrule | fc= lisp_list[shell, new LispForm(shell) ] )*
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:227:4: (i= importDescr | r= defrule | fc= lisp_list[shell, new LispForm(shell) ] )*
- loop1:
- do {
- int alt1=4;
- int LA1_0 = input.LA(1);
-
- if ( (LA1_0==LEFT_PAREN) ) {
- switch ( input.LA(2) ) {
- case DEFRULE:
- {
- alt1=2;
- }
- break;
- case 42:
- {
- alt1=1;
- }
- break;
- case LEFT_PAREN:
- case NAME:
- case RIGHT_PAREN:
- case VAR:
- case STRING:
- case INT:
- case FLOAT:
- case BOOL:
- case NULL:
- {
- alt1=3;
- }
- break;
-
- }
-
- }
-
-
- switch (alt1) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:227:9: i= importDescr
- {
- pushFollow(FOLLOW_importDescr_in_eval_script55);
- i=importDescr();
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
- shell.importDescrHandler( i );
- }
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:228:7: r= defrule
- {
- pushFollow(FOLLOW_defrule_in_eval_script66);
- r=defrule();
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
- shell.ruleDescrHandler( r );
- }
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:230:7: fc= lisp_list[shell, new LispForm(shell) ]
- {
- pushFollow(FOLLOW_lisp_list_in_eval_script83);
- fc=lisp_list(shell, new LispForm2(shell) );
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
- shell.lispFormHandler(fc);
- }
-
- }
- break;
-
- default :
- break loop1;
- }
- } while (true);
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end eval_script
-
-
- // $ANTLR start importDescr
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:234:1: importDescr returns [ImportDescr importDescr] : LEFT_PAREN 'import' importName= NAME RIGHT_PAREN ;
- public final ImportDescr importDescr() throws RecognitionException {
- ImportDescr importDescr = null;
-
- Token importName=null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:235:2: ( LEFT_PAREN 'import' importName= NAME RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:235:4: LEFT_PAREN 'import' importName= NAME RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_importDescr106); if (failed) return importDescr;
- match(input,42,FOLLOW_42_in_importDescr108); if (failed) return importDescr;
- importName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_importDescr112); if (failed) return importDescr;
- if ( backtracking==0 ) {
- importDescr = new ImportDescr( importName.getText() );
- }
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_importDescr115); if (failed) return importDescr;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return importDescr;
- }
- // $ANTLR end importDescr
-
-
- // $ANTLR start deffunction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:250:1: deffunction returns [Deffunction function] : loc= LEFT_PAREN DEFFUNCTION ruleName= NAME loc= LEFT_PAREN (v= VAR )* RIGHT_PAREN (fc= lisp_list[context, new LispForm(context) ] )* RIGHT_PAREN ;
- public final Deffunction deffunction() throws RecognitionException {
- Deffunction function = null;
-
- Token loc=null;
- Token ruleName=null;
- Token v=null;
- ValueHandler fc = null;
-
-
-
- BuildContext context = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:254:2: (loc= LEFT_PAREN DEFFUNCTION ruleName= NAME loc= LEFT_PAREN (v= VAR )* RIGHT_PAREN (fc= lisp_list[context, new LispForm(context) ] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:254:4: loc= LEFT_PAREN DEFFUNCTION ruleName= NAME loc= LEFT_PAREN (v= VAR )* RIGHT_PAREN (fc= lisp_list[context, new LispForm(context) ] )* RIGHT_PAREN
- {
- loc=(Token)input.LT(1);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_deffunction141); if (failed) return function;
- match(input,DEFFUNCTION,FOLLOW_DEFFUNCTION_in_deffunction149); if (failed) return function;
- ruleName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_deffunction158); if (failed) return function;
- if ( backtracking==0 ) {
-
- function = new Deffunction( ruleName.getText() );
- functionRegistry.addFunction( function );
- context = new ExecutionBuildContext( function, functionRegistry );
-
- }
- loc=(Token)input.LT(1);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_deffunction166); if (failed) return function;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:262:4: (v= VAR )*
- loop2:
- do {
- int alt2=2;
- int LA2_0 = input.LA(1);
-
- if ( (LA2_0==VAR) ) {
- alt2=1;
- }
-
-
- switch (alt2) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:262:5: v= VAR
- {
- v=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_deffunction176); if (failed) return function;
- if ( backtracking==0 ) {
-
- context.addVariable( function.addParameter( v.getText() ) );
-
- }
-
- }
- break;
-
- default :
- break loop2;
- }
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_deffunction189); if (failed) return function;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:266:5: (fc= lisp_list[context, new LispForm(context) ] )*
- loop3:
- do {
- int alt3=2;
- int LA3_0 = input.LA(1);
-
- if ( (LA3_0==LEFT_PAREN) ) {
- alt3=1;
- }
-
-
- switch (alt3) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:266:6: fc= lisp_list[context, new LispForm(context) ]
- {
- pushFollow(FOLLOW_lisp_list_in_deffunction198);
- fc=lisp_list(context, new LispForm2(context) );
- _fsp--;
- if (failed) return function;
- if ( backtracking==0 ) {
- context.addFunction( (FunctionCaller) fc );
- }
-
- }
- break;
-
- default :
- break loop3;
- }
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_deffunction209); if (failed) return function;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return function;
- }
- // $ANTLR end deffunction
-
-
- // $ANTLR start defrule
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:280:1: defrule returns [RuleDescr rule] : loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' engine= execution_block RIGHT_PAREN ;
- public final RuleDescr defrule() throws RecognitionException {
- RuleDescr rule = null;
-
- Token loc=null;
- Token ruleName=null;
- Token documentation=null;
- ExecutionEngine engine = null;
-
-
-
- rule = null;
- AndDescr lhs = null;
- PatternDescr colum = null;
- AttributeDescr module = null;
- Set declarations = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:288:2: (loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' engine= execution_block RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:288:4: loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs, declarations] )* '=>' engine= execution_block RIGHT_PAREN
- {
- loc=(Token)input.LT(1);
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_defrule235); if (failed) return rule;
- match(input,DEFRULE,FOLLOW_DEFRULE_in_defrule243); if (failed) return rule;
- ruleName=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_defrule247); if (failed) return rule;
- if ( backtracking==0 ) {
-
- 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() );
-
- rule.addAttribute( new AttributeDescr( "dialect", "clips") );
-
- declarations = new HashSet();
-
- }
- documentation=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_defrule259); if (failed) return rule;
- if ( backtracking==0 ) {
-
- // do nothing here for now
-
- }
- pushFollow(FOLLOW_ruleAttribute_in_defrule265);
- ruleAttribute(rule);
- _fsp--;
- if (failed) return rule;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:327:3: ( ce[lhs, declarations] )*
- loop4:
- do {
- int alt4=2;
- int LA4_0 = input.LA(1);
-
- if ( (LA4_0==LEFT_PAREN||LA4_0==VAR) ) {
- alt4=1;
- }
-
-
- switch (alt4) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:327:3: ce[lhs, declarations]
- {
- pushFollow(FOLLOW_ce_in_defrule273);
- ce(lhs, declarations);
- _fsp--;
- if (failed) return rule;
-
- }
- break;
-
- default :
- break loop4;
- }
- } while (true);
-
- match(input,43,FOLLOW_43_in_defrule282); if (failed) return rule;
- pushFollow(FOLLOW_execution_block_in_defrule291);
- engine=execution_block();
- _fsp--;
- if (failed) return rule;
- if ( backtracking==0 ) {
- rule.setConsequence( engine );
- }
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_defrule300); if (failed) return rule;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return rule;
- }
- // $ANTLR end defrule
-
-
- // $ANTLR start ruleAttribute
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:337:1: ruleAttribute[RuleDescr rule] : ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? ;
- public final void ruleAttribute(RuleDescr rule) throws RecognitionException {
- AttributeDescr d = null;
-
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:338:2: ( ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )? )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:339:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:339:3: ( LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN )?
- int alt6=2;
- int LA6_0 = input.LA(1);
-
- if ( (LA6_0==LEFT_PAREN) ) {
- int LA6_1 = input.LA(2);
-
- if ( (LA6_1==DECLARE) ) {
- alt6=1;
- }
- }
- switch (alt6) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:339:5: LEFT_PAREN 'declare' ( LEFT_PAREN d= salience RIGHT_PAREN )? RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute317); if (failed) return ;
- match(input,DECLARE,FOLLOW_DECLARE_in_ruleAttribute319); if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:340:4: ( LEFT_PAREN d= salience RIGHT_PAREN )?
- int alt5=2;
- int LA5_0 = input.LA(1);
-
- if ( (LA5_0==LEFT_PAREN) ) {
- alt5=1;
- }
- switch (alt5) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:340:6: LEFT_PAREN d= salience RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_ruleAttribute326); if (failed) return ;
- pushFollow(FOLLOW_salience_in_ruleAttribute330);
- d=salience();
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
- rule.addAttribute( d );
- }
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute334); if (failed) return ;
-
- }
- break;
-
- }
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_ruleAttribute341); if (failed) return ;
-
- }
- break;
-
- }
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end ruleAttribute
-
-
- // $ANTLR start salience
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:344:1: salience returns [AttributeDescr d ] : loc= SALIENCE i= INT ;
- public final AttributeDescr salience() throws RecognitionException {
- AttributeDescr d = null;
-
- Token loc=null;
- Token i=null;
-
-
- d = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:348:2: (loc= SALIENCE i= INT )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:349:3: loc= SALIENCE i= INT
- {
- loc=(Token)input.LT(1);
- match(input,SALIENCE,FOLLOW_SALIENCE_in_salience371); if (failed) return d;
- i=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_salience375); if (failed) return d;
- if ( backtracking==0 ) {
-
- 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 {
- }
- return d;
- }
- // $ANTLR end salience
-
-
- // $ANTLR start ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:359:1: ce[ConditionalElementDescr in_ce, Set declarations] : ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) ;
- public final void ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:360:2: ( ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:360:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:360:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )
- int alt7=7;
- int LA7_0 = input.LA(1);
-
- if ( (LA7_0==LEFT_PAREN) ) {
- switch ( input.LA(2) ) {
- case NAME:
- {
- alt7=6;
- }
- break;
- case OR:
- {
- alt7=2;
- }
- break;
- case AND:
- {
- alt7=1;
- }
- break;
- case TEST:
- {
- alt7=5;
- }
- break;
- case EXISTS:
- {
- alt7=4;
- }
- break;
- case NOT:
- {
- alt7=3;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("360:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 7, 1, input);
-
- throw nvae;
- }
-
- }
- else if ( (LA7_0==VAR) ) {
- alt7=7;
- }
- else {
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("360:4: ( and_ce[in_ce, declarations] | or_ce[in_ce, declarations] | not_ce[in_ce, declarations] | exists_ce[in_ce, declarations] | eval_ce[in_ce, declarations] | normal_pattern[in_ce, declarations] | bound_pattern[in_ce, declarations] )", 7, 0, input);
-
- throw nvae;
- }
- switch (alt7) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:360:8: and_ce[in_ce, declarations]
- {
- pushFollow(FOLLOW_and_ce_in_ce401);
- and_ce(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:361:7: or_ce[in_ce, declarations]
- {
- pushFollow(FOLLOW_or_ce_in_ce411);
- or_ce(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:362:7: not_ce[in_ce, declarations]
- {
- pushFollow(FOLLOW_not_ce_in_ce420);
- not_ce(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:363:7: exists_ce[in_ce, declarations]
- {
- pushFollow(FOLLOW_exists_ce_in_ce429);
- exists_ce(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:364:8: eval_ce[in_ce, declarations]
- {
- pushFollow(FOLLOW_eval_ce_in_ce443);
- eval_ce(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:365:7: normal_pattern[in_ce, declarations]
- {
- pushFollow(FOLLOW_normal_pattern_in_ce457);
- normal_pattern(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:366:7: bound_pattern[in_ce, declarations]
- {
- pushFollow(FOLLOW_bound_pattern_in_ce466);
- bound_pattern(in_ce, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- }
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end ce
-
-
- // $ANTLR start execution_block
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:370:1: execution_block returns [ExecutionEngine engine] : (fc= lisp_list[context, new LispForm(context) ] )* ;
- public final ExecutionEngine execution_block() throws RecognitionException {
- ExecutionEngine engine = null;
-
- ValueHandler fc = null;
-
-
-
- engine = new BlockExecutionEngine();
- BuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:376:2: ( (fc= lisp_list[context, new LispForm(context) ] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:377:3: (fc= lisp_list[context, new LispForm(context) ] )*
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:377:3: (fc= lisp_list[context, new LispForm(context) ] )*
- loop8:
- do {
- int alt8=2;
- int LA8_0 = input.LA(1);
-
- if ( (LA8_0==LEFT_PAREN) ) {
- alt8=1;
- }
-
-
- switch (alt8) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:377:4: fc= lisp_list[context, new LispForm(context) ]
- {
- pushFollow(FOLLOW_lisp_list_in_execution_block498);
- fc=lisp_list(context, new LispForm2(context) );
- _fsp--;
- if (failed) return engine;
- if ( backtracking==0 ) {
- context.addFunction( (FunctionCaller) fc );
- }
-
- }
- break;
-
- default :
- break loop8;
- }
- } while (true);
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return engine;
- }
- // $ANTLR end execution_block
-
-
- // $ANTLR start and_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:380:1: and_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN ;
- public final void and_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
-
- AndDescr andDescr= null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:384:2: ( LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:384:4: LEFT_PAREN AND ( ce[andDescr, declarations] )+ RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_and_ce526); if (failed) return ;
- match(input,AND,FOLLOW_AND_in_and_ce531); if (failed) return ;
- if ( backtracking==0 ) {
-
- andDescr = new AndDescr();
- in_ce.addDescr( andDescr );
-
- }
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:389:3: ( ce[andDescr, declarations] )+
- int cnt9=0;
- loop9:
- do {
- int alt9=2;
- int LA9_0 = input.LA(1);
-
- if ( (LA9_0==LEFT_PAREN||LA9_0==VAR) ) {
- alt9=1;
- }
-
-
- switch (alt9) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:389:3: ce[andDescr, declarations]
- {
- pushFollow(FOLLOW_ce_in_and_ce537);
- ce(andDescr, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- if ( cnt9 >= 1 ) break loop9;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(9, input);
- throw eee;
- }
- cnt9++;
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_and_ce546); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end and_ce
-
-
- // $ANTLR start or_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:393:1: or_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN ;
- public final void or_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
-
- OrDescr orDescr= null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:397:2: ( LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:397:4: LEFT_PAREN OR ( ce[orDescr, declarations] )+ RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_or_ce574); if (failed) return ;
- match(input,OR,FOLLOW_OR_in_or_ce579); if (failed) return ;
- if ( backtracking==0 ) {
-
- orDescr = new OrDescr();
- in_ce.addDescr( orDescr );
-
- }
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:402:3: ( ce[orDescr, declarations] )+
- int cnt10=0;
- loop10:
- do {
- int alt10=2;
- int LA10_0 = input.LA(1);
-
- if ( (LA10_0==LEFT_PAREN||LA10_0==VAR) ) {
- alt10=1;
- }
-
-
- switch (alt10) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:402:3: ce[orDescr, declarations]
- {
- pushFollow(FOLLOW_ce_in_or_ce585);
- ce(orDescr, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- if ( cnt10 >= 1 ) break loop10;
- if (backtracking>0) {failed=true; return ;}
- EarlyExitException eee =
- new EarlyExitException(10, input);
- throw eee;
- }
- cnt10++;
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_or_ce594); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end or_ce
-
-
- // $ANTLR start not_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:406:1: not_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN ;
- public final void not_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
-
- NotDescr notDescr= null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:410:2: ( LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:410:4: LEFT_PAREN NOT ce[notDescr, declarations] RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_not_ce622); if (failed) return ;
- match(input,NOT,FOLLOW_NOT_in_not_ce627); if (failed) return ;
- if ( backtracking==0 ) {
-
- notDescr = new NotDescr();
- in_ce.addDescr( notDescr );
-
- }
- pushFollow(FOLLOW_ce_in_not_ce633);
- ce(notDescr, declarations);
- _fsp--;
- if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_not_ce641); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end not_ce
-
-
- // $ANTLR start exists_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:419:1: exists_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN ;
- public final void exists_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
-
- ExistsDescr existsDescr= null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:2: ( LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:423:4: LEFT_PAREN EXISTS ce[existsDescr, declarations] RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_exists_ce670); if (failed) return ;
- match(input,EXISTS,FOLLOW_EXISTS_in_exists_ce675); if (failed) return ;
- if ( backtracking==0 ) {
-
- existsDescr = new ExistsDescr();
- in_ce.addDescr( existsDescr );
-
- }
- pushFollow(FOLLOW_ce_in_exists_ce681);
- ce(existsDescr, declarations);
- _fsp--;
- if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_exists_ce689); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end exists_ce
-
-
- // $ANTLR start eval_ce
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:432:1: eval_ce[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN ;
- public final void eval_ce(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
- ValueHandler fc = null;
-
-
-
- EvalDescr evalDescr= null;
- ExecutionEngine engine = new CLPEval();
- BuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:438:2: ( LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:438:4: LEFT_PAREN TEST fc= lisp_list[context, new LispForm(context)] RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_eval_ce717); if (failed) return ;
- match(input,TEST,FOLLOW_TEST_in_eval_ce722); if (failed) return ;
- if ( backtracking==0 ) {
-
- evalDescr = new EvalDescr();
- in_ce.addDescr( evalDescr );
-
- }
- pushFollow(FOLLOW_lisp_list_in_eval_ce730);
- fc=lisp_list(context, new LispForm2(context));
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
-
- engine.addFunction( (FunctionCaller) fc );
- evalDescr.setContent( engine );
-
- }
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_eval_ce741); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end eval_ce
-
-
- // $ANTLR start normal_pattern
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:450:1: normal_pattern[ConditionalElementDescr in_ce, Set declarations] : LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
- public final void normal_pattern(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
- Token name=null;
-
-
- PatternDescr pattern = null;
- ConditionalElementDescr top = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:455:2: ( LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:455:4: LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_normal_pattern769); if (failed) return ;
- name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_normal_pattern776); if (failed) return ;
- if ( backtracking==0 ) {
-
- pattern = new PatternDescr(name.getText());
- in_ce.addDescr( pattern );
- top = pattern.getConstraint();
-
-
- }
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:462:3: ( field_constriant[top, declarations] )*
- loop11:
- do {
- int alt11=2;
- int LA11_0 = input.LA(1);
-
- if ( (LA11_0==LEFT_PAREN) ) {
- alt11=1;
- }
-
-
- switch (alt11) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:462:3: field_constriant[top, declarations]
- {
- pushFollow(FOLLOW_field_constriant_in_normal_pattern782);
- field_constriant(top, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- break loop11;
- }
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_normal_pattern792); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end normal_pattern
-
-
- // $ANTLR start bound_pattern
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:468:1: bound_pattern[ConditionalElementDescr in_ce, Set declarations] : var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN ;
- public final void bound_pattern(ConditionalElementDescr in_ce, Set declarations) throws RecognitionException {
- Token var=null;
- Token name=null;
-
-
- PatternDescr pattern = null;
- String identifier = null;
- ConditionalElementDescr top = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:474:2: (var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:474:4: var= VAR ASSIGN_OP LEFT_PAREN name= NAME ( field_constriant[top, declarations] )* RIGHT_PAREN
- {
- var=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_bound_pattern820); if (failed) return ;
- if ( backtracking==0 ) {
-
- identifier = var.getText();
-
- }
- match(input,ASSIGN_OP,FOLLOW_ASSIGN_OP_in_bound_pattern826); if (failed) return ;
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_bound_pattern828); if (failed) return ;
- name=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_bound_pattern832); if (failed) return ;
- if ( backtracking==0 ) {
-
- pattern = new PatternDescr(name.getText());
- pattern.setIdentifier( identifier );
- in_ce.addDescr( pattern );
- top = pattern.getConstraint();
-
- }
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:484:3: ( field_constriant[top, declarations] )*
- loop12:
- do {
- int alt12=2;
- int LA12_0 = input.LA(1);
-
- if ( (LA12_0==LEFT_PAREN) ) {
- alt12=1;
- }
-
-
- switch (alt12) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:484:3: field_constriant[top, declarations]
- {
- pushFollow(FOLLOW_field_constriant_in_bound_pattern841);
- field_constriant(top, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- break loop12;
- }
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_bound_pattern848); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end bound_pattern
-
-
- // $ANTLR start field_constriant
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:488:1: field_constriant[ConditionalElementDescr base, Set declarations] : LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN ;
- public final void field_constriant(ConditionalElementDescr base, Set declarations) throws RecognitionException {
- Token f=null;
-
-
- List list = new ArrayList();
- FieldBindingDescr fbd = null;
- FieldConstraintDescr fc = null;
- RestrictionConnectiveDescr top = null;
- String op = "==";
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:496:2: ( LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:497:3: LEFT_PAREN f= NAME or_restr_connective[top, base, fc, declarations] RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_field_constriant879); if (failed) return ;
- f=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_field_constriant883); if (failed) return ;
- if ( backtracking==0 ) {
-
- fc = new FieldConstraintDescr(f.getText());
- fc.setLocation( offset(f.getLine()), f.getCharPositionInLine() );
- fc.setStartCharacter( ((CommonToken)f).getStartIndex() );
- base.addDescr( fc );
- top = fc.getRestriction();
-
- }
- pushFollow(FOLLOW_or_restr_connective_in_field_constriant898);
- or_restr_connective(top, base, fc, declarations);
- _fsp--;
- if (failed) return ;
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_field_constriant904); if (failed) return ;
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end field_constriant
-
-
- // $ANTLR start or_restr_connective
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:524:1: or_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] options {backtrack=true; } : and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* ;
- public final void or_restr_connective(RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
-
- RestrictionConnectiveDescr or = new RestrictionConnectiveDescr(RestrictionConnectiveDescr.OR);
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:531:2: ( and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:532:3: and_restr_connective[or, ceBase, fcBase, declarations] ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
- {
- pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective943);
- and_restr_connective(or, ceBase, fcBase, declarations);
- _fsp--;
- if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:533:3: ( options {backtrack=true; } : PIPE and_restr_connective[or, ceBase, fcBase, declarations] )*
- loop13:
- do {
- int alt13=2;
- int LA13_0 = input.LA(1);
-
- if ( (LA13_0==PIPE) ) {
- alt13=1;
- }
-
-
- switch (alt13) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:535:6: PIPE and_restr_connective[or, ceBase, fcBase, declarations]
- {
- match(input,PIPE,FOLLOW_PIPE_in_or_restr_connective967); if (failed) return ;
- if ( backtracking==0 ) {
-
- location.setType(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
-
- }
- pushFollow(FOLLOW_and_restr_connective_in_or_restr_connective977);
- and_restr_connective(or, ceBase, fcBase, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- break loop13;
- }
- } while (true);
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
-
- if( or.getRestrictions().size() == 1 ) {
- rcBase.addOrMerge( (RestrictionDescr) or.getRestrictions().get( 0 ) );
- } else if ( or.getRestrictions().size() > 1 ) {
- rcBase.addRestriction( or );
- }
-
- }
- return ;
- }
- // $ANTLR end or_restr_connective
-
-
- // $ANTLR start and_restr_connective
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:550:1: and_restr_connective[ RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* ;
- public final void and_restr_connective(RestrictionConnectiveDescr rcBase, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
-
- RestrictionConnectiveDescr and = new RestrictionConnectiveDescr(RestrictionConnectiveDescr.AND);
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:554:2: ( restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )* )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:555:3: restriction[and, ceBase, fcBase, declarations] ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
- {
- pushFollow(FOLLOW_restriction_in_and_restr_connective1009);
- restriction(and, ceBase, fcBase, declarations);
- _fsp--;
- if (failed) return ;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:556:3: ( AMPERSAND restriction[and, ceBase, fcBase, declarations] )*
- loop14:
- do {
- int alt14=2;
- int LA14_0 = input.LA(1);
-
- if ( (LA14_0==AMPERSAND) ) {
- alt14=1;
- }
-
-
- switch (alt14) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:556:5: AMPERSAND restriction[and, ceBase, fcBase, declarations]
- {
- match(input,AMPERSAND,FOLLOW_AMPERSAND_in_and_restr_connective1017); if (failed) return ;
- pushFollow(FOLLOW_restriction_in_and_restr_connective1019);
- restriction(and, ceBase, fcBase, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
-
- default :
- break loop14;
- }
- } while (true);
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
-
- if( and.getRestrictions().size() == 1) {
- rcBase.addOrMerge( (RestrictionDescr) and.getRestrictions().get( 0 ) );
- } else if ( and.getRestrictions().size() > 1 ) {
- rcBase.addRestriction( and );
- }
-
- }
- return ;
- }
- // $ANTLR end and_restr_connective
-
-
- // $ANTLR start restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:575:1: restriction[RestrictionConnectiveDescr rc, ConditionalElementDescr base, FieldConstraintDescr fcBase, Set declarations ] : ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) ;
- public final void restriction(RestrictionConnectiveDescr rc, ConditionalElementDescr base, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
- String lc = null;
-
-
-
- String op = "==";
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:2: ( ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:4: ( TILDE )? ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:4: ( TILDE )?
- int alt15=2;
- int LA15_0 = input.LA(1);
-
- if ( (LA15_0==TILDE) ) {
- alt15=1;
- }
- switch (alt15) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:579:5: TILDE
- {
- match(input,TILDE,FOLLOW_TILDE_in_restriction1052); if (failed) return ;
- if ( backtracking==0 ) {
- op = "!=";
- }
-
- }
- break;
-
- }
-
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:580:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )
- int alt16=4;
- switch ( input.LA(1) ) {
- case COLON:
- {
- alt16=1;
- }
- break;
- case EQUALS:
- {
- alt16=2;
- }
- break;
- case VAR:
- {
- alt16=3;
- }
- break;
- case NAME:
- case STRING:
- case INT:
- case FLOAT:
- case BOOL:
- case NULL:
- {
- alt16=4;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return ;}
- NoViableAltException nvae =
- new NoViableAltException("580:3: ( predicate_constraint[rc, op, base] | return_value_restriction[op, rc] | variable_restriction[op, rc, base, fcBase, declarations] | lc= literal_restriction )", 16, 0, input);
-
- throw nvae;
- }
-
- switch (alt16) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:580:5: predicate_constraint[rc, op, base]
- {
- pushFollow(FOLLOW_predicate_constraint_in_restriction1068);
- predicate_constraint(rc, op, base);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:581:7: return_value_restriction[op, rc]
- {
- pushFollow(FOLLOW_return_value_restriction_in_restriction1084);
- return_value_restriction(op, rc);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:582:7: variable_restriction[op, rc, base, fcBase, declarations]
- {
- pushFollow(FOLLOW_variable_restriction_in_restriction1093);
- variable_restriction(op, rc, base, fcBase, declarations);
- _fsp--;
- if (failed) return ;
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:583:8: lc= literal_restriction
- {
- pushFollow(FOLLOW_literal_restriction_in_restriction1105);
- lc=literal_restriction();
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
-
- rc.addRestriction( new LiteralRestrictionDescr(op, lc) );
- op = "==";
-
- }
-
- }
- break;
-
- }
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end restriction
-
-
- // $ANTLR start predicate_constraint
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:590:1: predicate_constraint[RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base] : COLON fc= lisp_list[context, new LispForm(context)] ;
- public final void predicate_constraint(RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base) throws RecognitionException {
- ValueHandler fc = null;
-
-
-
- ExecutionEngine engine = new CLPPredicate();
- BuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:2: ( COLON fc= lisp_list[context, new LispForm(context)] )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:595:4: COLON fc= lisp_list[context, new LispForm(context)]
- {
- match(input,COLON,FOLLOW_COLON_in_predicate_constraint1147); if (failed) return ;
- pushFollow(FOLLOW_lisp_list_in_predicate_constraint1153);
- fc=lisp_list(context, new LispForm2(context));
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
-
- engine.addFunction( (FunctionCaller) fc );
- rc.addRestriction( new PredicateDescr( engine ) );
-
- }
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end predicate_constraint
-
-
- // $ANTLR start return_value_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:604:1: return_value_restriction[String op, RestrictionConnectiveDescr rc] : EQUALS func= lisp_list[context, new LispForm(context)] ;
- public final void return_value_restriction(String op, RestrictionConnectiveDescr rc) throws RecognitionException {
- ValueHandler func = null;
-
-
-
- ExecutionEngine engine = new CLPReturnValue();
- BuildContext context = new ExecutionBuildContext( engine, functionRegistry );
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:609:2: ( EQUALS func= lisp_list[context, new LispForm(context)] )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:609:4: EQUALS func= lisp_list[context, new LispForm(context)]
- {
- match(input,EQUALS,FOLLOW_EQUALS_in_return_value_restriction1179); if (failed) return ;
- pushFollow(FOLLOW_lisp_list_in_return_value_restriction1186);
- func=lisp_list(context, new LispForm2(context));
- _fsp--;
- if (failed) return ;
- if ( backtracking==0 ) {
-
- engine.addFunction( (FunctionCaller) func );
- rc.addRestriction( new ReturnValueRestrictionDescr (op, engine ) );
-
- }
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end return_value_restriction
-
-
- // $ANTLR start variable_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:617:1: variable_restriction[String op, RestrictionConnectiveDescr rc, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations ] : VAR ;
- public final void variable_restriction(String op, RestrictionConnectiveDescr rc, ConditionalElementDescr ceBase, FieldConstraintDescr fcBase, Set declarations) throws RecognitionException {
- Token VAR1=null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:618:2: ( VAR )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:618:4: VAR
- {
- VAR1=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_variable_restriction1206); if (failed) return ;
- if ( backtracking==0 ) {
-
- if ( declarations.contains( VAR1.getText() ) ) {
- rc.addRestriction( new VariableRestrictionDescr(op, VAR1.getText()) );
- } else {
- FieldBindingDescr fbd = new FieldBindingDescr();
- fbd.setIdentifier( VAR1.getText() );
- fbd.setFieldName( fcBase.getFieldName() );
- ceBase.insertBeforeLast( FieldConstraintDescr.class, fbd );
- declarations.add( VAR1.getText() );
- }
-
- }
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return ;
- }
- // $ANTLR end variable_restriction
-
-
- // $ANTLR start literal_restriction
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:632:1: literal_restriction returns [String text] : t= literal ;
- public final String literal_restriction() throws RecognitionException {
- String text = null;
-
- String t = null;
-
-
-
- text = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:636:2: (t= literal )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:637:6: t= literal
- {
- pushFollow(FOLLOW_literal_in_literal_restriction1239);
- t=literal();
- _fsp--;
- if (failed) return text;
- if ( backtracking==0 ) {
-
- text = t;
-
- }
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return text;
- }
- // $ANTLR end literal_restriction
-
-
- // $ANTLR start lisp_list
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:642:1: lisp_list[BuildContext context, LispList list] returns [ValueHandler valueHandler] : LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN ;
- public final ValueHandler lisp_list(BuildContext context, LispList list) throws RecognitionException {
- ValueHandler valueHandler = null;
-
- ValueHandler a = null;
-
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:643:2: ( LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:643:4: LEFT_PAREN (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )* RIGHT_PAREN
- {
- match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_lisp_list1258); if (failed) return valueHandler;
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:644:3: (a= lisp_atom[context] | a= lisp_list[context, list.createList()] )*
- loop17:
- do {
- int alt17=3;
- int LA17_0 = input.LA(1);
-
- if ( (LA17_0==NAME||LA17_0==VAR||LA17_0==STRING||LA17_0==INT||(LA17_0>=FLOAT && LA17_0<=NULL)) ) {
- alt17=1;
- }
- else if ( (LA17_0==LEFT_PAREN) ) {
- alt17=2;
- }
-
-
- switch (alt17) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:644:6: a= lisp_atom[context]
- {
- pushFollow(FOLLOW_lisp_atom_in_lisp_list1268);
- a=lisp_atom(context);
- _fsp--;
- if (failed) return valueHandler;
- if ( backtracking==0 ) {
- list.add( a );
- }
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:645:6: a= lisp_list[context, list.createList()]
- {
- pushFollow(FOLLOW_lisp_list_in_lisp_list1284);
- a=lisp_list(context, list.createList());
- _fsp--;
- if (failed) return valueHandler;
- if ( backtracking==0 ) {
- list.add( a );
- }
-
- }
- break;
-
- default :
- break loop17;
- }
- } while (true);
-
- match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_lisp_list1314); if (failed) return valueHandler;
- if ( backtracking==0 ) {
- valueHandler = list.getValueHandler();
- }
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return valueHandler;
- }
- // $ANTLR end lisp_list
-
-
- // $ANTLR start lisp_atom
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:651:1: lisp_atom[BuildContext context] returns [ValueHandler value] : (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL ) ;
- public final ValueHandler lisp_atom(BuildContext context) throws RecognitionException {
- ValueHandler value = null;
-
- Token t=null;
-
-
- value = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:655:2: ( (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:656:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:656:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )
- int alt18=7;
- switch ( input.LA(1) ) {
- case VAR:
- {
- alt18=1;
- }
- break;
- case STRING:
- {
- alt18=2;
- }
- break;
- case NAME:
- {
- alt18=3;
- }
- break;
- case FLOAT:
- {
- alt18=4;
- }
- break;
- case INT:
- {
- alt18=5;
- }
- break;
- case BOOL:
- {
- alt18=6;
- }
- break;
- case NULL:
- {
- alt18=7;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return value;}
- NoViableAltException nvae =
- new NoViableAltException("656:3: (t= VAR | t= STRING | t= NAME | t= FLOAT | t= INT | t= BOOL | t= NULL )", 18, 0, input);
-
- throw nvae;
- }
-
- switch (alt18) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:656:6: t= VAR
- {
- t=(Token)input.LT(1);
- match(input,VAR,FOLLOW_VAR_in_lisp_atom1351); if (failed) return value;
- if ( backtracking==0 ) {
- value = context.getVariableValueHandler(t.getText() );
- }
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:657:6: t= STRING
- {
- t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_lisp_atom1363); if (failed) return value;
- if ( backtracking==0 ) {
- value = new ObjectValueHandler( getString( t ) );
- }
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:658:7: t= NAME
- {
- t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_lisp_atom1375); if (failed) return value;
- if ( backtracking==0 ) {
- value = new ObjectValueHandler( t.getText() );
- }
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:659:6: t= FLOAT
- {
- t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_lisp_atom1390); if (failed) return value;
- if ( backtracking==0 ) {
- value = new DoubleValueHandler( t.getText() );
- }
-
- }
- break;
- case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:660:6: t= INT
- {
- t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_lisp_atom1402); if (failed) return value;
- if ( backtracking==0 ) {
- value = new LongValueHandler( t.getText() );
- }
-
- }
- break;
- case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:661:6: t= BOOL
- {
- t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_lisp_atom1418); if (failed) return value;
- if ( backtracking==0 ) {
- value = new BooleanValueHandler( t.getText() );
- }
-
- }
- break;
- case 7 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:662:6: t= NULL
- {
- t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_lisp_atom1436); if (failed) return value;
- if ( backtracking==0 ) {
- value = ObjectValueHandler.NULL;
- }
-
- }
- break;
-
- }
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return value;
- }
- // $ANTLR end lisp_atom
-
-
- // $ANTLR start literal
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:666:1: literal returns [String text] : (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) ;
- public final String literal() throws RecognitionException {
- String text = null;
-
- Token t=null;
-
-
- text = null;
-
- try {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:670:2: ( (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL ) )
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:670:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
- {
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:670:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )
- int alt19=6;
- switch ( input.LA(1) ) {
- case STRING:
- {
- alt19=1;
- }
- break;
- case NAME:
- {
- alt19=2;
- }
- break;
- case INT:
- {
- alt19=3;
- }
- break;
- case FLOAT:
- {
- alt19=4;
- }
- break;
- case BOOL:
- {
- alt19=5;
- }
- break;
- case NULL:
- {
- alt19=6;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return text;}
- NoViableAltException nvae =
- new NoViableAltException("670:4: (t= STRING | t= NAME | t= INT | t= FLOAT | t= BOOL | t= NULL )", 19, 0, input);
-
- throw nvae;
- }
-
- switch (alt19) {
- case 1 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:670:8: t= STRING
- {
- t=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_literal1472); if (failed) return text;
- if ( backtracking==0 ) {
- text = getString( t );
- }
-
- }
- break;
- case 2 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:671:7: t= NAME
- {
- t=(Token)input.LT(1);
- match(input,NAME,FOLLOW_NAME_in_literal1485); if (failed) return text;
- if ( backtracking==0 ) {
- text = t.getText();
- }
-
- }
- break;
- case 3 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:672:7: t= INT
- {
- t=(Token)input.LT(1);
- match(input,INT,FOLLOW_INT_in_literal1501); if (failed) return text;
- if ( backtracking==0 ) {
- text = t.getText();
- }
-
- }
- break;
- case 4 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:673:7: t= FLOAT
- {
- t=(Token)input.LT(1);
- match(input,FLOAT,FOLLOW_FLOAT_in_literal1516); if (failed) return text;
- if ( backtracking==0 ) {
- text = t.getText();
- }
-
- }
- break;
- case 5 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:674:7: t= BOOL
- {
- t=(Token)input.LT(1);
- match(input,BOOL,FOLLOW_BOOL_in_literal1529); if (failed) return text;
- if ( backtracking==0 ) {
- text = t.getText();
- }
-
- }
- break;
- case 6 :
- // C:\\dev\\drools\\trunk\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:675:7: t= NULL
- {
- t=(Token)input.LT(1);
- match(input,NULL,FOLLOW_NULL_in_literal1543); if (failed) return text;
- if ( backtracking==0 ) {
- text = null;
- }
-
- }
- break;
-
- }
-
-
- }
-
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return text;
- }
- // $ANTLR end literal
-
-
-
-
- public static final BitSet FOLLOW_importDescr_in_eval_script55 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_defrule_in_eval_script66 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_lisp_list_in_eval_script83 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_importDescr106 = new BitSet(new long[]{0x0000040000000000L});
- public static final BitSet FOLLOW_42_in_importDescr108 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_importDescr112 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_importDescr115 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_deffunction141 = new BitSet(new long[]{0x0000000000000080L});
- public static final BitSet FOLLOW_DEFFUNCTION_in_deffunction149 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_deffunction158 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_deffunction166 = new BitSet(new long[]{0x0000000000000140L});
- public static final BitSet FOLLOW_VAR_in_deffunction176 = new BitSet(new long[]{0x0000000000000140L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_deffunction189 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_lisp_list_in_deffunction198 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_deffunction209 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_defrule235 = new BitSet(new long[]{0x0000000000000200L});
- public static final BitSet FOLLOW_DEFRULE_in_defrule243 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_defrule247 = new BitSet(new long[]{0x0000000000000400L});
- public static final BitSet FOLLOW_STRING_in_defrule259 = new BitSet(new long[]{0x0000080000000110L});
- public static final BitSet FOLLOW_ruleAttribute_in_defrule265 = new BitSet(new long[]{0x0000080000000110L});
- public static final BitSet FOLLOW_ce_in_defrule273 = new BitSet(new long[]{0x0000080000000110L});
- public static final BitSet FOLLOW_43_in_defrule282 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_execution_block_in_defrule291 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_defrule300 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute317 = new BitSet(new long[]{0x0000000020000000L});
- public static final BitSet FOLLOW_DECLARE_in_ruleAttribute319 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_ruleAttribute326 = new BitSet(new long[]{0x0000000000000800L});
- public static final BitSet FOLLOW_salience_in_ruleAttribute330 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute334 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_ruleAttribute341 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SALIENCE_in_salience371 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_INT_in_salience375 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_and_ce_in_ce401 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_or_ce_in_ce411 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_not_ce_in_ce420 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_exists_ce_in_ce429 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_eval_ce_in_ce443 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_normal_pattern_in_ce457 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_bound_pattern_in_ce466 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_lisp_list_in_execution_block498 = new BitSet(new long[]{0x0000000000000012L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_and_ce526 = new BitSet(new long[]{0x0000000000002000L});
- public static final BitSet FOLLOW_AND_in_and_ce531 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_ce_in_and_ce537 = new BitSet(new long[]{0x0000000000000150L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_and_ce546 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_or_ce574 = new BitSet(new long[]{0x0000000000004000L});
- public static final BitSet FOLLOW_OR_in_or_ce579 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_ce_in_or_ce585 = new BitSet(new long[]{0x0000000000000150L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_or_ce594 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_not_ce622 = new BitSet(new long[]{0x0000000000008000L});
- public static final BitSet FOLLOW_NOT_in_not_ce627 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_ce_in_not_ce633 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_not_ce641 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_exists_ce670 = new BitSet(new long[]{0x0000000000010000L});
- public static final BitSet FOLLOW_EXISTS_in_exists_ce675 = new BitSet(new long[]{0x0000000000000110L});
- public static final BitSet FOLLOW_ce_in_exists_ce681 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_exists_ce689 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_eval_ce717 = new BitSet(new long[]{0x0000000000020000L});
- public static final BitSet FOLLOW_TEST_in_eval_ce722 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_eval_ce730 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_eval_ce741 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_normal_pattern769 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_normal_pattern776 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_field_constriant_in_normal_pattern782 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_normal_pattern792 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_bound_pattern820 = new BitSet(new long[]{0x0000000000040000L});
- public static final BitSet FOLLOW_ASSIGN_OP_in_bound_pattern826 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_bound_pattern828 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_bound_pattern832 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_field_constriant_in_bound_pattern841 = new BitSet(new long[]{0x0000000000000050L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_bound_pattern848 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_field_constriant879 = new BitSet(new long[]{0x0000000000000020L});
- public static final BitSet FOLLOW_NAME_in_field_constriant883 = new BitSet(new long[]{0x0000000007E01520L});
- public static final BitSet FOLLOW_or_restr_connective_in_field_constriant898 = new BitSet(new long[]{0x0000000000000040L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_field_constriant904 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective943 = new BitSet(new long[]{0x0000000000080002L});
- public static final BitSet FOLLOW_PIPE_in_or_restr_connective967 = new BitSet(new long[]{0x0000000007E01520L});
- public static final BitSet FOLLOW_and_restr_connective_in_or_restr_connective977 = new BitSet(new long[]{0x0000000000080002L});
- public static final BitSet FOLLOW_restriction_in_and_restr_connective1009 = new BitSet(new long[]{0x0000000000100002L});
- public static final BitSet FOLLOW_AMPERSAND_in_and_restr_connective1017 = new BitSet(new long[]{0x0000000007E01520L});
- public static final BitSet FOLLOW_restriction_in_and_restr_connective1019 = new BitSet(new long[]{0x0000000000100002L});
- public static final BitSet FOLLOW_TILDE_in_restriction1052 = new BitSet(new long[]{0x0000000007C01520L});
- public static final BitSet FOLLOW_predicate_constraint_in_restriction1068 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_return_value_restriction_in_restriction1084 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_variable_restriction_in_restriction1093 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_restriction_in_restriction1105 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_COLON_in_predicate_constraint1147 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_predicate_constraint1153 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_EQUALS_in_return_value_restriction1179 = new BitSet(new long[]{0x0000000000000010L});
- public static final BitSet FOLLOW_lisp_list_in_return_value_restriction1186 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_variable_restriction1206 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_literal_in_literal_restriction1239 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LEFT_PAREN_in_lisp_list1258 = new BitSet(new long[]{0x0000000007001570L});
- public static final BitSet FOLLOW_lisp_atom_in_lisp_list1268 = new BitSet(new long[]{0x0000000007001570L});
- public static final BitSet FOLLOW_lisp_list_in_lisp_list1284 = new BitSet(new long[]{0x0000000007001570L});
- public static final BitSet FOLLOW_RIGHT_PAREN_in_lisp_list1314 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_VAR_in_lisp_atom1351 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_lisp_atom1363 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_lisp_atom1375 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_lisp_atom1390 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_lisp_atom1402 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_lisp_atom1418 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_lisp_atom1436 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_literal1472 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NAME_in_literal1485 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_INT_in_literal1501 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FLOAT_in_literal1516 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BOOL_in_literal1529 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NULL_in_literal1543 = new BitSet(new long[]{0x0000000000000002L});
-
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPPredicate.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPPredicate.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPPredicate.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,63 +0,0 @@
-/**
- *
- */
-package org.drools.clp;
-
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-import org.drools.rule.Declaration;
-import org.drools.spi.PredicateExpression;
-import org.drools.spi.Tuple;
-
-public class CLPPredicate
- implements
- PredicateExpression,
- ExecutionEngine {
- private FunctionCaller function;
- private int index;
-
- public CLPPredicate() {
- }
-
- public CLPPredicate(FunctionCaller function) {
- this.function = function;
- }
-
- public void addFunction(FunctionCaller function) {
- setFunction( function );
- }
-
- public void setFunction(FunctionCaller function) {
- this.function = function;
- }
-
- public FunctionCaller[] getFunctions() {
- return new FunctionCaller[]{this.function};
- }
-
- public VariableValueHandler createLocalVariable(String identifier) {
- return new IndexedLocalVariableValue( identifier,
- this.index++ );
- }
-
- public boolean evaluate(Object object,
- Tuple tuple,
- Declaration[] previousDeclarations,
- Declaration[] localDeclarations,
- WorkingMemory workingMemory) throws Exception {
- ExecutionContext context = new ExecutionContextImpl( (InternalWorkingMemory) workingMemory,
- (ReteTuple) tuple,
- object,
- this.index - 1 );
- return this.function.getBooleanValue( context );
- }
-
- public void replaceTempTokens(Map variables) {
- this.function.replaceTempTokens( variables );
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPReturnValue.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPReturnValue.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/CLPReturnValue.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,66 +0,0 @@
-/**
- *
- */
-package org.drools.clp;
-
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.base.FieldFactory;
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-import org.drools.rule.Declaration;
-import org.drools.spi.FieldValue;
-import org.drools.spi.ReturnValueExpression;
-import org.drools.spi.Tuple;
-
-public class CLPReturnValue
- implements
- ReturnValueExpression,
- ExecutionEngine {
- private FunctionCaller function;
- private int index;
-
- public CLPReturnValue() {
-
- }
-
- public CLPReturnValue(FunctionCaller function) {
- this.function = function;
- }
-
- public void setFunction(FunctionCaller function) {
- this.function = function;
- }
-
- public void addFunction(FunctionCaller function) {
- setFunction( function );
- }
-
- public FunctionCaller[] getFunctions() {
- return new FunctionCaller[]{this.function};
- }
-
- public VariableValueHandler createLocalVariable(String identifier) {
- return new IndexedLocalVariableValue( identifier,
- this.index++ );
- }
-
- public FieldValue evaluate(Object object,
- Tuple tuple,
- Declaration[] previousDeclarations,
- Declaration[] localDeclarations,
- WorkingMemory workingMemory) throws Exception {
- ExecutionContext context = new ExecutionContextImpl( (InternalWorkingMemory) workingMemory,
- (ReteTuple) tuple,
- object,
- 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
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Deffunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Deffunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Deffunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,113 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.clp.valuehandlers.ListValueHandler;
-import org.drools.clp.valuehandlers.ObjectValueHandler;
-
-public class Deffunction
- implements
- Function,
- ExecutionEngine {
- private final String name;
- private FunctionCaller[] functions;
-
- private ValueHandler[] parameters;
-
- private int index;
-
- public Deffunction(String name) {
- this.name = name;
- }
-
- public VariableValueHandler addParameter(String name) {
- VariableValueHandler param = new IndexedLocalVariableValue( name,
- index++ );
- if ( parameters == null ) {
- this.parameters = new ValueHandler[]{param};
- } else {
- ValueHandler[] temp = new ValueHandler[parameters.length + 1];
- System.arraycopy( this.parameters,
- 0,
- temp,
- 0,
- this.parameters.length );
- temp[temp.length - 1] = param;
- this.parameters = temp;
- }
- return param;
- }
-
- public void addFunction(FunctionCaller function) {
- if ( 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;
- }
- }
-
- public ValueHandler[] getParameters() {
- return this.parameters;
- }
-
- public ValueHandler addParameterCallback(int index,
- FunctionCaller caller,
- ValueHandler valueHandler,
- BuildContext context) {
- caller.addParameter( valueHandler );
- return valueHandler;
- }
-
- public void initCallback(BuildContext context) {
- }
-
- public ValueHandler execute(ValueHandler[] args,
- ExecutionContext context) {
- ExecutionContext newContext = initContext( args,
- context );
-
- ValueHandler returnValue = null;
-
- for ( int i = 0, length = this.functions.length; i < length; i++ ) {
- // We know a function always returns a ValueHandler
- returnValue = (ValueHandler) this.functions[i].getValue( newContext );
- }
- return returnValue;
- }
-
- private ExecutionContext initContext(ValueHandler[] args,
- ExecutionContext context) {
- ExecutionContext newContext = new ExecutionContextImpl( context.getWorkingMemory(),
- context.getTuple(),
- args.length );
- for ( int i = 0, length = args.length; i < length; i++ ) {
- newContext.setLocalVariable( i,
- ((ValueHandler) args[i]).getValue( context ) );
- }
- return newContext;
- }
-
- public String getName() {
- return this.name;
- }
-
- public LispList createList(int index) {
- return new LispForm2();
- }
-
- public VariableValueHandler createLocalVariable(String identifier) {
- return new IndexedLocalVariableValue( name,
- index++ );
- }
-
- public FunctionCaller[] getFunctions() {
- return this.functions;
- }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionBuildContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionBuildContext.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionBuildContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,86 +0,0 @@
-package org.drools.clp;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-import org.drools.clp.valuehandlers.IndexedLocalVariableValue;
-import org.drools.clp.valuehandlers.TempTokenVariable;
-
-public class ExecutionBuildContext
- implements
- BuildContext {
- private Map vars = new HashMap();
- private Map properties = Collections.EMPTY_MAP;
- private ExecutionEngine engine;
- private FunctionRegistry registry;
-
- public ExecutionBuildContext(ExecutionEngine engine,
- FunctionRegistry registry) {
- this.engine = engine;
- this.registry = registry;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#getFunctionRegistry()
- */
- public FunctionRegistry getFunctionRegistry() {
- return this.registry;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#addFunction(org.drools.clp.valuehandlers.FunctionCaller)
- */
- public void addFunction(FunctionCaller function) {
- this.engine.addFunction( function );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#setProperty(java.lang.Object, java.lang.Object)
- */
- public Object setProperty(Object key,
- Object value) {
- if ( this.properties == Collections.EMPTY_MAP ) {
- this.properties = new HashMap();
- }
- return this.properties.put( key,
- value );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#getProperty(java.lang.Object)
- */
- public Object getProperty(Object key) {
- return this.properties.get( key );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#createLocalVariable(java.lang.String)
- */
- public ValueHandler createLocalVariable(String identifier) {
- ValueHandler var = (ValueHandler) this.vars.get( identifier );
- if ( var == null ) {
- var = this.engine.createLocalVariable( identifier );
- this.vars.put( identifier,
- var );
- }
- return var;
- }
-
- public void addVariable(VariableValueHandler var) {
- this.vars.put( var.getIdentifier(), var);
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.BuildContext#getVariableValueHandler(java.lang.String)
- */
- public ValueHandler getVariableValueHandler(String identifier) {
- ValueHandler var = (ValueHandler) this.vars.get( identifier );
- if ( var == null ) {
- var = new TempTokenVariable( identifier );
- }
- return var;
- }
-
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContext.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,29 +0,0 @@
-package org.drools.clp;
-
-import java.io.PrintStream;
-import java.util.Map;
-
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-
-public interface ExecutionContext {
-
- public void setPrintoutRouters(Map printoutRouters);
-
- public void addPrintoutRouter(String identifier,
- PrintStream stream);
-
- public PrintStream getPrintoutRouters(String identifier);
-
- public InternalWorkingMemory getWorkingMemory();
-
- public Object getObject();
-
- public ReteTuple getTuple();
-
- public ValueHandler getLocalVariable(int index);
-
- public void setLocalVariable(int index,
- ValueHandler valueHandler);
-
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContextImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContextImpl.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionContextImpl.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,94 +0,0 @@
-package org.drools.clp;
-
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.drools.common.InternalWorkingMemory;
-import org.drools.reteoo.ReteTuple;
-
-public class ExecutionContextImpl implements ExecutionContext {
- private InternalWorkingMemory workingMemory;
- private ReteTuple tuple;
- private Object object;
- private ValueHandler[] localVariables;
- private Map printoutRouters;
-
-
- public ExecutionContextImpl(InternalWorkingMemory workingMemory,
- ReteTuple tuple,
- int localVariableSize) {
- this( workingMemory, tuple, null, localVariableSize);
- }
-
-
- public ExecutionContextImpl(InternalWorkingMemory workingMemory,
- ReteTuple tuple,
- Object object,
- int localVariableSize) {
- this.workingMemory = workingMemory;
- this.tuple = tuple;
- this.object = object;
- this.localVariables = new ValueHandler[localVariableSize];
- this.printoutRouters = new HashMap();
- this.printoutRouters.put( "t", System.out );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#setPrintoutRouters(java.util.Map)
- */
- public void setPrintoutRouters(Map printoutRouters) {
- this.printoutRouters = printoutRouters;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#addPrintoutRouter(java.lang.String, java.io.PrintStream)
- */
- public void addPrintoutRouter(String identifier, PrintStream stream) {
- this.printoutRouters.put( identifier, stream );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#getPrintoutRouters(java.lang.String)
- */
- public PrintStream getPrintoutRouters(String identifier) {
- return ( PrintStream ) this.printoutRouters.get( identifier );
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#getTuple()
- */
- public ReteTuple getTuple() {
- return tuple;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#getWorkingMemory()
- */
- public InternalWorkingMemory getWorkingMemory() {
- return workingMemory;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#getObject()
- */
- public Object getObject() {
- return this.object;
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#getLocalVariable(int)
- */
- public ValueHandler getLocalVariable(int index) {
- return localVariables[index];
- }
-
- /* (non-Javadoc)
- * @see org.drools.clp.ExecutionContext#setLocalVariable(int, org.drools.clp.ValueHandler)
- */
- public void setLocalVariable(int index,
- ValueHandler valueHandler) {
- this.localVariables[index] = valueHandler;
- }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionEngine.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExecutionEngine.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,11 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-
-public interface ExecutionEngine {
- public void addFunction(FunctionCaller function);
-
- public VariableValueHandler createLocalVariable(String identifier);
-
- public FunctionCaller[] getFunctions();
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExpressionExecutionEngine.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExpressionExecutionEngine.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ExpressionExecutionEngine.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,21 +0,0 @@
-package org.drools.clp;
-
-public class ExpressionExecutionEngine { //implements Consequence, ReturnValueExpression, PredicateExpression {
- //private Map variableMap = new HashMap();
-
- private Function function;
- private int localVariableSize;
-
- public ExpressionExecutionEngine() {
-
- }
-
- public ExpressionExecutionEngine(Function function) {
- this.function = function;
- }
-
- public void setFunction(Function function) {
- this.function = function;
- }
-
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Function.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Function.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Function.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,19 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-
-public interface Function { //extends ValueHandler {
- public ValueHandler execute(ValueHandler[] args,
- ExecutionContext context);
-
- public String getName();
-
- public void initCallback(BuildContext context);
-
- public ValueHandler addParameterCallback(int index,
- FunctionCaller caller,
- ValueHandler valueHandler,
- BuildContext context);
-
- public LispList createList(int index);
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionDelegator.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionDelegator.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionDelegator.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,67 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-
-public class FunctionDelegator
- implements
- Function {
- private Function function;
- private String name;
-
- public FunctionDelegator(String name) {
- this.name = name;
- }
-
- public FunctionDelegator(Function function) {
- this.function = function;
- }
-
- public void setFunction(Function function) {
- this.function = function;
- }
-
- public Function getFunction() {
- return this.function;
- }
-
- public ValueHandler addParameterCallback(int index,
- FunctionCaller caller,
- ValueHandler valueHandler,
- BuildContext context) {
- if ( this.function == null ) {
- caller.addParameter( valueHandler );
- } else {
- valueHandler = this.function.addParameterCallback( 0,
- caller,
- valueHandler,
- context );
- }
- return valueHandler;
- }
-
- public void initCallback(BuildContext context) {
- this.function.initCallback( context );
- }
-
- public ValueHandler execute(ValueHandler[] args,
- ExecutionContext context) {
- if ( this.function == null ) {
- throw new RuntimeException( "Unable to find and bind Function '" + this.name + "'" );
- }
- return function.execute( args,
- context );
- }
-
- public String getName() {
- return this.function == null ? this.name : function.getName();
- }
-
- public LispList createList(int index) {
- return this.function.createList( index );
- }
-
- public String toString() {
- return "[FunctionDelegate " + this.function + "]";
- }
-
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionRegistry.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionRegistry.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/FunctionRegistry.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,83 +0,0 @@
-package org.drools.clp;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-
-public class FunctionRegistry {
- public Map functions;
-
- public BuiltinFunctions builtin;
-
- //public Map variables;
-
- public FunctionRegistry(BuiltinFunctions builtin) {
- this.functions = new HashMap();
-
- this.builtin = builtin;
-
-// try {
-// loadFunctions();
-// } catch ( IOException e ) {
-// throw new RuntimeException( e );
-// } catch ( ClassNotFoundException e ) {
-// throw new RuntimeException( e );
-// }
- }
-
-// 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;
-//
-// try {
-// while ( (line = reader.readLine()) != null ) {
-// Class clazz = getClass().getClassLoader().loadClass( line );
-// Function function = (Function) clazz.newInstance();
-// addFunction( function );
-// }
-// } 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 );
-
- if ( function == null ) {
- function = this.builtin.getFunction( name );
- if ( function == null ) {
- function = new FunctionDelegator( name );
- } else {
- function = new FunctionDelegator(function);
- }
- this.functions.put( name,
- function );
- }
- return function;
- }
-
- public void addFunction(Function function) {
- FunctionDelegator delegator = (FunctionDelegator) this.functions.get( function.getName() );
-
- if ( delegator == null ) {
- delegator = new FunctionDelegator( function.getName() );
- this.functions.put( function.getName(),
- delegator );
- }
- delegator.setFunction( function );
- }
-
- public int getFunctionSize() {
- return this.functions.size();
- }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispData.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispData.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispData.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,39 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.ListValueHandler;
-
-public class LispData
- implements
- LispList {
-
- private ListValueHandler list;
- private BuildContext context;
-
- public LispData() {
- this.list = new ListValueHandler();
- }
-
- public void add(ValueHandler valueHandler) {
- this.list.add( valueHandler );
- }
-
- public LispList createList() {
- LispList list = new LispForm2();
-
- list.setContext( this.context );
-
- return list;
- }
-
- public ValueHandler getValueHandler() {
- return this.list;
- }
-
- public void setContext(BuildContext context) {
- this.context = context;
- }
-
- public ValueHandler[] toArray() {
- return this.list.getList();
- }
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispForm2.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispForm2.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispForm2.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,72 +0,0 @@
-package org.drools.clp;
-
-import org.drools.clp.valuehandlers.FunctionCaller;
-
-public class LispForm2
- implements
- LispList {
- private BuildContext context;
- private FunctionCaller caller;
-
- public LispForm2(BuildContext context) {
- this.context = context;
- }
-
- public LispForm2() {
- }
-
- public ValueHandler getValueHandler() {
- return this.caller;
- }
-
- public void add(ValueHandler valueHandler) {
- if ( this.caller == null ) {
- // we know this is a string literal, so can use null for the context
- 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();
- if ( delegator.getFunction() != null ) {
- delegator.getFunction().initCallback( context );
- }
-
- } else {
- // we can only execute callbacks on known functions
- 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;
- }
- delegator.getFunction().addParameterCallback( length,
- this.caller,
- valueHandler,
- context );
- }
- //this.caller.addParameter( valueHandler );
-
- }
- }
-
- public LispList createList() {
- int length;
- if ( this.caller == null || this.caller.getParameters() == null ) {
- length = 0;
- } else {
- length = (this.caller == null) ? 0 : this.caller.getParameters().length;
- }
-
- LispList list = this.caller.createList( length );
-
- list.setContext( this.context );
-
- return list;
- }
-
- public void setContext(BuildContext context) {
- this.context = context;
- }
-
-}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispList.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispList.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/LispList.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,12 +0,0 @@
-package org.drools.clp;
-
-public interface LispList {
- public void add(ValueHandler valueHandler);
-
- public LispList createList();
-
- public ValueHandler getValueHandler();
-
- public void setContext(BuildContext context);
-
-}
Modified: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ParserHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ParserHandler.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ParserHandler.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,12 +1,17 @@
package org.drools.clp;
+import org.drools.clp.mvel.LispForm;
+import org.drools.lang.descr.FunctionDescr;
+import org.drools.lang.descr.ImportDescr;
import org.drools.lang.descr.RuleDescr;
-public interface ParserHandler {
+public interface ParserHandler {
- //public void functionHandler(RuleDescr ruleDescr);
+ public void importHandler(ImportDescr descr);
- public void ruleDescrHandler(RuleDescr ruleDescr);
+ public void functionHandler(FunctionDescr ruleDescr);
- public void lispFormHandler(ValueHandler valueHandler);
+ public void ruleHandler(RuleDescr ruleDescr);
+
+ public void lispFormHandler(LispForm lispForm);
}
Modified: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Shell.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Shell.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/Shell.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -39,7 +39,7 @@
BuildContext,
ExecutionContext {
private static final long serialVersionUID = 1L;
- private FunctionRegistry registry;
+ private XFunctionRegistry registry;
private ValueHandler[] variables;
private Map vars = new HashMap();
@@ -63,7 +63,7 @@
this.imports = new HashSet();
- this.registry = new FunctionRegistry( BuiltinFunctions.getInstance() );
+ this.registry = new XFunctionRegistry( BuiltinFunctions.getInstance() );
}
public void evalReader(Reader reader) {
@@ -184,7 +184,7 @@
this.variables[index] = valueHandler;
}
- public FunctionRegistry getFunctionRegistry() {
+ public XFunctionRegistry getFunctionRegistry() {
return this.registry;
}
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ValueHandler.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/ValueHandler.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,69 +0,0 @@
-package org.drools.clp;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-public interface ValueHandler {
- public int getValueType(ExecutionContext context);
-
- public void setValue(ExecutionContext context,
- Object object);
-
- /**
- *
- */
- 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;
-
-
- public boolean equals(ValueHandler other, ExecutionContext context);
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/VariableValueHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/VariableValueHandler.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/java/org/drools/clp/VariableValueHandler.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,7 +0,0 @@
-package org.drools.clp;
-
-public interface VariableValueHandler
- extends
- ValueHandler {
- public String getIdentifier();
-}
Modified: labs/jbossrules/trunk/drools-clips/src/main/resources/org/drools/clp/CLPMVEL.g
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/main/resources/org/drools/clp/CLPMVEL.g 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/main/resources/org/drools/clp/CLPMVEL.g 2008-01-29 07:47:57 UTC (rev 18181)
@@ -2,10 +2,10 @@
@parser::header {
package org.drools.clp;
-
+
+ import org.drools.clp.*;
import org.drools.clp.mvel.*;
- import org.drools.clp.valuehandlers.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
@@ -23,14 +23,10 @@
private String source = "unknown";
private int lineOffset = 0;
private DescrFactory factory = new DescrFactory();
+ private MVELBuildContext context;
private boolean parserDebug = false;
- private FunctionRegistry functionRegistry;
private Location location = new Location( Location.LOCATION_UNKNOWN );
- public void setFunctionRegistry(FunctionRegistry functionRegistry) {
- this.functionRegistry = functionRegistry;
- }
-
public void setParserDebug(boolean parserDebug) {
this.parserDebug = parserDebug;
}
@@ -225,16 +221,31 @@
;
*/
-eval_script[Shell shell]
- : /*( i=importDescr{ shell.importDescrHandler( i ); }
- | r=defrule { shell.ruleDescrHandler( r ); }
- //e=execution_block { parserHandler.lispFormHandler( e ); }
- | fc=lisp_list[shell, new LispForm(shell) ] { shell.lispFormHandler(fc); }
- )**/
+eval[ParserHandler handler, MVELBuildContext context]
+ :
+ { this.context = context; }
+ ( i=importDescr{ handler.importHandler( i ); }
+ | f=deffunction { handler.functionHandler( f ); }
+ | r=defrule { handler.ruleHandler( r ); }
+ | form=lisp_form { handler.lispFormHandler( form ); }
+ )
;
+ /*
+eval_sExpressions[MVELClipsContext context] returns[List<SExpression> list]
+ @init {
+ list = new ArrayList<SExpression>();
+ }
+ :
+ ( a=lisp_list { list.add( a ); }
+ | a=deffunction { FunctionHandlers.dump(a, null, context); }
+ )*
+// { sExpressions = ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ); }
+ ;
+ */
+
importDescr returns[ImportDescr importDescr]
- : LEFT_PAREN 'import' importName=NAME { importDescr = new ImportDescr( importName.getText() ); }RIGHT_PAREN
+ : LEFT_PAREN 'import' importName=NAME { importDescr = new ImportDescr( importName.getText() ); } RIGHT_PAREN
;
/*
@@ -281,6 +292,22 @@
RIGHT_PAREN
;
*/
+
+deffunction returns[FunctionDescr functionDescr]
+ @init {
+ List content = null;
+ functionDescr = null;
+ }
+ : LEFT_PAREN
+ t=DEFFUNCTION //{ list.add( new SymbolLispAtom( t.getText() ) ); } //deffunction
+ name=lisp_atom //name
+ params=lisp_form // params
+ (form=lisp_form { if ( content == null ) content = new ArrayList(); content.add( form ); } )+
+ RIGHT_PAREN
+ { functionDescr = FunctionHandlers.createFunctionDescr( name, params, content ); }
+ //{ sExpression = new LispForm( ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ) ); }
+ ;
+
defrule returns [RuleDescr rule]
@init {
rule = null;
@@ -332,7 +359,7 @@
'=>'
- t=lisp_list { rule.setConsequence( t ); }
+ t=lisp_form { rule.setConsequence( t ); }
RIGHT_PAREN
;
@@ -426,7 +453,7 @@
eval_ce[ConditionalElementDescr in_ce, Set declarations]
: LEFT_PAREN
TEST
- t=lisp_list { EvalDescr evalDescr = new EvalDescr(); evalDescr.setContent( t ); in_ce.addDescr( evalDescr ); }
+ t=lisp_form { EvalDescr evalDescr = new EvalDescr(); evalDescr.setContent( t ); in_ce.addDescr( evalDescr ); }
RIGHT_PAREN
;
@@ -572,14 +599,14 @@
predicate_constraint[RestrictionConnectiveDescr rc, String op, ConditionalElementDescr base]
: COLON
- t=lisp_list { $rc.addRestriction( new PredicateDescr( t ) ); }
+ t=lisp_form { $rc.addRestriction( new PredicateDescr( t ) ); }
;
return_value_restriction[String op, RestrictionConnectiveDescr rc]
: EQUALS
- t=lisp_list {rc.addRestriction( new ReturnValueRestrictionDescr (op, t ) ); }
+ t=lisp_form {rc.addRestriction( new ReturnValueRestrictionDescr (op, t ) ); }
;
//will add a declaration field binding, if this is the first time the name is used
@@ -608,52 +635,44 @@
}
;
-
-eval_sExpressions returns[List<SExpression> list]
+/*
+eval_sExpressions[MVELClipsContext context] returns[List<SExpression> list]
@init {
list = new ArrayList<SExpression>();
}
:
- (a=lisp_list { list.add( a ); })*
+ ( a=lisp_list { list.add( a ); }
+ | a=deffunction { FunctionHandlers.dump(a, null, context); }
+ )*
// { sExpressions = ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ); }
;
-
-lisp_list returns[SExpression sExpression]
+*/
+lisp_form returns[LispForm lispForm]
@init {
List list = new ArrayList();
- sExpression = null;
+ lispForm = null;
}
: LEFT_PAREN
(
t=NAME { list.add( new SymbolLispAtom( t.getText() ) ); }
|
- t=VAR { list.add( new VariableLispAtom( t.getText() ) ); }
+ t=VAR { list.add( new VariableLispAtom( t.getText(), context ) ); }
)
( a=lisp_atom { list.add( a ); }
- | a=lisp_list { list.add( a ); }
+ | l=lisp_form { list.add( l ); }
)*
RIGHT_PAREN
- { sExpression = new LispForm( ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ) ); }
+ { lispForm = new LispForm( ( SExpression[] ) list.toArray( new SExpression[ list.size () ] ) ); }
;
lisp_atom returns[SExpression sExpression]
@init {
sExpression = null;
}
- :
- /*(
- t=FLOAT { sExpression = new LispAtom2( t.getText() ); }
- | t=INT { sExpression = new LispAtom2( t.getText() ); }
- | t=BOOL { sExpression = new LispAtom2( t.getText() ); }
- | t=NULL { sExpression = new LispAtom2( null ); }
- | t=STRING { sExpression = new LispAtom2( getString( t ) ); }
- | t=NAME { sExpression = new LispAtom2( t.getText() ); }
-
- )*/
-
+ :
(
- t=VAR { sExpression = new VariableLispAtom( t.getText() ); }
+ t=VAR { sExpression = new VariableLispAtom( t.getText(), context ); }
| t=STRING { sExpression = new StringLispAtom( getString( t ) ); }
| t=FLOAT { sExpression = new FloatLispAtom( t.getText() ); }
| t=INT { sExpression = new IntLispAtom( t.getText() ); }
@@ -686,7 +705,7 @@
;
DEFRULE : 'defrule';
-//DEFFUNCTION : 'deffunction';
+DEFFUNCTION : 'deffunction';
OR : 'or';
AND : 'and';
NOT : 'not';
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/BlockExecutionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/BlockExecutionTest.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/BlockExecutionTest.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -15,10 +15,10 @@
public class BlockExecutionTest extends TestCase {
- FunctionRegistry registry;
+ XFunctionRegistry registry;
public void setUp() {
- this.registry = new FunctionRegistry( BuiltinFunctions.getInstance() );
+ this.registry = new XFunctionRegistry( BuiltinFunctions.getInstance() );
}
public void testAddWithModify() {
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/CompiledFunctionsTest.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/CompiledFunctionsTest.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/CompiledFunctionsTest.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -326,7 +326,7 @@
private CLPParser newParser(final TokenStream tokenStream) {
final CLPParser p = new CLPParser( tokenStream );
- p.setFunctionRegistry( new FunctionRegistry( BuiltinFunctions.getInstance() ) );
+ p.setFunctionRegistry( new XFunctionRegistry( BuiltinFunctions.getInstance() ) );
//p.setParserDebug( true );
return p;
}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/FunctionFactoryTest.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/FunctionFactoryTest.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/FunctionFactoryTest.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -4,7 +4,7 @@
public class FunctionFactoryTest extends TestCase {
public void testInit() {
- FunctionRegistry factory = new FunctionRegistry( BuiltinFunctions.getInstance() );
+ XFunctionRegistry factory = new XFunctionRegistry( BuiltinFunctions.getInstance() );
// make sure some core functions are there
assertSame( "+", factory.getFunction( "+" ).getName() );
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/LhsClpParserTest.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/LhsClpParserTest.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/LhsClpParserTest.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -34,10 +34,10 @@
private CLPParser parser;
- FunctionRegistry registry;
+ XFunctionRegistry registry;
public void setUp() {
- this.registry = new FunctionRegistry( BuiltinFunctions.getInstance() );
+ this.registry = new XFunctionRegistry( BuiltinFunctions.getInstance() );
}
protected void tearDown() throws Exception {
@@ -419,7 +419,7 @@
private CLPParser newParser(final TokenStream tokenStream) {
final CLPParser p = new CLPParser( tokenStream );
- p.setFunctionRegistry( new FunctionRegistry( BuiltinFunctions.getInstance() ) );
+ p.setFunctionRegistry( new XFunctionRegistry( BuiltinFunctions.getInstance() ) );
//p.setParserDebug( true );
return p;
}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/BaseInfixFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/BaseInfixFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/BaseInfixFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -3,7 +3,7 @@
public abstract class BaseInfixFunction implements Function {
public abstract String getMappedSymbol();
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
appendable.append("(");
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/CreateListFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/CreateListFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/CreateListFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
appendable.append("[");
Deleted: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/DeffunctionFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/DeffunctionFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/DeffunctionFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,48 +0,0 @@
-package org.drools.clp.mvel;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.mvel.MVEL;
-import org.mvel.compiler.CompiledExpression;
-import org.mvel.compiler.ExpressionCompiler;
-import org.mvel.util.CompilerTools;
-
-public class DeffunctionFunction implements Function {
- private static final String name = "deffunction";
-
- public String getName() {
- return name;
- }
-
- public void dump(LispForm lispForm, Appendable appendablex, MVELClipsContext context) {
- SExpression[] sExpressions = lispForm.getSExpressions();
-
- String functionName = ( (LispAtom) sExpressions[1]).getValue().trim();
-
- Appendable functionText = new StringBuilderAppendable();
-
- functionName = functionName.substring( 1, functionName.length() -1 );
-
- functionText.append( "function " + functionName + "(" );
-
- LispForm params = (LispForm) sExpressions[2];
- for ( int i = 0, length = params.getSExpressions().length; i < length; i++ ) {
- functionText.append( ( (LispAtom) params.getSExpressions()[i]).getValue() );
- if ( i < length-1 ) {
- functionText.append( ", " );
- }
- }
-
- functionText.append( ") {\n" );
- FunctionHandlers.dump( sExpressions[3], functionText, context );
- functionText.append( "}" );
-
- ExpressionCompiler compiler = new ExpressionCompiler( functionText.toString() );
- Serializable s1 = compiler.compile();
- Map<String, org.mvel.ast.Function> map = CompilerTools.extractAllDeclaredFunctions((CompiledExpression) s1);
- for ( org.mvel.ast.Function function : map.values() ) {
- context.addFunction( function );
- }
- }
-}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/Function.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/Function.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/Function.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -4,6 +4,6 @@
public abstract String getName();
- public abstract void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context);
+ public abstract void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context);
}
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionContext.java (rev 0)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -0,0 +1,15 @@
+package org.drools.clp.mvel;
+
+import java.util.Map;
+
+import org.mvel.ast.Function;
+
+public interface FunctionContext {
+
+ public abstract void addFunction(Function function);
+
+ public abstract boolean removeFunction(String functionName);
+
+ public abstract Map<String, Function> getFunctions();
+
+}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionHandlers.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionHandlers.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/FunctionHandlers.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,8 +1,11 @@
package org.drools.clp.mvel;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import org.drools.lang.descr.FunctionDescr;
+
public class FunctionHandlers {
public static final FunctionHandlers INSTANCE = new FunctionHandlers();
@@ -24,7 +27,7 @@
this.map.put( function.getName(), function );
}
- public static void dump(SExpression sExpression, Appendable appendable, MVELClipsContext context) {
+ public static void dump(SExpression sExpression, Appendable appendable, MVELBuildContext context) {
if ( sExpression instanceof LispAtom ) {
appendable.append( ( ( LispAtom ) sExpression).getValue() );
} else {
@@ -47,5 +50,23 @@
}
}
+ public static FunctionDescr createFunctionDescr(SExpression name, LispForm params, List<SExpression> content) {
+ FunctionDescr descr = new FunctionDescr(((LispAtom)name).getValue(), "Object" );
+ for ( SExpression sExpr : params.getSExpressions() ) {
+ String param = ((LispAtom)sExpr).getValue().trim();
+ if ( param.charAt( 0 ) == '"' ) {
+ param = param.substring( 1 );
+ }
+
+ if ( param.charAt( param.length()-1 ) == '"' ) {
+ param = param.substring( 0, param.length()-1 );
+ }
+ descr.addParameter( "Object", param );
+ }
+
+ descr.setContent( content );
+
+ return descr;
+ }
}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/IfFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/IfFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/IfFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
appendable.append( "if " );
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/LispForm.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/LispForm.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/LispForm.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -3,7 +3,8 @@
*/
package org.drools.clp.mvel;
-public class LispForm implements SExpression {
+public class LispForm
+ implements SExpression {
private SExpression[] sExpressions;
public LispForm(SExpression[] sExpressions) {
@@ -28,7 +29,9 @@
// builder.append(")");
// return builder.toString();
// }
-
+ public int size() {
+ return this.sExpressions.length;
+ }
public String toString() {
StringBuilder builder = new StringBuilder();
Added: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELBuildContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELBuildContext.java (rev 0)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELBuildContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -0,0 +1,9 @@
+package org.drools.clp.mvel;
+
+import java.util.Map;
+
+public interface MVELBuildContext {
+ Map<String, String> getVariableNameMap();
+
+ String makeValid(String var);
+}
Deleted: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELClipsContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELClipsContext.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/MVELClipsContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,25 +0,0 @@
-package org.drools.clp.mvel;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.mvel.ast.Function;
-
-public class MVELClipsContext {
- private Map<String, Function> map;
-
- public MVELClipsContext() {
- this.map = new HashMap<String, Function>();
- }
- public void addFunction(Function function) {
- this.map.put( function.getAbsoluteName(), function );
- }
-
- public boolean removeFunction(String functionName) {
- return ( this.map.remove( functionName ) != null );
- }
-
- public Map<String, Function> getFunctions() {
- return this.map;
- }
-}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ModifyFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ModifyFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ModifyFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
appendable.append("modify (" + ( (LispAtom) lispForm.getSExpressions()[1]).getValue() + ") {");
Added: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintRouterContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintRouterContext.java (rev 0)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintRouterContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -0,0 +1,16 @@
+package org.drools.clp.mvel;
+
+import java.io.PrintStream;
+import java.util.Map;
+
+import org.mvel.ast.Function;
+
+public interface PrintRouterContext {
+
+ public abstract void addRouter(String name, PrintStream out);
+
+ public abstract boolean removeRouter(String name);
+
+ public abstract Map<String, PrintStream> getRouters();
+
+}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintoutFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintoutFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrintoutFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -9,9 +9,9 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
- appendable.append( "routers.get(" + ( ( LispAtom ) lispForm.getSExpressions()[route]).getValue()+ ").print(" );
+ appendable.append( "printrouters.get(" + ( ( LispAtom ) lispForm.getSExpressions()[route]).getValue()+ ").print(" );
//appendable.append( "routers.get(" + ( ( LispAtom2 ) lispForm.getSExpressions()[route]).getValue()+ ").print(" );
for ( int i = 2, length = sExpressions.length; i < length; i++) {
FunctionHandlers.dump( sExpressions[i], appendable, context );
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrognFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrognFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/PrognFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
Function createList = FunctionHandlers.getInstance().getFunction( "create$" );
SExpression[] sExpressions = lispForm.getSExpressions();
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ReturnFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ReturnFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/ReturnFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
appendable.append( "return " );
FunctionHandlers.dump( lispForm.getSExpressions()[1], appendable, context );
appendable.append( ";\n" );
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/SwitchFunction.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/SwitchFunction.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/SwitchFunction.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -7,7 +7,7 @@
return name;
}
- public void dump(LispForm lispForm, Appendable appendable, MVELClipsContext context) {
+ public void dump(LispForm lispForm, Appendable appendable, MVELBuildContext context) {
SExpression[] sExpressions = lispForm.getSExpressions();
appendable.append( "switchvar = " );
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/TestMVEL.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/TestMVEL.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/TestMVEL.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -1,31 +1,38 @@
package org.drools.clp.mvel;
-import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Reader;
+import java.io.Serializable;
+import java.io.StringReader;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import junit.framework.TestCase;
import org.antlr.runtime.ANTLRReaderStream;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.Lexer;
-import org.antlr.runtime.TokenStream;
import org.drools.clp.CLPMVELLexer;
import org.drools.clp.CLPMVELParser;
+import org.drools.clp.ParserHandler;
+import org.drools.lang.descr.FunctionDescr;
+import org.drools.lang.descr.ImportDescr;
+import org.drools.lang.descr.RuleDescr;
import org.mvel.MVEL;
+import org.mvel.ast.Function;
+import org.mvel.compiler.CompiledExpression;
+import org.mvel.compiler.ExpressionCompiler;
+import org.mvel.util.CompilerTools;
public class TestMVEL extends TestCase {
- private Map vars;
private ByteArrayOutputStream baos;
- private MVELClipsContext context;
-
+
+ Shell shell = new Shell();
+
public void setUp() {
FunctionHandlers handlers = FunctionHandlers.getInstance();
handlers.registerFunction( new PlusFunction() );
@@ -39,169 +46,272 @@
handlers.registerFunction( new MoreThanFunction() );
handlers.registerFunction( new EqFunction() );
handlers.registerFunction( new SwitchFunction() );
- handlers.registerFunction( new DeffunctionFunction() );
+ //handlers.registerFunction( new DeffunctionFunction() );
handlers.registerFunction( new ReturnFunction() );
-
- baos = new ByteArrayOutputStream();
- vars = new HashMap();
- Map routers = new HashMap();
- routers.put( "t", new PrintStream( baos ) );
- vars.put( "routers", routers );
-
- context = new MVELClipsContext();
+
+ this.baos = new ByteArrayOutputStream();
+ shell.addRouter( "t",
+ new PrintStream( baos ) );
}
- public void test1() {
- String expr = "(* (+ 4 4 ) 2) (create$ 10 20 (+ 10 10) a) (modify ?p (name mark) (location \"london\")(age (+ 16 16) ) ) (printout t a b c (+ 4 4) )";
-
- SExpression[] lisplists = evalString( expr );
+ // public void test1() {
+ // String expr = "(* (+ 4 4 ) 2) (create$ 10 20 (+ 10 10) a) (modify ?p (name mark) (location \"london\")(age (+ 16 16) ) ) (printout t a b c (+ 4 4) )";
+ //
+ // SExpression[] lisplists = evalString( expr );
+ //
+ // StringBuilderAppendable appendable = new StringBuilderAppendable();
+ // MVELClipsContext context = new MVELClipsContext();
+ // for ( SExpression sExpression : lisplists ) {
+ // FunctionHandlers.dump( sExpression, appendable, context );
+ // }
+ //
+ // System.out.println( appendable );
+ // }
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- MVELClipsContext context = new MVELClipsContext();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
-
- System.out.println( appendable );
- }
-
public void testProgn() {
String expr = "(progn (?x (create$ 10 20 30) ) (printout t ?x) ) )";
-
- SExpression[] lisplists = evalString( expr );
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
-
- eval( appendable.toString() );
- assertEquals( "102030", new String( baos.toByteArray() ));
- }
-
+ this.shell.eval( expr );
+
+ assertEquals( "102030",
+ new String( baos.toByteArray() ) );
+ }
+
public void testIf() {
String expr = "(if (< 1 3) then (printout t hello) (printout t hello) )";
-
- SExpression[] lisplists = evalString( expr );
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
-
- eval( appendable.toString() );
- assertEquals( "hellohello", new String( baos.toByteArray() ));
+ this.shell.eval( expr );
+
+ assertEquals( "hellohello",
+ new String( baos.toByteArray() ) );
}
-
+
public void testIfElse() {
String expr = "(if (eq 1 3) then (printout t hello) (printout t 1) else (printout t hello) (printout t 2))";
-
- SExpression[] lisplists = evalString( expr );
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
-
- eval( appendable.toString() );
- assertEquals( "hello2", new String( baos.toByteArray() ) );
- }
-
+ this.shell.eval( expr );
+
+ assertEquals( "hello2",
+ new String( baos.toByteArray() ) );
+ }
+
public void testSwitch() throws IOException {
String expr = "(switch (?x) (case a then (printout t hello)(printout t 1)) (case b then (printout t hello)(printout t 2)) (default (printout t hello)(printout t 3)) )";
-
- SExpression[] lisplists = evalString( expr );
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
-
// check case a
- vars.put("_Q_x", "a" );
- MVEL.eval( appendable.toString(), vars);
- assertEquals( "hello1", new String( baos.toByteArray() ) );
-
+ this.shell.addVariable( "?x",
+ "a" );
+ this.shell.eval( expr );
+ assertEquals( "hello1",
+ new String( baos.toByteArray() ) );
+
// check default
- vars.put("_Q_x", "M" );
- MVEL.eval( appendable.toString(), vars);
- assertEquals( "hello1hello3", new String( baos.toByteArray() ) );
-
+ this.shell.addVariable( "?x",
+ "M" );
+ this.shell.eval( expr );
+ assertEquals( "hello1hello3",
+ new String( baos.toByteArray() ) );
+
// check case b
- vars.put("_Q_x", "b" );
- eval( appendable.toString() );
- assertEquals( "hello1hello3hello2", new String( baos.toByteArray() ) );
+ this.shell.addVariable( "?x",
+ "b" );
+ this.shell.eval( expr );
+ assertEquals( "hello1hello3hello2",
+ new String( baos.toByteArray() ) );
}
-
-
-
- public void testDeffunction() {
+
+ public void testDeffunction() {
String function = "(deffunction max (?a ?b) (if (> ?a ?b) then (return ?a) else (return ?b) ) )";
-
-
- SExpression[] lisplists = evalString( function );
- StringBuilderAppendable appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
- eval( appendable.toString() );
-
+ this.shell.eval( function );
+
String expr = "(if (eq (max 3 5) 5) then (printout t hello) )";
- lisplists = evalString( expr );
- appendable = new StringBuilderAppendable();
- for ( SExpression sExpression : lisplists ) {
- FunctionHandlers.dump( sExpression, appendable, context );
- }
- eval( appendable.toString() );
-
- // check case a
- vars.put("_Q_a", "10" );
- vars.put("_Q_b", "20" );
- assertEquals( "hello", new String( baos.toByteArray() ) );
+ this.shell.eval( expr );
+ assertEquals( "hello",
+ new String( baos.toByteArray() ) );
+
+ expr = "(if (eq (max ?a ?b) 5) then (printout t hello) )";
+ this.shell.addVariable( "?a",
+ "3" );
+ this.shell.addVariable( "?b",
+ "5" );
+ this.shell.eval( expr );
+ assertEquals( "hellohello",
+ new String( baos.toByteArray() ) );
}
-
- public void eval(String string) {
- for ( org.mvel.ast.Function function : context.getFunctions().values() ) {
- this.vars.put( function.getAbsoluteName(), function );
+
+ public static class Shell
+ implements
+ ParserHandler,
+ VariableContext,
+ FunctionContext,
+ PrintRouterContext,
+ MVELBuildContext {
+ private Map<String, Object> vars;
+ private Map<String, String> varNameMap;
+
+ public Shell() {
+ this.vars = new HashMap<String, Object>();
+ this.varNameMap = new HashMap<String, String>();
}
- MVEL.eval( string, vars);
- }
- public SExpression[] evalReader(Reader reader) {
- try {
- CLPMVELParser parser = new CLPMVELParser( new CommonTokenStream( new CLPMVELLexer( new ANTLRReaderStream( reader ) ) ) );
- return evalParser( parser );
- } catch ( Exception e ) {
- throw new RuntimeException( "Unable to parser Reader",
- e );
+ public void functionHandler(FunctionDescr ruleDescr) {
+ Appendable builder = new StringBuilderAppendable();
+
+ // strip lead/trailing quotes
+ String name = ruleDescr.getName().trim();
+ if ( name.charAt( 0 ) == '"' ) {
+ name = name.substring( 1 );
+ }
+
+ if ( name.charAt( name.length() - 1 ) == '"' ) {
+ name = name.substring( 0,
+ name.length() - 1 );
+ }
+ builder.append( "function " + name + "(" );
+
+ for ( int i = 0, length = ruleDescr.getParameterNames().size(); i < length; i++ ) {
+ builder.append( ruleDescr.getParameterNames().get( i ) );
+ if ( i < length - 1 ) {
+ builder.append( ", " );
+ }
+ }
+
+ builder.append( ") {\n" );
+ List list = (List) ruleDescr.getContent();
+ for ( Iterator it = list.iterator(); it.hasNext(); ) {
+ FunctionHandlers.dump( (LispForm) it.next(),
+ builder,
+ this );
+ }
+ builder.append( "}" );
+
+ ExpressionCompiler compiler = new ExpressionCompiler( builder.toString() );
+ Serializable s1 = compiler.compile();
+ Map<String, org.mvel.ast.Function> map = CompilerTools.extractAllDeclaredFunctions( (CompiledExpression) s1 );
+ for ( org.mvel.ast.Function function : map.values() ) {
+ addFunction( function );
+ }
+
}
- }
- public SExpression[] evalString(String text) {
- CLPMVELParser parser = new CLPMVELParser( newTokenStream( newLexer( newCharStream( text ) ) ) );
- return evalParser( parser );
- }
+ public void importHandler(ImportDescr descr) {
+ // TODO Auto-generated method stub
- private SExpression[] evalParser(CLPMVELParser parser) {
- try {
- List list = parser.eval_sExpressions();
- return (SExpression[]) list.toArray( new SExpression[list.size()] );
- } catch ( Exception e ) {
- throw new RuntimeException( e );
}
- //parser.setF
- }
+ public void lispFormHandler(LispForm lispForm) {
+ StringBuilderAppendable appendable = new StringBuilderAppendable();
+ FunctionHandlers.dump( lispForm,
+ appendable,
+ this );
+ MVEL.eval( appendable.toString(),
+ this.vars );
- private CharStream newCharStream(final String text) {
- return new ANTLRStringStream( text );
- }
+ }
- private CLPMVELLexer newLexer(final CharStream charStream) {
- return new CLPMVELLexer( charStream );
+ public void ruleHandler(RuleDescr ruleDescr) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void eval(String string) {
+ eval( new StringReader( string ) );
+ }
+
+ public void eval(Reader reader) {
+ CLPMVELParser parser;
+ try {
+ parser = new CLPMVELParser( new CommonTokenStream( new CLPMVELLexer( new ANTLRReaderStream( reader ) ) ) );
+ parser.eval( this,
+ this );
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ public void addFunction(Function function) {
+ this.vars.put( function.getAbsoluteName(),
+ function );
+ }
+
+ public boolean removeFunction(String functionName) {
+ return (this.vars.remove( functionName ) != null);
+ }
+
+ public Map<String, Function> getFunctions() {
+ Map<String, Function> map = new HashMap<String, Function>();
+ for ( Iterator it = this.vars.entrySet().iterator(); it.hasNext(); ) {
+ Entry entry = (Entry) it.next();
+ if ( entry.getValue() instanceof Function ) {
+ map.put( (String) entry.getKey(),
+ (Function) entry.getValue() );
+ }
+ }
+ return map;
+ }
+
+ public void addRouter(String name,
+ PrintStream out) {
+
+ Map routers = (Map) this.vars.get( "printrouters" );
+ if ( routers == null ) {
+ routers = new HashMap();
+ this.vars.put( "printrouters",
+ routers );
+ }
+ routers.put( name,
+ out );
+
+ }
+
+ public boolean removeRouter(String name) {
+ return (this.vars.remove( name ) != null);
+ }
+
+ public Map<String, PrintStream> getRouters() {
+ Map<String, PrintStream> map = new HashMap<String, PrintStream>();
+ for ( Iterator it = this.vars.entrySet().iterator(); it.hasNext(); ) {
+ Entry entry = (Entry) it.next();
+ if ( entry.getValue() instanceof Function ) {
+ map.put( (String) entry.getKey(),
+ (PrintStream) entry.getValue() );
+ }
+ }
+ return map;
+ }
+
+ public void addVariable(String name,
+ Object value) {
+ String temp = this.varNameMap.get( name );
+ if ( temp == null ) {
+ temp = makeValid( name );
+ if ( !temp.equals( name ) ) {
+ this.varNameMap.put( name,
+ temp );
+ }
+ }
+ this.vars.put( temp,
+ value );
+ }
+
+ public void removeVariable(String name) {
+ String temp = this.varNameMap.get( name );
+ if ( temp != null ) {
+ name = temp;
+ }
+ this.vars.remove( name );
+ }
+
+ public Map<String, String> getVariableNameMap() {
+ return this.varNameMap;
+ }
+
+ public String makeValid(String var) {
+ var = var.replaceAll( "\\?",
+ "_Q_" );
+ return var;
+ }
+
}
- private TokenStream newTokenStream(final Lexer lexer) {
- return new CommonTokenStream( lexer );
- }
}
Added: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableContext.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableContext.java (rev 0)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableContext.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -0,0 +1,7 @@
+package org.drools.clp.mvel;
+
+public interface VariableContext {
+ public void addVariable(String name, Object value);
+
+ public void removeVariable(String name);
+}
Modified: labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableLispAtom.java
===================================================================
--- labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableLispAtom.java 2008-01-29 06:15:57 UTC (rev 18180)
+++ labs/jbossrules/trunk/drools-clips/src/test/java/org/drools/clp/mvel/VariableLispAtom.java 2008-01-29 07:47:57 UTC (rev 18181)
@@ -3,27 +3,22 @@
*/
package org.drools.clp.mvel;
-import java.util.HashMap;
import java.util.Map;
public class VariableLispAtom extends LispAtom {
- private static Map<String, String> mapping = new HashMap<String, String>();
- public VariableLispAtom(String var) {
+ public VariableLispAtom(String var, MVELBuildContext context) {
super(var);
- String temp = mapping.get( var );
+ Map<String, String> map = context.getVariableNameMap();
+ String temp = map.get( var );
if ( temp == null ) {
- temp = makeValid( var );
+ temp = context.makeValid( var );
if ( !temp.equals( var ) ) {
- mapping.put( var, temp );
+ map.put( var, temp );
}
}
setValue( temp );
}
+
- private static String makeValid(String var) {
- var = var.replaceAll( "\\?", "_Q_" );
- return var;
- }
-
}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list