incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r611261 [32/43] - in /incubator/imperius/trunk: ./ imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src...
Date Fri, 11 Jan 2008 18:57:14 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ArgumentImpl.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ArgumentImpl.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ArgumentImpl.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ArgumentImpl.java Fri Jan 11 10:56:30 2008
@@ -1,176 +1,176 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Argument;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.*;
-import org.apache.imperius.util.SPLLogger;
-
-public class ArgumentImpl implements Argument 
-{
-    private TypeInfo _type;
-    private String _name;
-   // private boolean _isArray;
-   // private String _referenceName = "";
-    private Object value=null;
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    
-    private static final String sourceClass="Argument";
-    
-    
-    public ArgumentImpl(String type, String name, boolean isArray, String referenceName) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
-        int tp = TypeConstants.getActualType(type); 
-        _type = new TypeInfo(tp,referenceName,isArray);
-        _name = name;
-       // _isArray = isArray;
-       // _referenceName = referenceName;
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
-        
-    }
-    
-    public ArgumentImpl(int type, String name, boolean isArray, String referenceName) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
-        
-        _type = new TypeInfo(type,referenceName,isArray);
-        _name = name;
-     //   _isArray = isArray;
-     //   _referenceName = referenceName;
-        
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
-        
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getReferenceTypeName()
-	 */
-    public String getReferenceTypeName() 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getReferenceTypeName");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getReferenceTypeName");
-        
-        return _type.getReferenceTypeName();
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setReferenceTypeName(java.lang.String)
-	 */
-    public void setReferenceTypeName(String name) 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setReferenceTypeName");
-        
-        _type.setReferenceTypeName( name);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setReferenceTypeName");
-        
-    }
-    
-    
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getName()
-	 */
-    public String getName() 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getName");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getName");
-        
-        return _name;
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setName(java.lang.String)
-	 */
-    public void setName(String name) 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setName");
-        
-        this._name = name;
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setName");
-        
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getType()
-	 */
-    public TypeInfo getType() 
-    {       
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-        
-        return _type;
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setType(java.lang.String)
-	 */
-    public void setType(String type) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setType");
-        int tp = TypeConstants.getActualType(type);
-        
-        this._type = new TypeInfo(tp,null,false);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setType");
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getIsArray()
-	 */
-    public boolean getIsArray()
-    {
-    	return _type.getIsArray();
-    }
-    
-    /* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setIsArray(boolean)
-	 */
-    public void setIsArray(boolean a)
-    {
-    	_type.setIsArray(a);
-    }
-
-	/* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getValue()
-	 */
-	public Object getValue() {
-		return value;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setValue(java.lang.Object)
-	 */
-	public void setValue(Object value) {
-		this.value = value;
-	}
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Argument;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.*;
+import org.apache.imperius.util.SPLLogger;
+
+public class ArgumentImpl implements Argument 
+{
+    private TypeInfo _type;
+    private String _name;
+   // private boolean _isArray;
+   // private String _referenceName = "";
+    private Object value=null;
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+    
+    private static final String sourceClass="Argument";
+    
+    
+    public ArgumentImpl(String type, String name, boolean isArray, String referenceName) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
+        int tp = TypeConstants.getActualType(type); 
+        _type = new TypeInfo(tp,referenceName,isArray);
+        _name = name;
+       // _isArray = isArray;
+       // _referenceName = referenceName;
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
+        
+    }
+    
+    public ArgumentImpl(int type, String name, boolean isArray, String referenceName) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
+        
+        _type = new TypeInfo(type,referenceName,isArray);
+        _name = name;
+     //   _isArray = isArray;
+     //   _referenceName = referenceName;
+        
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Argument");
+        
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getReferenceTypeName()
+	 */
+    public String getReferenceTypeName() 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getReferenceTypeName");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getReferenceTypeName");
+        
+        return _type.getReferenceTypeName();
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setReferenceTypeName(java.lang.String)
+	 */
+    public void setReferenceTypeName(String name) 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setReferenceTypeName");
+        
+        _type.setReferenceTypeName( name);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setReferenceTypeName");
+        
+    }
+    
+    
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getName()
+	 */
+    public String getName() 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getName");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getName");
+        
+        return _name;
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setName(java.lang.String)
+	 */
+    public void setName(String name) 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setName");
+        
+        this._name = name;
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setName");
+        
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getType()
+	 */
+    public TypeInfo getType() 
+    {       
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        
+        return _type;
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setType(java.lang.String)
+	 */
+    public void setType(String type) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setType");
+        int tp = TypeConstants.getActualType(type);
+        
+        this._type = new TypeInfo(tp,null,false);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setType");
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getIsArray()
+	 */
+    public boolean getIsArray()
+    {
+    	return _type.getIsArray();
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setIsArray(boolean)
+	 */
+    public void setIsArray(boolean a)
+    {
+    	_type.setIsArray(a);
+    }
+
+	/* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#getValue()
+	 */
+	public Object getValue() {
+		return value;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.imperius.spl.parser.statements.impl.IArgument#setValue(java.lang.Object)
+	 */
+	public void setValue(Object value) {
+		this.value = value;
+	}
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ArgumentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ConstantDefinition.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ConstantDefinition.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ConstantDefinition.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ConstantDefinition.java Fri Jan 11 10:56:30 2008
@@ -1,99 +1,99 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class ConstantDefinition 
-{
-	private String ident;
-	private Expression initExpr;
-	private SPLSymbolTable symTab;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private static final String sourceClass="ConstantDefinition";
-    
-	
-	public String getIdent() {  
-        
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getIdent");
-    
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getIdent");
-   
-		return ident;
-	}
-
-	public void setIdent(String ident) {    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setIdent");
-    
-		this.ident = ident;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setIdent");
-        
-	}
-
-	public SPLSymbolTable getSymTab() {    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-    
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-   
-		return symTab;
-	}
-
-	public void setSymTab(SPLSymbolTable symTab) {    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-    
-		this.symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-	}
-
-	public Expression getInitExpr() {    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getInitExpr");
-    
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getInitExpr");
-   
-		return initExpr;
-	}
-
-	public void setInitExpr(Expression initExpr) {    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setInitExpr");
-    
-		this.initExpr = initExpr;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setInitExpr");
-        
-	}
-
-	public ConstantDefinition(String ident, Expression iExpr, SPLSymbolTable sTab)
-	{    
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ConstantDefinition");
-    
-		this.ident = ident;
-		this.initExpr = iExpr;
-		this.symTab = sTab;
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ConstantDefinition");
-   
-	}
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class ConstantDefinition 
+{
+	private String ident;
+	private Expression initExpr;
+	private SPLSymbolTable symTab;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private static final String sourceClass="ConstantDefinition";
+    
+	
+	public String getIdent() {  
+        
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getIdent");
+    
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getIdent");
+   
+		return ident;
+	}
+
+	public void setIdent(String ident) {    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setIdent");
+    
+		this.ident = ident;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setIdent");
+        
+	}
+
+	public SPLSymbolTable getSymTab() {    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+    
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+   
+		return symTab;
+	}
+
+	public void setSymTab(SPLSymbolTable symTab) {    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+    
+		this.symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+	}
+
+	public Expression getInitExpr() {    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getInitExpr");
+    
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getInitExpr");
+   
+		return initExpr;
+	}
+
+	public void setInitExpr(Expression initExpr) {    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setInitExpr");
+    
+		this.initExpr = initExpr;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setInitExpr");
+        
+	}
+
+	public ConstantDefinition(String ident, Expression iExpr, SPLSymbolTable sTab)
+	{    
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ConstantDefinition");
+    
+		this.ident = ident;
+		this.initExpr = iExpr;
+		this.symTab = sTab;
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ConstantDefinition");
+   
+	}
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ConstantDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java Fri Jan 11 10:56:30 2008
@@ -1,126 +1,126 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-
-import java.util.ArrayList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class DeclarationStatement 
-{
-	private ArrayList constantList = new ArrayList();
-	private ArrayList macroList = new ArrayList();
-	private SPLSymbolTable symTab;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="DeclarationStatement";
-    
-	
-	public DeclarationStatement(ArrayList cList, ArrayList mList, SPLSymbolTable sTab)
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "DeclarationStatement");
-        
-		constantList = cList;
-		macroList = mList;
-		this.symTab = sTab;
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "DeclarationStatement");
-   
-	}
-
-	public ArrayList getConstantList() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getConstantList");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getConstantList");
-   
-		return constantList;
-	}
-
-	public void setConstantList(ArrayList constantList) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setConstantList");
-        
-		this.constantList = constantList;
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setConstantList");
-   
-	}
-
-	public ArrayList getMacroList() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroList");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroList");
-   
-		return macroList;
-	}
-
-	public void setMacroList(ArrayList macroList) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroList");
-
-        this.macroList = macroList;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroList");
-   
-	}
-
-	public SPLSymbolTable getSymTab() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-   
-		return symTab;
-	}
-
-	public void setSymTab(SPLSymbolTable symTab) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-
-        this.symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-   
-	}
-	
-	public void evaluate() throws SPLException
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-		for(int i=0; i<constantList.size(); i++)
-		{
-			ConstantDefinition cd = (ConstantDefinition)constantList.get(i);
-			Expression e=cd.getInitExpr();
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"constant expression "+e.toString());
-            Object result = e.evaluate();
-			String constantSymbol = cd.getIdent();
-			PropertySymbol constantSym = (PropertySymbol)symTab.getSymbol(constantSymbol);
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"constantSym name"+ constantSym.getName()+" current value:"+constantSym.getValue()+" setting value to:"+result.toString());
-            
-            constantSym.setValue(result);
-		}
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-   
-	}
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class DeclarationStatement 
+{
+	private ArrayList constantList = new ArrayList();
+	private ArrayList macroList = new ArrayList();
+	private SPLSymbolTable symTab;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="DeclarationStatement";
+    
+	
+	public DeclarationStatement(ArrayList cList, ArrayList mList, SPLSymbolTable sTab)
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "DeclarationStatement");
+        
+		constantList = cList;
+		macroList = mList;
+		this.symTab = sTab;
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "DeclarationStatement");
+   
+	}
+
+	public ArrayList getConstantList() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getConstantList");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getConstantList");
+   
+		return constantList;
+	}
+
+	public void setConstantList(ArrayList constantList) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setConstantList");
+        
+		this.constantList = constantList;
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setConstantList");
+   
+	}
+
+	public ArrayList getMacroList() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroList");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroList");
+   
+		return macroList;
+	}
+
+	public void setMacroList(ArrayList macroList) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroList");
+
+        this.macroList = macroList;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroList");
+   
+	}
+
+	public SPLSymbolTable getSymTab() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+   
+		return symTab;
+	}
+
+	public void setSymTab(SPLSymbolTable symTab) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+
+        this.symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+   
+	}
+	
+	public void evaluate() throws SPLException
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+		for(int i=0; i<constantList.size(); i++)
+		{
+			ConstantDefinition cd = (ConstantDefinition)constantList.get(i);
+			Expression e=cd.getInitExpr();
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"constant expression "+e.toString());
+            Object result = e.evaluate();
+			String constantSymbol = cd.getIdent();
+			PropertySymbol constantSym = (PropertySymbol)symTab.getSymbol(constantSymbol);
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"constantSym name"+ constantSym.getName()+" current value:"+constantSym.getValue()+" setting value to:"+result.toString());
+            
+            constantSym.setValue(result);
+		}
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+   
+	}
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java Fri Jan 11 10:56:30 2008
@@ -1,125 +1,125 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.InstanceInfo;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class ImportStatement 
-{
-	
-	private List _importInstanceInfoList;
-	private Expression _expr;
-	private SPLSymbolTable _symTab;
-	private String _anchorClassName;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="ImportStatement";
-    
-    
-	
-
-	public SPLSymbolTable getSymTab() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-   
-		return _symTab;
-	}
-
-	public void setSymTab(SPLSymbolTable symTab) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-		this._symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-	}
-
-	public ImportStatement(String anchorClassName, 
-	        List importInstanceInfoList, Expression e,SPLSymbolTable symTab)
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ImportStatement");
-        
-		this._anchorClassName = anchorClassName;
-		this._expr = e;
-		this._symTab = symTab;
-		_importInstanceInfoList=new ArrayList();
-		Iterator it=importInstanceInfoList.iterator();
-		while(it.hasNext())
-		{
-			InstanceInfo iinfo=(InstanceInfo)it.next();
-			//NRJ
-			//if(!iinfo.isCollectInstance())
-			{
-				this._importInstanceInfoList.add(iinfo);
-			}
-			
-			
-		}
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ImportStatement");
-        
-	}
-
-	
-	public Expression getExpr() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getExpr");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getExpr");
-   
-		return _expr;
-	}
-
-	public void setExpr(Expression expr) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setExpr");
-        
-		this._expr = expr;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setExpr");
-        
-	}
-	
-	public List getImportInstanceInfoList()
-	{
-		return _importInstanceInfoList;
-		
-	}
-
-    public String getAnchorClassName()
-    {
-        return _anchorClassName;
-    }
-
-    public void setAnchorClassName(String className)
-    {
-        _anchorClassName = className;
-    }
-
-	
-
-	
-
-	
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.InstanceInfo;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class ImportStatement 
+{
+	
+	private List _importInstanceInfoList;
+	private Expression _expr;
+	private SPLSymbolTable _symTab;
+	private String _anchorClassName;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="ImportStatement";
+    
+    
+	
+
+	public SPLSymbolTable getSymTab() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+   
+		return _symTab;
+	}
+
+	public void setSymTab(SPLSymbolTable symTab) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+		this._symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+	}
+
+	public ImportStatement(String anchorClassName, 
+	        List importInstanceInfoList, Expression e,SPLSymbolTable symTab)
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ImportStatement");
+        
+		this._anchorClassName = anchorClassName;
+		this._expr = e;
+		this._symTab = symTab;
+		_importInstanceInfoList=new ArrayList();
+		Iterator it=importInstanceInfoList.iterator();
+		while(it.hasNext())
+		{
+			InstanceInfo iinfo=(InstanceInfo)it.next();
+			//NRJ
+			//if(!iinfo.isCollectInstance())
+			{
+				this._importInstanceInfoList.add(iinfo);
+			}
+			
+			
+		}
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ImportStatement");
+        
+	}
+
+	
+	public Expression getExpr() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getExpr");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getExpr");
+   
+		return _expr;
+	}
+
+	public void setExpr(Expression expr) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setExpr");
+        
+		this._expr = expr;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setExpr");
+        
+	}
+	
+	public List getImportInstanceInfoList()
+	{
+		return _importInstanceInfoList;
+		
+	}
+
+    public String getAnchorClassName()
+    {
+        return _anchorClassName;
+    }
+
+    public void setAnchorClassName(String className)
+    {
+        _anchorClassName = className;
+    }
+
+	
+
+	
+
+	
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/MacroDefinition.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/MacroDefinition.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/MacroDefinition.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/MacroDefinition.java Fri Jan 11 10:56:30 2008
@@ -1,246 +1,246 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Argument;
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.*;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class MacroDefinition 
-{
-	private String _macroName;
-	private int _retType;
-	private List _argList = new ArrayList();
-	private Expression _macroExpression;
-	private SPLSymbolTable _macroSymTab;
-	private SPLSymbolTable _symTab;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="MacroDefinition";
-    private boolean _isArray =false;
-    
-    public MacroDefinition(String mName, String retType,boolean isArray, ArrayList aList, 
-			Expression mE, SPLSymbolTable mSymTab, SPLSymbolTable sTab) throws SPLException
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MacroDefinition");
-        
-		this._macroName = mName;
-        
-		this._retType = TypeConstants.getActualType(retType);
-		
-        
-        
-		
-		this._macroSymTab = mSymTab;
-		this._symTab = sTab;
-        this._isArray=isArray;
-		populateArgList(aList);
-        /*if(!array.equalsIgnoreCase(""))
-        {
-            this.isArray=true;
-        }*/
-		//System.out.println("created macro expression "+mName);
-		this._macroExpression = mE;
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MacroDefinition");
-   
-	}
-	
-	public SPLSymbolTable getMacroSymTab() 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroSymTab");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroSymTab");
-   
-		return _macroSymTab;
-	}
-
-	public Object evaluate() throws SPLException
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-		Object returnValue = null;
-		returnValue = _macroExpression.evaluate();
-		
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-   
-		return returnValue;
-	}
-
-
-	public void setMacroSymTab(SPLSymbolTable macroSymTab) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroSymTab");
-        
-		this._macroSymTab = macroSymTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroSymTab");
-        
-	}
-
-
-
-	public SPLSymbolTable getSymTab() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-   
-		return _symTab;
-	}
-
-
-
-	public void setSymTab(SPLSymbolTable symTab) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-		this._symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-	}
-
-
-
-	public void setRetType(int retType) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
-        
-		this._retType = retType;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
-        
-	}
-
-
-
-	
-
-	
-
-	private void populateArgList(ArrayList list) 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "populateArgList");
-        
-		for(int i=0; i< list.size(); i++)
-		{
-			Argument e = (Argument)list.get(i);
-			TypeInfo argType = e.getType();
-			_argList.add(argType);
-			
-		}
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateArgList");
-        
-		
-	}
-
-	public List getArgList() 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArgList");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArgList");
-   
-		return _argList;
-	}
-
-	public void setArgList(ArrayList argList) 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArgList");
-        
-		this._argList = argList;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArgList");
-        
-	}
-
-	public Expression getMacroExpression() 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroExpression");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroExpression");
-   
-		return _macroExpression;
-	}
-
-	public void setMacroExpression(Expression macroExpression) 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroExpression");
-        
-		this._macroExpression = macroExpression;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroExpression");
-        
-	}
-
-	public String getMacroName() 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
-   
-		return _macroName;
-	}
-
-	public void setMacroName(String macroName) 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
-        
-		this._macroName = macroName;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
-        
-	}
-
-	public int getRetType() 
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getRetType");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getRetType");
-   
-		return _retType;
-	}
-
-	public void setRetType(String retType) throws SPLException
-	{
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
-        this._retType = TypeConstants.getActualType(retType);
-        
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
-        
-	}
-	
-	public String getReferenceTypeName() throws SPLException
-	{
-		String refTypeName = _macroExpression.getReferenceTypeName();
-		return refTypeName;
-	}
-
-    public boolean isArray()
-    {
-        return _isArray;
-    }
-
-    public void setArray(boolean isArray)
-    {
-        this._isArray = isArray;
-    }
-
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Argument;
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.*;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class MacroDefinition 
+{
+	private String _macroName;
+	private int _retType;
+	private List _argList = new ArrayList();
+	private Expression _macroExpression;
+	private SPLSymbolTable _macroSymTab;
+	private SPLSymbolTable _symTab;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="MacroDefinition";
+    private boolean _isArray =false;
+    
+    public MacroDefinition(String mName, String retType,boolean isArray, ArrayList aList, 
+			Expression mE, SPLSymbolTable mSymTab, SPLSymbolTable sTab) throws SPLException
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MacroDefinition");
+        
+		this._macroName = mName;
+        
+		this._retType = TypeConstants.getActualType(retType);
+		
+        
+        
+		
+		this._macroSymTab = mSymTab;
+		this._symTab = sTab;
+        this._isArray=isArray;
+		populateArgList(aList);
+        /*if(!array.equalsIgnoreCase(""))
+        {
+            this.isArray=true;
+        }*/
+		//System.out.println("created macro expression "+mName);
+		this._macroExpression = mE;
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MacroDefinition");
+   
+	}
+	
+	public SPLSymbolTable getMacroSymTab() 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroSymTab");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroSymTab");
+   
+		return _macroSymTab;
+	}
+
+	public Object evaluate() throws SPLException
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+		Object returnValue = null;
+		returnValue = _macroExpression.evaluate();
+		
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+   
+		return returnValue;
+	}
+
+
+	public void setMacroSymTab(SPLSymbolTable macroSymTab) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroSymTab");
+        
+		this._macroSymTab = macroSymTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroSymTab");
+        
+	}
+
+
+
+	public SPLSymbolTable getSymTab() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+   
+		return _symTab;
+	}
+
+
+
+	public void setSymTab(SPLSymbolTable symTab) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+		this._symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+	}
+
+
+
+	public void setRetType(int retType) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
+        
+		this._retType = retType;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
+        
+	}
+
+
+
+	
+
+	
+
+	private void populateArgList(ArrayList list) 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "populateArgList");
+        
+		for(int i=0; i< list.size(); i++)
+		{
+			Argument e = (Argument)list.get(i);
+			TypeInfo argType = e.getType();
+			_argList.add(argType);
+			
+		}
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateArgList");
+        
+		
+	}
+
+	public List getArgList() 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArgList");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArgList");
+   
+		return _argList;
+	}
+
+	public void setArgList(ArrayList argList) 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArgList");
+        
+		this._argList = argList;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArgList");
+        
+	}
+
+	public Expression getMacroExpression() 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroExpression");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroExpression");
+   
+		return _macroExpression;
+	}
+
+	public void setMacroExpression(Expression macroExpression) 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroExpression");
+        
+		this._macroExpression = macroExpression;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroExpression");
+        
+	}
+
+	public String getMacroName() 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
+   
+		return _macroName;
+	}
+
+	public void setMacroName(String macroName) 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
+        
+		this._macroName = macroName;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
+        
+	}
+
+	public int getRetType() 
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getRetType");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getRetType");
+   
+		return _retType;
+	}
+
+	public void setRetType(String retType) throws SPLException
+	{
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
+        this._retType = TypeConstants.getActualType(retType);
+        
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setRetType");
+        
+	}
+	
+	public String getReferenceTypeName() throws SPLException
+	{
+		String refTypeName = _macroExpression.getReferenceTypeName();
+		return refTypeName;
+	}
+
+    public boolean isArray()
+    {
+        return _isArray;
+    }
+
+    public void setArray(boolean isArray)
+    {
+        this._isArray = isArray;
+    }
+
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/MacroDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java Fri Jan 11 10:56:30 2008
@@ -1,346 +1,346 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.statements.impl;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Actuator;
-import org.apache.imperius.spl.external.DataCollector;
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.statements.ActionBlock;
-import org.apache.imperius.spl.parser.statements.PolicyStatement;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class PolicyDefinition implements PolicyStatement 
-{
-    private DeclarationStatement _declStmt;
-    private Expression _condition;
-    private ActionBlock _decision;
-    int _priority;
-    private SPLSymbolTable _symTab;
-    private String auditloggerString = "";
-
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-//    private static Logger auditLogger = SPLLogger.getSPLLogger().getAuditLogger();
-    
-    private static final String sourceClass="PolicyDefinition";
-    
-    
-    
-    public PolicyDefinition(DeclarationStatement d, Expression con, ActionBlock dec, 
-            String priority, SPLSymbolTable sTab)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PolicyDefinition");
-        
-        _declStmt = d;
-        _condition = con;
-        if(con==null){
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"PolicyDefinition condition is null");
-        }
-        else{
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"PolicyDefinition condition "+con.toString());
-        }
-        _decision = dec;
-        if(dec==null){
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision is null");
-        }
-        else{
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision "+dec.toString());
-        }
-        
-        _priority = Integer.parseInt(priority);
-        _symTab = sTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "PolicyDefinition");
-        
-    }
-    
-    public Expression getCondition() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getCondition");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getCondition");
-        
-        return _condition;
-    }
-    
-    public void setCondition(Expression condition) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setCondition");
-        
-        _condition = condition;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setCondition");
-        
-    }
-    
-    public ActionBlock getDecision() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDecision");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDecision");
-        
-        return _decision;
-    }
-    
-    public void setDecision(ActionBlock decision) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDecision");
-        
-        _decision = decision;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDecision");
-        
-    }
-    
-    public DeclarationStatement getDeclStmt() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDeclStmt");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDeclStmt");
-        
-        return _declStmt;
-    }
-    
-    public void setDeclStmt(DeclarationStatement declStmt) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDeclStmt");
-        
-        _declStmt = declStmt;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDeclStmt");
-        
-    }
-    
-    public int getPriority() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPriority");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPriority");
-        
-        return _priority;
-    }
-    
-    public void setPriority(int priority) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setPriority");
-        _priority = priority;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setPriority");
-        
-        
-    }
-    
-    public SPLSymbolTable getSymTab() {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-        
-        return _symTab;
-    }
-    
-    public void setSymTab(SPLSymbolTable symTab) {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-        _symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-        
-    }
-    
-    public int evaluate(DataCollector dc , Actuator ac) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        this.auditloggerString="";
-        int result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
-        if(_declStmt != null)
-        {	
-            _declStmt.evaluate();
-        }    
-        if(_condition != null)
-        {	
-            
-            if(logger.isLoggable(Level.FINE))
-            {	
-                logger.fine(Thread.currentThread().getName()+
-                		"evaluating condition of Policy Definition");
-            }    
-            Boolean conditionResult = (Boolean)_condition.evaluate();
-            System.out.println("     "+"policy :"+_condition.toString());
-            auditloggerString+="     "+"policy :"+_condition.toString()+"\n";
-            System.out.println("     "+"result :"+conditionResult);
-            auditloggerString+="     "+"result :"+conditionResult+"\n";
-            
-			
-//            System.out.println("condition : "+_condition.toString());
-//            System.out.println("evaluated to : "+conditionResult);
-            
-            if(logger.isLoggable(Level.FINE))
-            {	
-            	logger.fine(Thread.currentThread().getName()+
-                		"condition="+_condition.toString());
-                logger.fine(Thread.currentThread().getName()+
-                		"evaluation of condition complete, return value="+conditionResult);
-            }  
-//            if(auditLogger.isLoggable(Level.FINE))
-//            {	
-//                auditLogger.fine(Thread.currentThread().getName()+
-//                		"Condition : "+this.getCondition().toString());
-//            }    
-//            
-//            if(auditLogger.isLoggable(Level.FINE))
-//            {	
-//                auditLogger.fine(Thread.currentThread().getName()+
-//                		"Condition Evaluated to : "+conditionResult.toString());
-//            }    
-            
-            if(conditionResult.booleanValue())
-            {
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"Condition is True!");
-                //modifyInstance(String className,String namespace,Map instanceKeys, Map properties)
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"executing Decision of Policy Definition");
-                //System.out.println("keys string : "+this.symTab.getInstance().getKeys());
-//                if(auditLogger.isLoggable(Level.FINE))
-//                    auditLogger.fine(Thread.currentThread().getName()+" Executing Decision ");
-                boolean executionResult = 
-                	_decision.execute(ac);
-                System.out.println("     "+"decision executed :"+executionResult);
-                auditloggerString+="     "+"decision executed :"+executionResult+"\n";
-                
-//                if(auditLogger.isLoggable(Level.FINE))
-//                    auditLogger.fine(Thread.currentThread().getName()+"PolicyDefinition decision.execute return value="+executionResult);
-                
-                if(executionResult)
-                {
-//                    if(auditLogger.isLoggable(Level.FINE))
-//                        auditLogger.fine(Thread.currentThread().getName()+" Policy Evaluated Successfully ");
-                    
-                    result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
-                    System.out.println("     "+"sub policy decision execution successful");
-                    auditloggerString+="     "+"sub policy decision execution successful"+"\n";
-                    
-                    if(logger.isLoggable(Level.FINE))
-                        logger.fine(Thread.currentThread().getName()+"Policy was executed successfully");
-                   //System.out.println(" POLICY_EVALUATED_SUCCESSFULLY ");
-                    
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                    
-                    return result;
-                }
-                else{
-                    
-//                    auditLogger.severe(Thread.currentThread().getName()+" "+" Policy Evaluation Failed ");
-                    
-                    result = SPLPolicy.POLICY_EVALUATION_FAILED;
-                    System.out.println("     "+"sub policy decision execution failed");
-                    auditloggerString+="     "+"sub policy decision execution failed"+"\n";
-                    
-//                    auditLogger.severe(Thread.currentThread().getName()+" "+"PolicyDefinition Evalaute return value="+result);
-                   //System.out.println(" POLICY_EVALUATION_FAILED ");
-                    
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                    
-                    return result;
-                }
-                
-            }
-            else
-            {
-//                if(auditLogger.isLoggable(Level.FINE))
-//                    auditLogger.fine(Thread.currentThread().getName()+" Policy was not Evaluated as Condition evaluated to False ");
-                
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"Condition is False!");
-                //result = SPLPolicy.POLICY_NOT_EVALUATED;
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"Policy was not executed");
-               //System.out.println(" CONDITION evaluated to FALSE ");
-                
-                System.out.println("     "+"sub policy decision not executed");
-                auditloggerString+="     "+"sub policy decision not executed"+"\n";
-                
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
-                
-                return result;
-            }
-        }
-        else
-        {
-        	System.out.println("     "+"sub policy has no condition");
-        	auditloggerString+="     "+"sub policy has no condition"+"\n";
-            
-            boolean executionResult=_decision.execute(ac);
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision.execute return value="+executionResult);
-            System.out.println("     "+"decision executed :"+executionResult);
-            auditloggerString+="     "+"decision executed :"+executionResult+"\n";
-            
-            if(executionResult)
-            {
-//                if(auditLogger.isLoggable(Level.FINE))
-//                    auditLogger.fine(Thread.currentThread().getName()+"Policy without condition, was executed successfully");
-                
-                result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
-                System.out.println("     "+"sub policy decision execution successful");
-                auditloggerString+="     "+"sub policy decision execution successful"+"\n";
-                
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"Policy without condition, was executed successfully");
-               //System.out.println(" POLICY_EVALUATED_SUCCESSFULLY ");
-                
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
-                
-                return result;
-            }
-            else{
-//                if(auditLogger.isLoggable(Level.FINE))
-//                    auditLogger.fine(Thread.currentThread().getName()+"Evaluation of Policy without condition Failed");
-                
-                result = SPLPolicy.POLICY_EVALUATION_FAILED;
-                System.out.println("     "+"sub policy decision execution failed");
-                auditloggerString+="     "+"sub policy decision execution failed"+"\n";
-                
-               //System.out.println(" POLICY_EVALUATION_FAILED ");
-                
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                if(logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
-                
-                return result;
-            }
-        }
-        
-        
-    }
-    
-    
-    public String toString(){
-    	
-    	return this._condition.toString();
-    	
-    }
-
-	public String getAuditLogString() {
-		
-		return this.auditloggerString;
-	}
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.statements.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Actuator;
+import org.apache.imperius.spl.external.DataCollector;
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.statements.ActionBlock;
+import org.apache.imperius.spl.parser.statements.PolicyStatement;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class PolicyDefinition implements PolicyStatement 
+{
+    private DeclarationStatement _declStmt;
+    private Expression _condition;
+    private ActionBlock _decision;
+    int _priority;
+    private SPLSymbolTable _symTab;
+    private String auditloggerString = "";
+
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+//    private static Logger auditLogger = SPLLogger.getSPLLogger().getAuditLogger();
+    
+    private static final String sourceClass="PolicyDefinition";
+    
+    
+    
+    public PolicyDefinition(DeclarationStatement d, Expression con, ActionBlock dec, 
+            String priority, SPLSymbolTable sTab)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PolicyDefinition");
+        
+        _declStmt = d;
+        _condition = con;
+        if(con==null){
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"PolicyDefinition condition is null");
+        }
+        else{
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"PolicyDefinition condition "+con.toString());
+        }
+        _decision = dec;
+        if(dec==null){
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision is null");
+        }
+        else{
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision "+dec.toString());
+        }
+        
+        _priority = Integer.parseInt(priority);
+        _symTab = sTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "PolicyDefinition");
+        
+    }
+    
+    public Expression getCondition() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getCondition");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getCondition");
+        
+        return _condition;
+    }
+    
+    public void setCondition(Expression condition) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setCondition");
+        
+        _condition = condition;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setCondition");
+        
+    }
+    
+    public ActionBlock getDecision() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDecision");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDecision");
+        
+        return _decision;
+    }
+    
+    public void setDecision(ActionBlock decision) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDecision");
+        
+        _decision = decision;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDecision");
+        
+    }
+    
+    public DeclarationStatement getDeclStmt() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDeclStmt");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDeclStmt");
+        
+        return _declStmt;
+    }
+    
+    public void setDeclStmt(DeclarationStatement declStmt) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDeclStmt");
+        
+        _declStmt = declStmt;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDeclStmt");
+        
+    }
+    
+    public int getPriority() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPriority");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPriority");
+        
+        return _priority;
+    }
+    
+    public void setPriority(int priority) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setPriority");
+        _priority = priority;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setPriority");
+        
+        
+    }
+    
+    public SPLSymbolTable getSymTab() {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        
+        return _symTab;
+    }
+    
+    public void setSymTab(SPLSymbolTable symTab) {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+        _symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        
+    }
+    
+    public int evaluate(DataCollector dc , Actuator ac) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        this.auditloggerString="";
+        int result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
+        if(_declStmt != null)
+        {	
+            _declStmt.evaluate();
+        }    
+        if(_condition != null)
+        {	
+            
+            if(logger.isLoggable(Level.FINE))
+            {	
+                logger.fine(Thread.currentThread().getName()+
+                		"evaluating condition of Policy Definition");
+            }    
+            Boolean conditionResult = (Boolean)_condition.evaluate();
+            System.out.println("     "+"policy :"+_condition.toString());
+            auditloggerString+="     "+"policy :"+_condition.toString()+"\n";
+            System.out.println("     "+"result :"+conditionResult);
+            auditloggerString+="     "+"result :"+conditionResult+"\n";
+            
+			
+//            System.out.println("condition : "+_condition.toString());
+//            System.out.println("evaluated to : "+conditionResult);
+            
+            if(logger.isLoggable(Level.FINE))
+            {	
+            	logger.fine(Thread.currentThread().getName()+
+                		"condition="+_condition.toString());
+                logger.fine(Thread.currentThread().getName()+
+                		"evaluation of condition complete, return value="+conditionResult);
+            }  
+//            if(auditLogger.isLoggable(Level.FINE))
+//            {	
+//                auditLogger.fine(Thread.currentThread().getName()+
+//                		"Condition : "+this.getCondition().toString());
+//            }    
+//            
+//            if(auditLogger.isLoggable(Level.FINE))
+//            {	
+//                auditLogger.fine(Thread.currentThread().getName()+
+//                		"Condition Evaluated to : "+conditionResult.toString());
+//            }    
+            
+            if(conditionResult.booleanValue())
+            {
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"Condition is True!");
+                //modifyInstance(String className,String namespace,Map instanceKeys, Map properties)
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"executing Decision of Policy Definition");
+                //System.out.println("keys string : "+this.symTab.getInstance().getKeys());
+//                if(auditLogger.isLoggable(Level.FINE))
+//                    auditLogger.fine(Thread.currentThread().getName()+" Executing Decision ");
+                boolean executionResult = 
+                	_decision.execute(ac);
+                System.out.println("     "+"decision executed :"+executionResult);
+                auditloggerString+="     "+"decision executed :"+executionResult+"\n";
+                
+//                if(auditLogger.isLoggable(Level.FINE))
+//                    auditLogger.fine(Thread.currentThread().getName()+"PolicyDefinition decision.execute return value="+executionResult);
+                
+                if(executionResult)
+                {
+//                    if(auditLogger.isLoggable(Level.FINE))
+//                        auditLogger.fine(Thread.currentThread().getName()+" Policy Evaluated Successfully ");
+                    
+                    result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
+                    System.out.println("     "+"sub policy decision execution successful");
+                    auditloggerString+="     "+"sub policy decision execution successful"+"\n";
+                    
+                    if(logger.isLoggable(Level.FINE))
+                        logger.fine(Thread.currentThread().getName()+"Policy was executed successfully");
+                   //System.out.println(" POLICY_EVALUATED_SUCCESSFULLY ");
+                    
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                    
+                    return result;
+                }
+                else{
+                    
+//                    auditLogger.severe(Thread.currentThread().getName()+" "+" Policy Evaluation Failed ");
+                    
+                    result = SPLPolicy.POLICY_EVALUATION_FAILED;
+                    System.out.println("     "+"sub policy decision execution failed");
+                    auditloggerString+="     "+"sub policy decision execution failed"+"\n";
+                    
+//                    auditLogger.severe(Thread.currentThread().getName()+" "+"PolicyDefinition Evalaute return value="+result);
+                   //System.out.println(" POLICY_EVALUATION_FAILED ");
+                    
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                    
+                    return result;
+                }
+                
+            }
+            else
+            {
+//                if(auditLogger.isLoggable(Level.FINE))
+//                    auditLogger.fine(Thread.currentThread().getName()+" Policy was not Evaluated as Condition evaluated to False ");
+                
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"Condition is False!");
+                //result = SPLPolicy.POLICY_NOT_EVALUATED;
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"Policy was not executed");
+               //System.out.println(" CONDITION evaluated to FALSE ");
+                
+                System.out.println("     "+"sub policy decision not executed");
+                auditloggerString+="     "+"sub policy decision not executed"+"\n";
+                
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
+                
+                return result;
+            }
+        }
+        else
+        {
+        	System.out.println("     "+"sub policy has no condition");
+        	auditloggerString+="     "+"sub policy has no condition"+"\n";
+            
+            boolean executionResult=_decision.execute(ac);
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"PolicyDefinition decision.execute return value="+executionResult);
+            System.out.println("     "+"decision executed :"+executionResult);
+            auditloggerString+="     "+"decision executed :"+executionResult+"\n";
+            
+            if(executionResult)
+            {
+//                if(auditLogger.isLoggable(Level.FINE))
+//                    auditLogger.fine(Thread.currentThread().getName()+"Policy without condition, was executed successfully");
+                
+                result = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
+                System.out.println("     "+"sub policy decision execution successful");
+                auditloggerString+="     "+"sub policy decision execution successful"+"\n";
+                
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"Policy without condition, was executed successfully");
+               //System.out.println(" POLICY_EVALUATED_SUCCESSFULLY ");
+                
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
+                
+                return result;
+            }
+            else{
+//                if(auditLogger.isLoggable(Level.FINE))
+//                    auditLogger.fine(Thread.currentThread().getName()+"Evaluation of Policy without condition Failed");
+                
+                result = SPLPolicy.POLICY_EVALUATION_FAILED;
+                System.out.println("     "+"sub policy decision execution failed");
+                auditloggerString+="     "+"sub policy decision execution failed"+"\n";
+                
+               //System.out.println(" POLICY_EVALUATION_FAILED ");
+                
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+"PolicyDefinition Evalaute return value="+result);
+                
+                return result;
+            }
+        }
+        
+        
+    }
+    
+    
+    public String toString(){
+    	
+    	return this._condition.toString();
+    	
+    }
+
+	public String getAuditLogString() {
+		
+		return this.auditloggerString;
+	}
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message