incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnee...@apache.org
Subject svn commit: r610845 - /incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java
Date Thu, 10 Jan 2008 17:12:20 GMT
Author: jneeraj
Date: Thu Jan 10 09:12:18 2008
New Revision: 610845

URL: http://svn.apache.org/viewvc?rev=610845&view=rev
Log:
Updated evaluate and validate methods to allow imported instances to be used in primary expressions

Modified:
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java

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=610845&r1=610844&r2=610845&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
Thu Jan 10 09:12:18 2008
@@ -30,8 +30,8 @@
 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.*;
-import org.apache.imperius.spl.parser.util.*;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -196,18 +196,26 @@
         }
         else // local constant
         {
-        	boolean symbolExists = _symTab.symbolExists(_classNameOrInstanceVariableName, true);
-        	Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
-        	if(!symbolExists)
-        	{
-        		throw new SPLException("Symbol " + _classNameOrInstanceVariableName + " does not
exist");
-        	}
-        	_dataType.copy(sym.getType());
-//        	_isArray = sym.isArray();
-        	_referenceTypeName = sym.getReferenceTypeName();
-        	
+            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");
        
       
@@ -238,8 +246,18 @@
         }
         else
         {
-        	Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
-        	intermediateObject = sym.getValue();
+            
+             if( _symTab.symbolExists(_classNameOrInstanceVariableName,false) )
+             {
+                 Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
+                 intermediateObject = sym.getValue();
+             }
+             else
+             {
+                 intermediateObject = _symTab.getInstance(_classNameOrInstanceVariableName);
+             }
+            
+            
         }
         
         



Mime
View raw message