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 [10/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/expression/primary/PostCollectExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java Fri Jan 11 10:56:30 2008
@@ -1,489 +1,489 @@
-/*
- * 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.expression.primary;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.compiler.symboltable.MethodSymbol;
-import org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.compiler.symboltable.Symbol;
-import org.apache.imperius.spl.parser.exceptions.IllegalExpressionTypeException;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class PostCollectExpression implements Expression
-{
-
-	private Expression arrExp1;
-
-	private String methodOrParam;
-	private boolean methodOrParamExists=false;
-	private boolean array2Exists=false;
-	
-	
-	private Expression arrExp2;
-
-	private ArrayList pList;
-
-	private SPLSymbolTable symTab;
-
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-	private static final String sourceClass="PostCollectExpression";
-
-	private TypeInfo _dataType=new TypeInfo();
-
-	public boolean isIdentifierMethod;
-
-	public int instanceNumer=-1;
-
-	private String targetName="";
-
-	//public static final int POSTCOLLECT_IS_ARRAY = -1;
-
-//	private boolean isArray;
-
-	public boolean isArray()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-		return this._dataType.getIsArray();
-
-	}
-
-	public void setArray(boolean isArray)
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
-		this._dataType.setIsArray(isArray);
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
-
-
-	}
-
-	public PostCollectExpression(Expression a1, String m, Expression a2,
-			ArrayList pList, SPLSymbolTable sTab) throws SPLException
-			{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PostCollectExpression");
-
-
-		this.arrExp1 = a1;
-		this.arrExp2 = a2;
-		this.methodOrParam = m;
-		this.pList = pList;
-		this.symTab = sTab;
-		
-		
-
-			}
-
-	// (arrExp1 = arrayIndex[cSymTab] ( id:IDENT ( #(INDEX_OP
-	// arrExp2=expression[cSymTab]) | #(METHOD_CALL (pList = exprList[cSymTab])?
-	// ) )? )? )
-	// [exp].ID1[exp]
-	// [exp].ID1(pList)
-	// [exp].ID1
-	public Object evaluate(List filteredTargetInstances)
-	throws SPLException
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-
-		Object result = null;
-		// evaluate the array expression to get the integer index
-		Integer arrayIndex = (Integer) arrExp1.evaluate();
-		int sizeOfFilteredTargetInstances = filteredTargetInstances.size();
-		this.instanceNumer=arrayIndex.intValue();
-		//System.out.println("arrayIndex" + arrayIndex);
-		//System.out.println("sizeOfFilteredTargetInstances"   + sizeOfFilteredTargetInstances);
-		// use the index to extract the corresponding object from the filtered
-		// instances
-		//System.out.println("doing post collect operation on filtered instances");
-		if ((sizeOfFilteredTargetInstances > arrayIndex.intValue())
-				&& (sizeOfFilteredTargetInstances != 0))
-		{
-			//System.out.println("filteredTargetInstances "+sizeOfFilteredTargetInstances+" "+arrayIndex.intValue() +" list:"+filteredTargetInstances);
-			
-			Object selectedInstance = filteredTargetInstances.get(arrayIndex
-					.intValue());
-			//System.out.println(selectedInstance);
-			if (!methodOrParam.equals("")) // of the form [exp].ID1 OR
-				// [exp].ID1(pList) OR
-				// [exp].ID1[exp]
-			{
-				if (!isIdentifierMethod) // not a method call i.e of type
-					// [exp].ID1 OR [exp].ID1[exp]
-				{
-					// populate the symbol table with the map corresponding to
-					// the current instance
-					//TBD add Map of ClassToInstance
-					symTab.populateInstanceValuesForInstance(this.targetName, this.targetName, selectedInstance, new HashMap());
-
-//					PropertySymbol prop = (PropertySymbol) symTab.getSymbol(this.targetName + "." + methodOrParam); // extract
-					String qualifiedPropertyNm=methodOrParam;                                                                // the symbol
-					if(!targetName.equalsIgnoreCase(""))    
-					{
-
-						qualifiedPropertyNm=targetName+"."+methodOrParam;
-
-					}
-					PropertySymbol prop = (PropertySymbol) symTab.getSymbol( qualifiedPropertyNm); // extract
-					result = prop.getValue(); // get its value
-					if (prop.isArray())
-					{
-						this._dataType.setIsArray(true);
-					}
-					else
-					{
-						this._dataType.setIsArray(false);
-					}
-				} // its a method invoke
-				else
-				{
-					logger.severe(
-							"Cannot invoke methods in the Declaration or Condition sections");
-
-					throw new SPLException(
-					"Cannot invoke methods in the Declaration or Condition sections");
-				}
-			}
-			else
-				// of the type [exp]
-			{
-				// symTab.populateSymbolTableWithInstanceValues((Map)selectedInstance);
-				result = selectedInstance;
-				this._dataType.setIsArray(false);
-			}
-			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-			return result;
-		}
-		else
-		{
-			logger.severe(Thread.currentThread().getName()+" "+"array index is out of range");
-			throw new SPLException("array index is out of range");
-
-		}
-
-	}
-
-	public TypeInfo getType() throws SPLException
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-
-		if (_dataType != null)
-			return _dataType;
-		else
-		{
-
-			validate();
-			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-			return _dataType;
-		}
-	}
-
-	public boolean validate(String targetClassName) throws SPLException
-	{
-
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-		//System.out.println("validating post collect expr "+targetClassName);
-
-		if (arrExp1 != null && (arrExp1.getType().getType() == TypeConstants.intType)) // make
-			// sure
-			// [exp]
-			// is
-			// numeric
-		{
-			//System.out.println("arrExp1 != null");
-			targetName=targetClassName;
-//			String targetClassName = (String)this.symTab.getAnchorClassList().get(0);
-			if (!methodOrParam.equals(""))
-			{
-				
-				methodOrParamExists=true;
-				//System.out.println("!methodOrParam.equals() "+methodOrParam);
-
-				String propName = /*targetClassName + "." +*/ methodOrParam;
-				boolean recurse = false; // do not go up the symbol table
-				// hierarchy
-				String qualifiedPropertyName=targetClassName+"."+propName;
-				//System.out.println("!methodOrParam.equals() "+qualifiedPropertyName);
-
-				if (symTab.symbolExists(qualifiedPropertyName, recurse)) // make sure ID1
-					// exists in the
-					// symbol table
-				{
-					//System.out.println("symTab.symbolExists(propName, recurse)");
-
-					Symbol sym = symTab.getSymbol(qualifiedPropertyName);
-					_dataType.copy(sym.getType());
-					
-					if (sym instanceof MethodSymbol)
-					{
-						//System.out.println("sym instanceof MethodSymbol");
-
-						// ArrayList formalParams = (ArrayList)
-						// ((MethodSymbol)sym).getArgTypeList();
-						// TypeResolver.validateActualParameterTypes(formalParams,pList);
-						// dataType = sym.getType();
-						// isIdentifierMethod = true;
-						logger.severe(Thread.currentThread().getName()+" "+"Cannot invoke methods in the Declaration or Condition sections");
-
-						throw new SPLException(
-						"Cannot invoke methods in the Declaration or Condition sections");
-					}
-					else if(sym instanceof PropertySymbol)
-						// sym instanceof PropertySymbol
-					{
-						//System.out.println("sym instanceof PropertySymbol");
-//						//System.out.println("propType "+propType.getType());
-
-						PropertySymbol pSym = (PropertySymbol) sym;
-						if (pSym.isArray())
-						{
-							array2Exists=true;
-							//System.out.println("pSym.isArray()");
-							_dataType.setIsArray(false);
-							
-							if(arrExp2 != null ){
-								if (arrExp2.getType().getType() != TypeConstants.intType)
-								{
-									logger.severe(
-											"arr index should be integer and not "
-											+ arrExp2.getType());
-
-									throw new IllegalExpressionTypeException(
-											"arr index should be integer and not "
-											+ arrExp2.getType());
-								}
-							}
-
-
-						}
-						isIdentifierMethod = false;
-						
-
-					}
-					else{
-						logger.severe(Thread.currentThread().getName()+" "+"unknown symbol type "+qualifiedPropertyName);
-						throw new SPLException("unknown symbol type "+qualifiedPropertyName);
-
-					}
-
-				}
-				else{
-					logger.severe(Thread.currentThread().getName()+" "+"symbol does not exist "+qualifiedPropertyName);
-					throw new SPLException("symbol does not exist "+qualifiedPropertyName);
-
-				}
-			}
-			else
-			{
-				//System.out.println("method or param name is null");
-				// expression of type [exp]
-				_dataType.setType(TypeConstants.referenceType);
-				_dataType.setIsArray(false);
-				isIdentifierMethod = false;
-				// ; // data type is same as the
-				// target class name in the
-				// collect
-			}
-		}
-		else
-		{
-			logger.severe(
-					"arr index should be integer and not " + arrExp1.getType());
-
-			throw new IllegalExpressionTypeException(
-					"arr index should be integer and not " + arrExp1.getType());
-
-		}
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-		//System.out.println("validating post collect expr done is array="+this._dataType.getIsArray());
-
-		return true;
-	}
-
-	public Expression getArrExp1()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
-
-		return arrExp1;
-	}
-
-	public void setArrExp1(Expression arrExp1)
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
-		this.arrExp1 = arrExp1;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
-
-
-	}
-
-	public Expression getArrExp2()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
-
-		return arrExp2;
-	}
-
-	public void setArrExp2(Expression arrExp2)
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
-		this.arrExp2 = arrExp2;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
-
-
-	}
-
-	public String getMethodOrParam()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
-
-		return methodOrParam;
-	}
-
-	public void setMethodOrParam(String methodOrParam)
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
-		this.methodOrParam = methodOrParam;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
-
-
-	}
-
-	public ArrayList getPList()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
-
-		return pList;
-	}
-
-	public void setPList(ArrayList list)
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
-
-		pList = list;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
-
-
-	}
-
-	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 Object evaluate() throws SPLException
-	{
-
-		logger.severe(Thread.currentThread().getName()+" "+"Not supported evaluate without parameters");
-
-		throw new SPLException("Not supported evaluate without parameters");
-
-	}
-
-	public String toString()
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-		String str="";
-		if(this.arrExp1!=null){
-			str+=this.arrExp1.toString();
-		}
-		if(this.methodOrParam!=null){
-			str+=this.methodOrParam.toString();
-		}
-		
-		if(this.arrExp2!=null){
-			str+=" "+this.arrExp1.toString();
-		}
-//		str+=" )";
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-		return str;
-	}
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public int getInstanceNumer() {
-		return instanceNumer;
-	}
-
-	public void setInstanceNumer(int instanceNumer) {
-		this.instanceNumer = instanceNumer;
-	}
-
-	public boolean validate() throws SPLException {
-		// TODO Auto-generated method stub
-		throw new SPLException("validate() not supported for post collect expression");
-	}
-
-	public boolean isMethodOrParamExists() {
-		return methodOrParamExists;
-	}
-
-	
-	public boolean Array2Exists() {
-		return array2Exists;
-	}
-
-	
-
-}
+/*
+ * 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.expression.primary;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.compiler.symboltable.MethodSymbol;
+import org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.compiler.symboltable.Symbol;
+import org.apache.imperius.spl.parser.exceptions.IllegalExpressionTypeException;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class PostCollectExpression implements Expression
+{
+
+	private Expression arrExp1;
+
+	private String methodOrParam;
+	private boolean methodOrParamExists=false;
+	private boolean array2Exists=false;
+	
+	
+	private Expression arrExp2;
+
+	private ArrayList pList;
+
+	private SPLSymbolTable symTab;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private static final String sourceClass="PostCollectExpression";
+
+	private TypeInfo _dataType=new TypeInfo();
+
+	public boolean isIdentifierMethod;
+
+	public int instanceNumer=-1;
+
+	private String targetName="";
+
+	//public static final int POSTCOLLECT_IS_ARRAY = -1;
+
+//	private boolean isArray;
+
+	public boolean isArray()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+		return this._dataType.getIsArray();
+
+	}
+
+	public void setArray(boolean isArray)
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
+		this._dataType.setIsArray(isArray);
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
+
+
+	}
+
+	public PostCollectExpression(Expression a1, String m, Expression a2,
+			ArrayList pList, SPLSymbolTable sTab) throws SPLException
+			{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PostCollectExpression");
+
+
+		this.arrExp1 = a1;
+		this.arrExp2 = a2;
+		this.methodOrParam = m;
+		this.pList = pList;
+		this.symTab = sTab;
+		
+		
+
+			}
+
+	// (arrExp1 = arrayIndex[cSymTab] ( id:IDENT ( #(INDEX_OP
+	// arrExp2=expression[cSymTab]) | #(METHOD_CALL (pList = exprList[cSymTab])?
+	// ) )? )? )
+	// [exp].ID1[exp]
+	// [exp].ID1(pList)
+	// [exp].ID1
+	public Object evaluate(List filteredTargetInstances)
+	throws SPLException
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+
+		Object result = null;
+		// evaluate the array expression to get the integer index
+		Integer arrayIndex = (Integer) arrExp1.evaluate();
+		int sizeOfFilteredTargetInstances = filteredTargetInstances.size();
+		this.instanceNumer=arrayIndex.intValue();
+		//System.out.println("arrayIndex" + arrayIndex);
+		//System.out.println("sizeOfFilteredTargetInstances"   + sizeOfFilteredTargetInstances);
+		// use the index to extract the corresponding object from the filtered
+		// instances
+		//System.out.println("doing post collect operation on filtered instances");
+		if ((sizeOfFilteredTargetInstances > arrayIndex.intValue())
+				&& (sizeOfFilteredTargetInstances != 0))
+		{
+			//System.out.println("filteredTargetInstances "+sizeOfFilteredTargetInstances+" "+arrayIndex.intValue() +" list:"+filteredTargetInstances);
+			
+			Object selectedInstance = filteredTargetInstances.get(arrayIndex
+					.intValue());
+			//System.out.println(selectedInstance);
+			if (!methodOrParam.equals("")) // of the form [exp].ID1 OR
+				// [exp].ID1(pList) OR
+				// [exp].ID1[exp]
+			{
+				if (!isIdentifierMethod) // not a method call i.e of type
+					// [exp].ID1 OR [exp].ID1[exp]
+				{
+					// populate the symbol table with the map corresponding to
+					// the current instance
+					//TBD add Map of ClassToInstance
+					symTab.populateInstanceValuesForInstance(this.targetName, this.targetName, selectedInstance, new HashMap());
+
+//					PropertySymbol prop = (PropertySymbol) symTab.getSymbol(this.targetName + "." + methodOrParam); // extract
+					String qualifiedPropertyNm=methodOrParam;                                                                // the symbol
+					if(!targetName.equalsIgnoreCase(""))    
+					{
+
+						qualifiedPropertyNm=targetName+"."+methodOrParam;
+
+					}
+					PropertySymbol prop = (PropertySymbol) symTab.getSymbol( qualifiedPropertyNm); // extract
+					result = prop.getValue(); // get its value
+					if (prop.isArray())
+					{
+						this._dataType.setIsArray(true);
+					}
+					else
+					{
+						this._dataType.setIsArray(false);
+					}
+				} // its a method invoke
+				else
+				{
+					logger.severe(
+							"Cannot invoke methods in the Declaration or Condition sections");
+
+					throw new SPLException(
+					"Cannot invoke methods in the Declaration or Condition sections");
+				}
+			}
+			else
+				// of the type [exp]
+			{
+				// symTab.populateSymbolTableWithInstanceValues((Map)selectedInstance);
+				result = selectedInstance;
+				this._dataType.setIsArray(false);
+			}
+			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+			return result;
+		}
+		else
+		{
+			logger.severe(Thread.currentThread().getName()+" "+"array index is out of range");
+			throw new SPLException("array index is out of range");
+
+		}
+
+	}
+
+	public TypeInfo getType() throws SPLException
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+
+		if (_dataType != null)
+			return _dataType;
+		else
+		{
+
+			validate();
+			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+			return _dataType;
+		}
+	}
+
+	public boolean validate(String targetClassName) throws SPLException
+	{
+
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+		//System.out.println("validating post collect expr "+targetClassName);
+
+		if (arrExp1 != null && (arrExp1.getType().getType() == TypeConstants.intType)) // make
+			// sure
+			// [exp]
+			// is
+			// numeric
+		{
+			//System.out.println("arrExp1 != null");
+			targetName=targetClassName;
+//			String targetClassName = (String)this.symTab.getAnchorClassList().get(0);
+			if (!methodOrParam.equals(""))
+			{
+				
+				methodOrParamExists=true;
+				//System.out.println("!methodOrParam.equals() "+methodOrParam);
+
+				String propName = /*targetClassName + "." +*/ methodOrParam;
+				boolean recurse = false; // do not go up the symbol table
+				// hierarchy
+				String qualifiedPropertyName=targetClassName+"."+propName;
+				//System.out.println("!methodOrParam.equals() "+qualifiedPropertyName);
+
+				if (symTab.symbolExists(qualifiedPropertyName, recurse)) // make sure ID1
+					// exists in the
+					// symbol table
+				{
+					//System.out.println("symTab.symbolExists(propName, recurse)");
+
+					Symbol sym = symTab.getSymbol(qualifiedPropertyName);
+					_dataType.copy(sym.getType());
+					
+					if (sym instanceof MethodSymbol)
+					{
+						//System.out.println("sym instanceof MethodSymbol");
+
+						// ArrayList formalParams = (ArrayList)
+						// ((MethodSymbol)sym).getArgTypeList();
+						// TypeResolver.validateActualParameterTypes(formalParams,pList);
+						// dataType = sym.getType();
+						// isIdentifierMethod = true;
+						logger.severe(Thread.currentThread().getName()+" "+"Cannot invoke methods in the Declaration or Condition sections");
+
+						throw new SPLException(
+						"Cannot invoke methods in the Declaration or Condition sections");
+					}
+					else if(sym instanceof PropertySymbol)
+						// sym instanceof PropertySymbol
+					{
+						//System.out.println("sym instanceof PropertySymbol");
+//						//System.out.println("propType "+propType.getType());
+
+						PropertySymbol pSym = (PropertySymbol) sym;
+						if (pSym.isArray())
+						{
+							array2Exists=true;
+							//System.out.println("pSym.isArray()");
+							_dataType.setIsArray(false);
+							
+							if(arrExp2 != null ){
+								if (arrExp2.getType().getType() != TypeConstants.intType)
+								{
+									logger.severe(
+											"arr index should be integer and not "
+											+ arrExp2.getType());
+
+									throw new IllegalExpressionTypeException(
+											"arr index should be integer and not "
+											+ arrExp2.getType());
+								}
+							}
+
+
+						}
+						isIdentifierMethod = false;
+						
+
+					}
+					else{
+						logger.severe(Thread.currentThread().getName()+" "+"unknown symbol type "+qualifiedPropertyName);
+						throw new SPLException("unknown symbol type "+qualifiedPropertyName);
+
+					}
+
+				}
+				else{
+					logger.severe(Thread.currentThread().getName()+" "+"symbol does not exist "+qualifiedPropertyName);
+					throw new SPLException("symbol does not exist "+qualifiedPropertyName);
+
+				}
+			}
+			else
+			{
+				//System.out.println("method or param name is null");
+				// expression of type [exp]
+				_dataType.setType(TypeConstants.referenceType);
+				_dataType.setIsArray(false);
+				isIdentifierMethod = false;
+				// ; // data type is same as the
+				// target class name in the
+				// collect
+			}
+		}
+		else
+		{
+			logger.severe(
+					"arr index should be integer and not " + arrExp1.getType());
+
+			throw new IllegalExpressionTypeException(
+					"arr index should be integer and not " + arrExp1.getType());
+
+		}
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+		//System.out.println("validating post collect expr done is array="+this._dataType.getIsArray());
+
+		return true;
+	}
+
+	public Expression getArrExp1()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
+
+		return arrExp1;
+	}
+
+	public void setArrExp1(Expression arrExp1)
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
+		this.arrExp1 = arrExp1;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
+
+
+	}
+
+	public Expression getArrExp2()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
+
+		return arrExp2;
+	}
+
+	public void setArrExp2(Expression arrExp2)
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
+		this.arrExp2 = arrExp2;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
+
+
+	}
+
+	public String getMethodOrParam()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
+
+		return methodOrParam;
+	}
+
+	public void setMethodOrParam(String methodOrParam)
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
+		this.methodOrParam = methodOrParam;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
+
+
+	}
+
+	public ArrayList getPList()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
+
+		return pList;
+	}
+
+	public void setPList(ArrayList list)
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
+
+		pList = list;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
+
+
+	}
+
+	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 Object evaluate() throws SPLException
+	{
+
+		logger.severe(Thread.currentThread().getName()+" "+"Not supported evaluate without parameters");
+
+		throw new SPLException("Not supported evaluate without parameters");
+
+	}
+
+	public String toString()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+		String str="";
+		if(this.arrExp1!=null){
+			str+=this.arrExp1.toString();
+		}
+		if(this.methodOrParam!=null){
+			str+=this.methodOrParam.toString();
+		}
+		
+		if(this.arrExp2!=null){
+			str+=" "+this.arrExp1.toString();
+		}
+//		str+=" )";
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+		return str;
+	}
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int getInstanceNumer() {
+		return instanceNumer;
+	}
+
+	public void setInstanceNumer(int instanceNumer) {
+		this.instanceNumer = instanceNumer;
+	}
+
+	public boolean validate() throws SPLException {
+		// TODO Auto-generated method stub
+		throw new SPLException("validate() not supported for post collect expression");
+	}
+
+	public boolean isMethodOrParamExists() {
+		return methodOrParamExists;
+	}
+
+	
+	public boolean Array2Exists() {
+		return array2Exists;
+	}
+
+	
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java Fri Jan 11 10:56:30 2008
@@ -1,417 +1,417 @@
-/*
- * 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.expression.primary;
-
-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.TypeConstants;
-import org.apache.imperius.spl.parser.compiler.IdentPrimaryTuple;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.compiler.symboltable.Symbol;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-/*
- * #( i1:IDENT
-         	 (
-	         	#(m2:METHOD_CALL 
-         		 	(paramList = exprList[symTab])?
-         		  )
-         		|  
-         		( 
-         		  i2:IDENT { secondId = i2.getText(); } 
-         	  	   ( 
-         		      arrexp=arrayIndex[symTab]  
-         			   | 
-         			  #( m:METHOD_CALL  
-         				(paramList = exprList[symTab])?  
-         			   ) 
-         			)?  
-         			{ 
-         				if(m != null)
-         					isMethod = true;
-         				tp = new IdentPrimaryTuple(arrexp, paramList, secondId, isMethod);
-         				identTupleList.add(tp);
-         			}
-         		)*
-         	)	
- * 
- */
-
-
-public class PrimaryExpression implements Expression
-{
-    
-    private String _classNameOrInstanceVariableName;
-    
-    private List _identTupleList = null;
-    
-    private SPLSymbolTable _symTab;
-    
-    private Object evaluationResult=null;
-      
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private static final String sourceClass="PrimaryExpression";
-    
-    private TypeInfo _dataType = new TypeInfo();
-    
-    private String _referenceTypeName;
-    
-//    public boolean _isArray = false;
-    
-   
-    public PrimaryExpression(String id1, List identTupleList,
-    		SPLSymbolTable sTab) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PrimaryExpression");
-
-        _identTupleList = identTupleList;
-        _classNameOrInstanceVariableName = id1;
-      
-        //System.out.println("_classNameOrInstanceVariableName "+_classNameOrInstanceVariableName);
-        this._symTab = sTab;
-        if(sTab ==null)
-        {
-        	//System.out.println("PrimaryExpression: sTab is null");
-        }
-        if (sTab.getSymbolTableType() != SPLSymbolTable.COLLECT)
-        {
-            validate();
-        }
-        
-        else if (sTab.getSymbolTableType() == SPLSymbolTable.BASICCOLLECT)
-        {
-            
-//            _isArray = true;
-            this._dataType.setIsArray(true);
-            validate();
-        }
-        if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT)
-        {
-//            _isArray = true;
-        	this._dataType.setIsArray(true);
-            
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "PrimaryExpression");
-        
-        
-    }
-    
-    public String getPropertyName()
-    {
-    	String propName = null;
-    	Iterator idIt = _identTupleList.iterator();
-    	while(idIt.hasNext())
-    	{
-    		IdentPrimaryTuple  idt = (IdentPrimaryTuple)idIt.next();
-    		propName = idt.getPropertyName();
-    		break;
-    	}
-    	//System.out.println("returning property name "+propName);
-    	return propName;
-    }
-    
-    public String getclassNameOrInstanceVariableName()
-    {
-    	
-    	return _classNameOrInstanceVariableName;
-    }
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-      
-        
-        return this._dataType.getIsArray();
-    }
-    
-   
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        boolean isArray = false;
-        //System.out.println("PrimaryExpression id1=" + id1 + "  id2=" + id2);
-        // 
-        // case 1: ident1
-        // case 2: ident1.ident2
-        // case 3: ident1[expr]
-        // case 4: ident1.ident2[expr]
-        if(!_identTupleList.isEmpty())
-        {
-        	TypeInfo returnType = new TypeInfo(TypeConstants.referenceType,
-	        		_classNameOrInstanceVariableName,
-	        		isArray);
-	        int i = 0;
-	        Iterator identTupleIt = _identTupleList.iterator();
-	        while(identTupleIt.hasNext())
-	        {
-	        	if(returnType.getType() == TypeConstants.referenceType)
-	        	{
-	        		String referenceTypeName = returnType.getReferenceTypeName();
-	        		IdentPrimaryTuple ipt = (IdentPrimaryTuple)identTupleIt.next();
-	        		if(i++ == 0) // first element in the list has the same symbol table
-	        		{ // as the primary expression
-	        			ipt.setSymbolTable(_symTab);
-	        		}
-	        		returnType = ipt.validate(referenceTypeName);
-	        	}	
-	        	
-	        	
-	        }
-	        _dataType.copy(returnType);
-//	        _isArray = returnType.getIsArray();
-	        _referenceTypeName = returnType.getReferenceTypeName();
-        }
-        else // local constant
-        {
-            boolean symbolExists = _symTab.symbolExists(_classNameOrInstanceVariableName, true);
-            if( symbolExists )
-            {
-                Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
-                _dataType.copy(sym.getType());
-//              _isArray = sym.isArray();
-                _referenceTypeName = sym.getReferenceTypeName();
-            }
-            else if(_symTab.getInstance(_classNameOrInstanceVariableName)!=null)
-            {
-                // validate! happens when the identifier is an import variable
-            }
-            else
-            {
-                throw new SPLException("Symbol " + _classNameOrInstanceVariableName + " does not exist");
-            }
-            
-        }
-
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-       
-      
-        return true;
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        int i = 0;
-        Object intermediateObject = null;
-        if(!_identTupleList.isEmpty())
-        {	
-	        Iterator idIter = _identTupleList.iterator();
-	        while(idIter.hasNext())
-	        {
-	        	IdentPrimaryTuple ipt = (IdentPrimaryTuple)idIter.next();
-	        	if(i++ == 0)
-	        	{
-	        		intermediateObject = ipt.evaluate();
-	        	}
-	        	else
-	        	{
-	        		intermediateObject = ipt.evaluate(intermediateObject);
-	        	}
-	        	
-	        }
-        }
-        else
-        {
-            
-             if( _symTab.symbolExists(_classNameOrInstanceVariableName,false) )
-             {
-                 Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
-                 intermediateObject = sym.getValue();
-             }
-             else
-             {
-                 intermediateObject = _symTab.getInstance(_classNameOrInstanceVariableName);
-             }
-            
-            
-        }
-        
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-        this.evaluationResult=intermediateObject;
-        
-        return intermediateObject;
-    }
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-       
-      
-        if (_dataType != null)
-        {
-            return _dataType;
-        }
-        else
-        {
-            try
-            {
-                validate();
-            }
-            catch (SPLException e)
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"Exception cought");
-                e.printStackTrace();
-            }
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-            
-            return _dataType;
-        }
-        
-    }
-    
-    
-    
-   
-    
-    public String getClassName()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
-       
-      
-        return _classNameOrInstanceVariableName;
-    }
-    
-    public void setClassName(String className)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
-        this._classNameOrInstanceVariableName = className;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
-       
-      
-        
-    }
-    
-   
-    
-   
-    
-    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 String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-//        String str=id1;
-//        if(id2!=null && !id2.equalsIgnoreCase("")){
-//            str+="."+id2;
-//        }
-//        
-        
-        
-       /*String retStr=_classNameOrInstanceVariableName;
-       
-       if(this._dataType.getIsArray()){
-    	   retStr+="[ ";
-    	   if(this._dataType.getType()==TypeConstants.referenceType){
-    		   retStr+=this._referenceTypeName;
-        	   
-    	   }
-    	   else{
-    		   List params=this._identTupleList;
-    		   Iterator it=params.iterator();
-    		   while(it.hasNext()){
-    			   Object ob=it.next();
-    			   retStr+=ob.toString();
-    		   }
-    	   }
-    	   retStr+=" ]";
-       }    */ 
-        String retStr=" "+this.getPropertyString() +"( ";
-        
-        if(this.evaluationResult!=null){
-        	retStr+=this.evaluationResult.toString();
-            
-        }
-        
-        retStr+=" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return retStr;
-    }
-
-	public String getReferenceTypeName() throws SPLException 
-	{
-		return _referenceTypeName;
-	}
-    
-	public String getPropertyString()
-    {
-    	String propName = "";
-    	
-    	Iterator idIt = _identTupleList.iterator();
-    	while(idIt.hasNext())
-    	{
-    		IdentPrimaryTuple  idt = (IdentPrimaryTuple)idIt.next();
-    		propName += idt.getPropertyName()+".";
-    		
-    	}
-    	int length=propName.length();
-    	if(length > 0){
-    		propName=propName.substring(0, (length-2));
-        		
-    	}
-    	//System.out.println("returning property name "+propName);
-    	return propName;
-    }
-	
-	
-}
-
-
+/*
+ * 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.expression.primary;
+
+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.TypeConstants;
+import org.apache.imperius.spl.parser.compiler.IdentPrimaryTuple;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.compiler.symboltable.Symbol;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+/*
+ * #( i1:IDENT
+         	 (
+	         	#(m2:METHOD_CALL 
+         		 	(paramList = exprList[symTab])?
+         		  )
+         		|  
+         		( 
+         		  i2:IDENT { secondId = i2.getText(); } 
+         	  	   ( 
+         		      arrexp=arrayIndex[symTab]  
+         			   | 
+         			  #( m:METHOD_CALL  
+         				(paramList = exprList[symTab])?  
+         			   ) 
+         			)?  
+         			{ 
+         				if(m != null)
+         					isMethod = true;
+         				tp = new IdentPrimaryTuple(arrexp, paramList, secondId, isMethod);
+         				identTupleList.add(tp);
+         			}
+         		)*
+         	)	
+ * 
+ */
+
+
+public class PrimaryExpression implements Expression
+{
+    
+    private String _classNameOrInstanceVariableName;
+    
+    private List _identTupleList = null;
+    
+    private SPLSymbolTable _symTab;
+    
+    private Object evaluationResult=null;
+      
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private static final String sourceClass="PrimaryExpression";
+    
+    private TypeInfo _dataType = new TypeInfo();
+    
+    private String _referenceTypeName;
+    
+//    public boolean _isArray = false;
+    
+   
+    public PrimaryExpression(String id1, List identTupleList,
+    		SPLSymbolTable sTab) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PrimaryExpression");
+
+        _identTupleList = identTupleList;
+        _classNameOrInstanceVariableName = id1;
+      
+        //System.out.println("_classNameOrInstanceVariableName "+_classNameOrInstanceVariableName);
+        this._symTab = sTab;
+        if(sTab ==null)
+        {
+        	//System.out.println("PrimaryExpression: sTab is null");
+        }
+        if (sTab.getSymbolTableType() != SPLSymbolTable.COLLECT)
+        {
+            validate();
+        }
+        
+        else if (sTab.getSymbolTableType() == SPLSymbolTable.BASICCOLLECT)
+        {
+            
+//            _isArray = true;
+            this._dataType.setIsArray(true);
+            validate();
+        }
+        if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT)
+        {
+//            _isArray = true;
+        	this._dataType.setIsArray(true);
+            
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "PrimaryExpression");
+        
+        
+    }
+    
+    public String getPropertyName()
+    {
+    	String propName = null;
+    	Iterator idIt = _identTupleList.iterator();
+    	while(idIt.hasNext())
+    	{
+    		IdentPrimaryTuple  idt = (IdentPrimaryTuple)idIt.next();
+    		propName = idt.getPropertyName();
+    		break;
+    	}
+    	//System.out.println("returning property name "+propName);
+    	return propName;
+    }
+    
+    public String getclassNameOrInstanceVariableName()
+    {
+    	
+    	return _classNameOrInstanceVariableName;
+    }
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+      
+        
+        return this._dataType.getIsArray();
+    }
+    
+   
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+        boolean isArray = false;
+        //System.out.println("PrimaryExpression id1=" + id1 + "  id2=" + id2);
+        // 
+        // case 1: ident1
+        // case 2: ident1.ident2
+        // case 3: ident1[expr]
+        // case 4: ident1.ident2[expr]
+        if(!_identTupleList.isEmpty())
+        {
+        	TypeInfo returnType = new TypeInfo(TypeConstants.referenceType,
+	        		_classNameOrInstanceVariableName,
+	        		isArray);
+	        int i = 0;
+	        Iterator identTupleIt = _identTupleList.iterator();
+	        while(identTupleIt.hasNext())
+	        {
+	        	if(returnType.getType() == TypeConstants.referenceType)
+	        	{
+	        		String referenceTypeName = returnType.getReferenceTypeName();
+	        		IdentPrimaryTuple ipt = (IdentPrimaryTuple)identTupleIt.next();
+	        		if(i++ == 0) // first element in the list has the same symbol table
+	        		{ // as the primary expression
+	        			ipt.setSymbolTable(_symTab);
+	        		}
+	        		returnType = ipt.validate(referenceTypeName);
+	        	}	
+	        	
+	        	
+	        }
+	        _dataType.copy(returnType);
+//	        _isArray = returnType.getIsArray();
+	        _referenceTypeName = returnType.getReferenceTypeName();
+        }
+        else // local constant
+        {
+            boolean symbolExists = _symTab.symbolExists(_classNameOrInstanceVariableName, true);
+            if( symbolExists )
+            {
+                Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
+                _dataType.copy(sym.getType());
+//              _isArray = sym.isArray();
+                _referenceTypeName = sym.getReferenceTypeName();
+            }
+            else if(_symTab.getInstance(_classNameOrInstanceVariableName)!=null)
+            {
+                // validate! happens when the identifier is an import variable
+            }
+            else
+            {
+                throw new SPLException("Symbol " + _classNameOrInstanceVariableName + " does not exist");
+            }
+            
+        }
+
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+       
+      
+        return true;
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        int i = 0;
+        Object intermediateObject = null;
+        if(!_identTupleList.isEmpty())
+        {	
+	        Iterator idIter = _identTupleList.iterator();
+	        while(idIter.hasNext())
+	        {
+	        	IdentPrimaryTuple ipt = (IdentPrimaryTuple)idIter.next();
+	        	if(i++ == 0)
+	        	{
+	        		intermediateObject = ipt.evaluate();
+	        	}
+	        	else
+	        	{
+	        		intermediateObject = ipt.evaluate(intermediateObject);
+	        	}
+	        	
+	        }
+        }
+        else
+        {
+            
+             if( _symTab.symbolExists(_classNameOrInstanceVariableName,false) )
+             {
+                 Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
+                 intermediateObject = sym.getValue();
+             }
+             else
+             {
+                 intermediateObject = _symTab.getInstance(_classNameOrInstanceVariableName);
+             }
+            
+            
+        }
+        
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+        this.evaluationResult=intermediateObject;
+        
+        return intermediateObject;
+    }
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+       
+      
+        if (_dataType != null)
+        {
+            return _dataType;
+        }
+        else
+        {
+            try
+            {
+                validate();
+            }
+            catch (SPLException e)
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"Exception cought");
+                e.printStackTrace();
+            }
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+            
+            return _dataType;
+        }
+        
+    }
+    
+    
+    
+   
+    
+    public String getClassName()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
+       
+      
+        return _classNameOrInstanceVariableName;
+    }
+    
+    public void setClassName(String className)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
+        this._classNameOrInstanceVariableName = className;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
+       
+      
+        
+    }
+    
+   
+    
+   
+    
+    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 String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+//        String str=id1;
+//        if(id2!=null && !id2.equalsIgnoreCase("")){
+//            str+="."+id2;
+//        }
+//        
+        
+        
+       /*String retStr=_classNameOrInstanceVariableName;
+       
+       if(this._dataType.getIsArray()){
+    	   retStr+="[ ";
+    	   if(this._dataType.getType()==TypeConstants.referenceType){
+    		   retStr+=this._referenceTypeName;
+        	   
+    	   }
+    	   else{
+    		   List params=this._identTupleList;
+    		   Iterator it=params.iterator();
+    		   while(it.hasNext()){
+    			   Object ob=it.next();
+    			   retStr+=ob.toString();
+    		   }
+    	   }
+    	   retStr+=" ]";
+       }    */ 
+        String retStr=" "+this.getPropertyString() +"( ";
+        
+        if(this.evaluationResult!=null){
+        	retStr+=this.evaluationResult.toString();
+            
+        }
+        
+        retStr+=" )";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return retStr;
+    }
+
+	public String getReferenceTypeName() throws SPLException 
+	{
+		return _referenceTypeName;
+	}
+    
+	public String getPropertyString()
+    {
+    	String propName = "";
+    	
+    	Iterator idIt = _identTupleList.iterator();
+    	while(idIt.hasNext())
+    	{
+    		IdentPrimaryTuple  idt = (IdentPrimaryTuple)idIt.next();
+    		propName += idt.getPropertyName()+".";
+    		
+    	}
+    	int length=propName.length();
+    	if(length > 0){
+    		propName=propName.substring(0, (length-2));
+        		
+    	}
+    	//System.out.println("returning property name "+propName);
+    	return propName;
+    }
+	
+	
+}
+
+

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java Fri Jan 11 10:56:30 2008
@@ -1,164 +1,164 @@
-/*
- * 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.expression.primary;
-
-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.TypeConstants;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.ReferenceExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-
-public class SelfExpression implements Expression, ReferenceExpression
-{
-    
-    private SPLSymbolTable sTab;
-    private TypeInfo _dataType = null; 
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private static final String sourceClass="SelfExpression";
-    
-    
-    public SelfExpression(SPLSymbolTable symTab)throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SelfExpression");
-       //System.out.println("evaluating Self expression");
-        
-        sTab = symTab;
-        
-        if (!validate())
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"validation error: " + sourceClass
-                    + " has wrong data type passed in.");
-            
-            throw new SPLException("validation error: " + sourceClass
-                    + " has wrong data type passed in.");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ sourceClass);
-        
-    }
-    
-    public String getReferenceTypeName()
-    {
-    	 logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-         //System.out.println("evaluating Self expression");
-    	 String referenceTypeName = null;
-         
-          SPLSymbolTable symbtab=sTab;
-          while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
-          	symbtab=sTab.getParentSymbolTable();
-          }
-          
-          
-          if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
-          {	
-              SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
-              List anchorClassList = parentSymTab.getAnchorClassList();
-              Iterator anchorClassListIt = anchorClassList.iterator();
-             
-             	referenceTypeName = (String)anchorClassListIt.next();
-             
-             
-          }
-          else{
-//          	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
-        	  logger.severe("non collect Parent SymbolTable not found in Self Expression");
-        	  
-          }
-          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-          return referenceTypeName;
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-       //System.out.println("evaluating Self expression");
-        Object ins = null;
-        SPLSymbolTable symbtab=sTab;
-        while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
-        	symbtab=sTab.getParentSymbolTable();
-        }
-        
-        
-        if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
-        {	
-            SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
-            String referenceTypeName = null;
-            List anchorClassList = parentSymTab.getAnchorClassList();
-            Iterator anchorClassListIt = anchorClassList.iterator();
-           
-           	referenceTypeName = (String)anchorClassListIt.next();
-           
-            ins = parentSymTab.getInstance(referenceTypeName);
-        }
-        else{
-        	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-        return ins;
-    }
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-        return _dataType;
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        _dataType = new TypeInfo(TypeConstants.referenceType,null,false);
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        return true;
-    }
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-        // TODO Auto-generated method stub
-        return false;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        String str=" self ";
-                         
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * 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.expression.primary;
+
+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.TypeConstants;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.ReferenceExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+
+public class SelfExpression implements Expression, ReferenceExpression
+{
+    
+    private SPLSymbolTable sTab;
+    private TypeInfo _dataType = null; 
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private static final String sourceClass="SelfExpression";
+    
+    
+    public SelfExpression(SPLSymbolTable symTab)throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SelfExpression");
+       //System.out.println("evaluating Self expression");
+        
+        sTab = symTab;
+        
+        if (!validate())
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"validation error: " + sourceClass
+                    + " has wrong data type passed in.");
+            
+            throw new SPLException("validation error: " + sourceClass
+                    + " has wrong data type passed in.");
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ sourceClass);
+        
+    }
+    
+    public String getReferenceTypeName()
+    {
+    	 logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+         //System.out.println("evaluating Self expression");
+    	 String referenceTypeName = null;
+         
+          SPLSymbolTable symbtab=sTab;
+          while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
+          	symbtab=sTab.getParentSymbolTable();
+          }
+          
+          
+          if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
+          {	
+              SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
+              List anchorClassList = parentSymTab.getAnchorClassList();
+              Iterator anchorClassListIt = anchorClassList.iterator();
+             
+             	referenceTypeName = (String)anchorClassListIt.next();
+             
+             
+          }
+          else{
+//          	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
+        	  logger.severe("non collect Parent SymbolTable not found in Self Expression");
+        	  
+          }
+          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+          return referenceTypeName;
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+       //System.out.println("evaluating Self expression");
+        Object ins = null;
+        SPLSymbolTable symbtab=sTab;
+        while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
+        	symbtab=sTab.getParentSymbolTable();
+        }
+        
+        
+        if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
+        {	
+            SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
+            String referenceTypeName = null;
+            List anchorClassList = parentSymTab.getAnchorClassList();
+            Iterator anchorClassListIt = anchorClassList.iterator();
+           
+           	referenceTypeName = (String)anchorClassListIt.next();
+           
+            ins = parentSymTab.getInstance(referenceTypeName);
+        }
+        else{
+        	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+        return ins;
+    }
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        return _dataType;
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+        _dataType = new TypeInfo(TypeConstants.referenceType,null,false);
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+        return true;
+    }
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        // TODO Auto-generated method stub
+        return false;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        String str=" self ";
+                         
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/BooleanExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/BooleanExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/BooleanExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/BooleanExpression.java Fri Jan 11 10:56:30 2008
@@ -1,28 +1,28 @@
-/*
- * 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.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-
-public interface BooleanExpression extends Expression
-{
-    
-}
+/*
+ * 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.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+
+public interface BooleanExpression extends Expression
+{
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/CalendarExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/CalendarExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/CalendarExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/CalendarExpression.java Fri Jan 11 10:56:30 2008
@@ -1,28 +1,28 @@
-/*
- * 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.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-
-public interface CalendarExpression extends Expression
-{
-    
-}
+/*
+ * 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.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+
+public interface CalendarExpression extends Expression
+{
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ConstantExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ConstantExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ConstantExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ConstantExpression.java Fri Jan 11 10:56:30 2008
@@ -1,42 +1,42 @@
-/*
- * 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.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-
-
-public abstract class ConstantExpression implements Expression
-{
-    
-    
-    
-    public boolean validate()
-    {
-        return true;
-    }
-    public String getReferenceTypeName() throws SPLException
-    {
-    	//throw new SPLException("Expression is not of type reference");
-    	return null;
-    }
-    
-}
+/*
+ * 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.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+
+
+public abstract class ConstantExpression implements Expression
+{
+    
+    
+    
+    public boolean validate()
+    {
+        return true;
+    }
+    public String getReferenceTypeName() throws SPLException
+    {
+    	//throw new SPLException("Expression is not of type reference");
+    	return null;
+    }
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,151 +1,151 @@
-/*
- * 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.expressions;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public abstract class DoubleArgumentExpression implements Expression
-{
-    
-    protected Expression _lhsExp;
-    
-    protected Expression _rhsExp;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private final String sourceClass="DoubleArgumentExpression";
-    
-   // protected boolean _isArray = false;
-    
-    protected TypeInfo _dataType = new TypeInfo();
-    
-    public DoubleArgumentExpression(List exprList)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
-
-    
-        if (exprList != null)
-        {
-            
-            if (exprList.size() == 2)
-            {
-                Expression l = (Expression) exprList.get(0);
-                Expression r = (Expression) exprList.get(1);
-                
-                if (l == null)
-                {
-                    logger.severe(
-                    "left hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "left hand side expression passed in is null.");
-                }
-                else
-                {
-                    // //System.out.println("DoubleArgumentExpression::LHS
-                    // "+l.getClass()+l.toString());
-                }
-                
-                if (r == null)
-                {
-                    logger.severe(
-                    "right hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "right hand side expression passed in is null.");
-                }
-                else
-                {
-                    // //System.out.println("DoubleArgumentExpression::RHS
-                    // "+r.getClass()+r.toString());
-                }
-                
-                this._lhsExp = l;
-                this._rhsExp = r;
-                
-            }
-            else
-            {
-                logger.severe(
-                        "No of arguments should be 2, but is "
-                        + exprList.size());
-                
-                throw new IllegalArgumentException(
-                        "No of arguments should be 2, but is "
-                                + exprList.size());
-            }
-        }
-        else
-        {
-            logger.severe(
-            "No of arguments passed required number of arguments is 2");
-            throw new IllegalArgumentException(
-                    "No of arguments passed required number of arguments is 2");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
-        
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
-    }
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        return _dataType.getIsArray();
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._rhsExp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() 
-    {
-    	return null;
-    }
-}
+/*
+ * 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.expressions;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public abstract class DoubleArgumentExpression implements Expression
+{
+    
+    protected Expression _lhsExp;
+    
+    protected Expression _rhsExp;
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private final String sourceClass="DoubleArgumentExpression";
+    
+   // protected boolean _isArray = false;
+    
+    protected TypeInfo _dataType = new TypeInfo();
+    
+    public DoubleArgumentExpression(List exprList)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
+
+    
+        if (exprList != null)
+        {
+            
+            if (exprList.size() == 2)
+            {
+                Expression l = (Expression) exprList.get(0);
+                Expression r = (Expression) exprList.get(1);
+                
+                if (l == null)
+                {
+                    logger.severe(
+                    "left hand side expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "left hand side expression passed in is null.");
+                }
+                else
+                {
+                    // //System.out.println("DoubleArgumentExpression::LHS
+                    // "+l.getClass()+l.toString());
+                }
+                
+                if (r == null)
+                {
+                    logger.severe(
+                    "right hand side expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "right hand side expression passed in is null.");
+                }
+                else
+                {
+                    // //System.out.println("DoubleArgumentExpression::RHS
+                    // "+r.getClass()+r.toString());
+                }
+                
+                this._lhsExp = l;
+                this._rhsExp = r;
+                
+            }
+            else
+            {
+                logger.severe(
+                        "No of arguments should be 2, but is "
+                        + exprList.size());
+                
+                throw new IllegalArgumentException(
+                        "No of arguments should be 2, but is "
+                                + exprList.size());
+            }
+        }
+        else
+        {
+            logger.severe(
+            "No of arguments passed required number of arguments is 2");
+            throw new IllegalArgumentException(
+                    "No of arguments passed required number of arguments is 2");
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
+        
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return _dataType;
+    }
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+        return _dataType.getIsArray();
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._rhsExp.toString()+" )";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() 
+    {
+    	return null;
+    }
+}

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



Mime
View raw message