incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnee...@apache.org
Subject svn commit: r606479 [9/30] - in /incubator/imperius/trunk/trunk: ./ modules/ modules/imperius-javaspl/ modules/imperius-javaspl/resources/ modules/imperius-javaspl/resources/samples/ modules/imperius-javaspl/resources/samples/computersystem/ modules/im...
Date Sat, 22 Dec 2007 19:34:03 GMT
Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimspl.tree.g
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimspl.tree.g?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimspl.tree.g (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimspl.tree.g Sat Dec 22 11:33:46 2007
@@ -0,0 +1,1455 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ * 
+ * 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>
+ 
+ 
+  header {
+  	/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * 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.compiler;
+ 
+  }
+
+
+
+options {
+    language=Java;
+}
+{
+import java.util.*;
+import java.io.*;
+import org.apache.imperius.spl.parser.statements.impl.*;
+import org.apache.imperius.spl.parser.statements.*;
+import org.apache.imperius.spl.parser.statements.impl.*;
+import org.apache.imperius.spl.parser.factory.*;
+import org.apache.imperius.spl.parser.expressions.*;
+import org.apache.imperius.spl.parser.expressions.impl.*;
+import org.apache.imperius.spl.parser.util.*;
+import org.apache.imperius.spl.parser.compiler.IdentPrimaryTuple;
+import org.apache.imperius.spl.parser.compiler.symboltable.*;
+import org.apache.imperius.spl.parser.statements.PolicyStatement;
+import org.apache.imperius.spl.parser.exceptions.*;
+import org.apache.imperius.spl.external.*;
+import org.apache.imperius.util.SPLLogger;
+import org.apache.imperius.spl.parser.expression.primary.*;
+import org.apache.imperius.spl.parser.exceptions.*;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+
+
+
+
+
+}
+
+class SPLTreeParser extends TreeParser;
+
+options {
+    importVocab=cimspl;
+     ASTLabelType="org.apache.imperius.spl.parser.compiler.ASTWithLineNumber";
+    genHashLines = true;        // include line number information
+    
+
+
+}
+
+
+{
+SPLSymbolTable globalSymbolTable = new SPLSymbolTable();
+private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+SPLSymbolTable currSymbolTable = globalSymbolTable;
+String currAnchor = "";
+DataCollector dataCollector = null;
+
+//ExpressionFactory expressionFactory = new ExpressionFactory();
+}
+
+splpolicy[DataCollector dc, SPLSymbolTable currentSymTab] returns [SPLPolicy cp = null]
+{
+		dataCollector = dc;
+        SPLSymbolTable symTab = new SPLSymbolTable(currentSymTab,SPLSymbolTable.POLICYGROUP);
+        symTab.setDataCollector(dataCollector);
+        
+        currSymbolTable = symTab;
+        List importStatementList  = new ArrayList();
+        ImportStatement i = null;
+        PolicyStatement p = null;
+        ArrayList pStmtList = new ArrayList();
+        DeclarationStatement d = null;
+        StrategyStatement s = null;
+		
+}
+:
+        (i=importstatement[symTab]{importStatementList.add(i);})+ s=strategystatement (d=declarationstatement[symTab])? (p=policystatement[symTab] {pStmtList.add(p);} )+
+        { 
+                cp = new SPLPolicy(importStatementList,s,d,pStmtList,symTab);
+                if(logger.isLoggable(Level.FINE))
+                	logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: SPLPolicy Created");
+            
+          
+        }
+        ;  
+//i:"Import"^ {#i.setType(IMPORT_DEF);} IDENT (DOT! IDENT)* (identList)? (expression)? SEMI! 
+importstatement[SPLSymbolTable symTab] returns [ImportStatement i = null]
+{
+   Expression e = null;
+   String qual = null;
+   StringBuffer className = new StringBuffer();
+   List instanceInfoList = new ArrayList();
+
+}
+: //(03-04-2007) PB: set namespace before set anchor as datacollector needs it in order to populate anchor elements
+  #(IMPORT_DEF (qual = qualifier)? i1:IDENT {className.append(i1.getText());}(i2:IDENT {className.append("." + i2.getText());})*
+  		(instanceInfoList = identList)? 
+  	{ 
+	  	try
+	  	{
+	  		//System.out.println("class name, qual = "+className.toString()+" , "+qual);
+	  		symTab.addAnchor(className.toString(), qual, instanceInfoList);
+	  	}	
+	  	catch (SPLException exep)
+	  	{ 
+	  			ASTWithLineNumber q = (ASTWithLineNumber)i1;
+	  			//System.out.println(exep.getMessage() + "at line" + q.getLine()); 
+	  			
+	  	}
+  	}
+  	(e=expression[symTab])?)
+  	{
+//  currSymbolTable.setAnchor(i4.getText());
+	  i = new ImportStatement(instanceInfoList,e,symTab); 
+	  //if(logger.isLoggable(Level.FINE))
+	  //logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: ImportStatement Created");
+            
+  
+  	}
+                  
+
+; 
+
+qualifier returns [String qualifier = null]
+:
+#(QUALIFIER c:IDENT { qualifier = c.getText(); } )
+;	
+
+identList returns [List instanceInfoList = null] 
+{
+   InstanceInfo ii = null;	
+   instanceInfoList = new ArrayList();
+}	
+:
+#(COLON cl:IDENT { ii = new InstanceInfo(cl.getText(),new Object());instanceInfoList.add(ii);} 
+  		(c2:IDENT { ii = new InstanceInfo(c2.getText(), new Object()); instanceInfoList.add(ii);} )*)
+  		
+  		;
+
+strategystatement returns [StrategyStatement s = null] :
+                #(STRATEGY_DEF (
+                "Execute_All_Applicable" 
+                {
+                   	s = new StrategyStatement("Execute_All_Applicable");
+                   	if(logger.isLoggable(Level.FINE))
+  				   		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: StrategyStatement Created");
+   
+                }
+                | 
+                "Execute_First_Applicable"
+                 {
+                   	s = new StrategyStatement("Execute_First_Applicable");
+                   	if(logger.isLoggable(Level.FINE))
+  				   		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: StrategyStatement Created");
+   
+                 }
+                
+                ))
+                
+                        
+;  
+
+declarationstatement[SPLSymbolTable symTab] returns [DeclarationStatement d = null] 
+{
+        ArrayList cList = new ArrayList();
+        ArrayList mList = new ArrayList();
+        MacroDefinition m = null;
+        ConstantDefinition c = null;
+}
+
+:     
+                #(DECL_DEF ((c = constantDefinitions[symTab] {cList.add(c);} ) | (m=macroDeclarations[symTab] {mList.add(m);} ))* )
+                {
+                        d = new DeclarationStatement(cList,mList,symTab);
+                        if(logger.isLoggable(Level.FINE))
+  				   			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: DeclarationStatement Created");
+   
+                }
+
+        ; 
+
+constantDefinitions[SPLSymbolTable symTab]  returns [ConstantDefinition cd = null ]
+{
+        Expression v = null;
+}
+:
+                 #(t:CONSTANT_DEFN id:IDENT v=varInitializer[symTab])
+                  {
+                 	//currSymbolTable.insertVariableSymbol(id.getText(),null,null);
+                 	try
+                 	{
+                 		//System.out.println("id.getText() "+id.getText() +" v.getType() "+v.getType()+ " v "+v.toString() );
+                 		
+                 		symTab.insertVariableSymbol(id.getText(),v.getType(),false,false); 
+                  		cd = new ConstantDefinition(id.getText(),v,symTab);
+                  		if(logger.isLoggable(Level.FINE))
+  				   			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: ConstantDefinition Created "+id.getText());
+   
+                 	}
+                 	catch(SPLException excep)
+					{
+						ASTWithLineNumber q = (ASTWithLineNumber)t;
+						logger.severe(excep.getMessage());
+						logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception inserting symbol "+id.getText() +" at line "+q.getLine());
+						//System.out.println(excep.getMessage());
+						//System.out.println("TreeParser::Exception inserting symbol "+id.getText() +" at line "+q.getLine());
+						System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+						throw new RecognitionException(excep.getMessage());
+					}
+                  
+                  } 
+	                      
+;
+
+varInitializer[SPLSymbolTable symTab] returns [Expression v = null]
+{
+	
+}
+
+  :
+                #(ASSIGN v=expression[symTab])
+{
+		
+}	                
+                
+        ;
+
+
+macroDeclarations[SPLSymbolTable symTab] returns [MacroDefinition m = null]:
+                #(MACRO_DEFN m=macrodef[symTab])
+      ;
+macrodef[SPLSymbolTable symTab] returns [MacroDefinition m = null] 
+{
+        ArrayList a=new ArrayList();
+        Expression e = null;
+        String arr = "";
+		String typestr="";
+		boolean isArr=false;
+        SPLSymbolTable macroSymTab = new SPLSymbolTable(symTab,2);
+        
+        macroSymTab.setSymbolTableType(SPLSymbolTable.MACRO);
+        symTab.addChildSymbolTable(macroSymTab);
+        
+                
+}
+:
+                #("Name" id:IDENT arr=splType  a=argumentList[macroSymTab] e=expression[macroSymTab])
+                {
+                       // currSymbolTable.insertMethodSymbol(id.getText(),c.getText(),a);
+                  //System.out.println("treeparser c= "+c.getText());
+                  if(logger.isLoggable(Level.FINE))
+  				   		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: MacroDefinition type "+arr);
+   
+                  if(arr!=null)
+                	{
+	                	if(arr.indexOf("[") != -1)
+	                	{
+	                		typestr=arr.substring(0,arr.indexOf("["));
+	                		if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: MacroDefinition typestr "+typestr);
+	                		isArr=true;
+	                		if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: macro isArray = "+isArr);
+   
+	                	}
+	                	else
+	                	{
+	                		typestr=arr;
+	                	}
+                	}
+                	else
+                	{
+                		logger.severe(Thread.currentThread().getName()+" "+" arr string is null in macrodef ");
+                	}
+                	
+                  //int type = TypeConstants.getActualType(typestr);
+                  
+                  	
+                  
+                  	
+                  	
+                  
+                  try
+                  {
+                  	m = new MacroDefinition(id.getText(),typestr,isArr,a,e,macroSymTab,symTab); 
+                  	//System.out.println("MacroDefinition : "+id.getText()+" "+typestr);
+                  	
+                    if(logger.isLoggable(Level.FINE))
+  				   		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: MacroDefinition Created "+id.getText());
+   
+                  	symTab.insertMacroSymbol(id.getText(),typestr,isArr,a,m);
+                  	//System.out.println("inserted MacroSymbol into Symbol Table : "+id.getText());
+                  	if(logger.isLoggable(Level.FINE))
+  				   		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: MacroDefinition inserted into SymbolTable "+id.getText());
+   
+                  }
+                  catch(SPLException excep)
+                  {
+                  		ASTWithLineNumber q = (ASTWithLineNumber)id;
+						logger.severe(excep.getMessage());
+						logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception inserting symbol "+id.getText() +" at line "+q.getLine());
+						//System.out.println(excep.getMessage());
+						//System.out.println("TreeParser::Exception inserting symbol "+id.getText() +" at line "+q.getLine());
+						System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+						throw new RecognitionException(excep.getMessage());
+						
+                  }		
+                 
+                  
+                }
+       ; 
+argumentList[SPLSymbolTable symTab]  returns [ArrayList argTypes=new ArrayList()] 
+{ Argument at = null;
+}
+ :
+                #(ARGUMENTS (at=argument[symTab] {argTypes.add(at);})* )
+       ;
+
+argument[SPLSymbolTable symTab] returns [Argument tp = null]
+{ 
+	String arr = "";
+	String typestr="";
+	boolean isArr=false;
+}
+ :
+                #(ARG_DEF #(TYPE arr=splType ) i:IDENT )
+                {
+                	if(logger.isLoggable(Level.FINE))
+  				   			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: macro arr = "+arr);
+   
+                	if(arr!=null)
+                	{
+	                	if(arr.indexOf("[") != -1)
+	                	{
+	                		typestr=arr.substring(0,arr.indexOf("["));
+	                		if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: MacroDefinition typestr "+typestr);
+	                		isArr=true;
+	                		if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: macro isArray = "+isArr);
+   
+	                	}	
+	                	else
+	                	{
+	                		typestr=arr;
+	                	}
+                	}
+                	else
+                	{
+                		logger.severe(Thread.currentThread().getName()+" "+" arr string is null in argument ");
+                	}
+                		
+                		
+                		try
+                		{
+                			int type = TypeConstants.getActualType(typestr);
+	                		
+                	    	symTab.insertVariableSymbol(i.getText(),type,null,isArr,false,false);
+                	    	if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: Variable inserted into SymbolTable "+i.getText());
+   
+                        	tp = new ArgumentImpl(typestr,i.getText(),isArr,null); 
+                        	if(logger.isLoggable(Level.FINE))
+  				   				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: Argument created");
+   
+                		}
+                		catch(SPLException excep)
+                		{
+                			ASTWithLineNumber q = (ASTWithLineNumber)i;
+							logger.severe(excep.getMessage());
+							logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception inserting symbol "+i.getText() +" at line "+q.getLine());
+							//System.out.println(excep.getMessage());
+							//System.out.println("TreeParser::Exception inserting symbol "+i.getText() +" at line "+q.getLine());
+							System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+							throw new RecognitionException(excep.getMessage());
+                		}		
+                }
+           
+;
+
+
+policystatement[SPLSymbolTable symTab] returns [PolicyStatement p = null]
+:
+                ( p = policydef[symTab] | p =  policyGroup[symTab] )
+        
+;
+
+
+policydef[SPLSymbolTable symTab]  returns [PolicyDefinition pd = null]
+     { 
+        SPLSymbolTable lclSymTab = new SPLSymbolTable(symTab);
+        symTab.addChildSymbolTable(lclSymTab);
+     //   currSymbolTable = symTab;
+        DeclarationStatement d = null;
+        Expression exp = null;
+        ActionBlock dec = null;
+        
+     }   
+: 
+        #(POLICY_DEF (d = declarationstatement[lclSymTab])? (exp = conditionstatement[lclSymTab])? dec = decision[lclSymTab] p:priority) 
+        {   
+               // currSymbolTable = currSymbolTable.getParentSymbolTable(); 
+                pd = new PolicyDefinition(d,exp,dec,p.getText(),lclSymTab);
+                if(logger.isLoggable(Level.FINE))
+  				   logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: PolicyDefinition Created");
+   
+        
+        
+        } 
+
+      
+;
+
+conditionstatement[SPLSymbolTable symTab] returns [Expression exp = null]:
+        #(CONDITION_DEF exp=expression[symTab])
+        {/*//System.out.println("cimspl.tree.g condition statement "+exp);*/}
+    
+;
+decision[SPLSymbolTable symTab] returns [ActionBlock ab=null]:
+
+        #(DECISION_DEF ab=actionBlock[symTab])
+    
+;
+
+priority :
+        NUM_INT
+; 
+expression[SPLSymbolTable symTab] returns [Expression exp=null]:
+        #(EXPR exp=expr[symTab])
+     
+;
+
+expr[SPLSymbolTable symTab] returns [Expression e=null] 
+{
+        Expression e1=null;
+        Expression e2=null;
+
+}
+
+:
+		#(t:ASSIGN e1=expr[symTab] e2=expr[symTab])
+        { 
+        	try 
+        	{ 
+        		e = ExpressionFactory.createExpression(e1,e2,ASSIGN,symTab); 
+        		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+        	}
+        	catch (SPLException excep) 
+        	{
+        		ASTWithLineNumber q = (ASTWithLineNumber)t;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());
+        	}
+        }
+        |#(t1:LOR e1=expr[symTab] e2=expr[symTab]) 
+	    { 
+	    	try 
+	    	{ 
+	    		e = ExpressionFactory.createExpression(e1,e2,LOR,symTab);
+	    		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	    	}
+	    	catch (SPLException excep) 
+	    	{
+	    		ASTWithLineNumber q = (ASTWithLineNumber)t1;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				//throw new RecognitionException(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());
+			}
+	   }
+       | #(t2:LAND e1=expr[symTab] e2=expr[symTab]) 
+        { 
+        	try 
+        	{
+        		e = ExpressionFactory.createExpression(e1,e2,LAND,symTab);
+        		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+        	}
+        	catch (SPLException excep) 
+        	{
+        		ASTWithLineNumber q = (ASTWithLineNumber)t2;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				//throw new RecognitionException(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+        	}
+       }
+       |#(t3:BXOR e1=expr[symTab] e2=expr[symTab]) 
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,BXOR,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t3;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t4:NOT_EQUAL e1=expr[symTab] e2=expr[symTab])
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,NOT_EQUAL,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t4;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t5:EQUAL e1=expr[symTab] e2=expr[symTab]) 
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,EQUAL,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       		
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t5;
+	       		//System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+			}
+       }
+       |#(t6:LT e1=expr[symTab] e2=expr[symTab])
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,LT,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       		
+			}
+			catch (SPLException excep) 
+			{
+				ASTWithLineNumber q = (ASTWithLineNumber)t6;
+				//System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());				
+			}
+	   }
+       |#(t7:GT e1=expr[symTab] e2=expr[symTab]) 
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,GT,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t7;
+	       		//System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());				
+	       	}
+       }
+       |#(t8:LE e1=expr[symTab] e2=expr[symTab])  
+       {
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,LE,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t8;
+	       		//System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t9:GE e1=expr[symTab] e2=expr[symTab])   
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,GE,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t9;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t10:PLUS e1=expr[symTab] e2=expr[symTab])  
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,PLUS,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	} 
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t10;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t11:MINUS e1=expr[symTab] e2=expr[symTab]) 
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,MINUS,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t11;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t12:DIV e1=expr[symTab] e2=expr[symTab])   
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,DIV,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	} 
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t12;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t13:STAR e1=expr[symTab] e2=expr[symTab])  
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,e2,STAR,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t13;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t14:UNARY_MINUS e1=expr[symTab]) 
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,UNARY_MINUS,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	} 
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t14;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				//throw new RecognitionException("");
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |#(t15:UNARY_PLUS e1=expr[symTab])   
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,UNARY_PLUS,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t15;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());				
+	       	}
+       }
+       |#(t16:UNARY_NOT e1=expr[symTab])
+       { 
+	       	try 
+	       	{
+	       		e = ExpressionFactory.createExpression(e1,UNARY_NOT,symTab);
+	       		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	       	}
+	       	catch (SPLException excep) 
+	       	{
+	       		ASTWithLineNumber q = (ASTWithLineNumber)t16;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());			
+	       	}
+       }
+       |e=primaryExpression[symTab] 
+       {
+       	
+       } 
+ ;  
+  
+       
+primaryExpression[SPLSymbolTable symTab] returns [Expression e = null]
+        : 
+            
+           
+           t:"true"  
+          { 
+	          	try 
+	          	{ 
+	          		e = ExpressionFactory.createExpression(t.getText(),TypeConstants.booleanType);
+	          		if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	          	}
+	          	catch (SPLException excep) 
+	          	{
+	          		ASTWithLineNumber q = (ASTWithLineNumber)t;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+					System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());				
+	          	}
+          }
+          | f:"false" 
+          { 
+	          	try 
+	          	{
+	          		e = ExpressionFactory.createExpression(f.getText(),TypeConstants.booleanType);
+	          		if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   
+	          	}catch (SPLException excep) 
+	          	{
+	          		ASTWithLineNumber q = (ASTWithLineNumber)f;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+					System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());				
+	          	}
+          }
+          | s:"Self"  
+          { 
+          	try 
+	          	{
+          		//System.out.println("Self expression");
+          		e = ExpressionFactory.createSelfExpression(symTab);
+          		if(logger.isLoggable(Level.FINE))
+  					logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+e.toString());
+   				}catch (SPLException excep) 
+	          	{
+	          		ASTWithLineNumber q = (ASTWithLineNumber)s;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+					System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());				
+	          	}
+          }
+	      | e = constant 
+	      {
+	      	
+	      }
+          | e = identPrimary[symTab]  
+          { 
+          	//System.out.println("identPrimary");
+          }
+                    ; 
+          
+identPrimary[SPLSymbolTable symTab] returns [Expression e=null]
+{
+    Expression arrexp = null;
+    List paramList = new ArrayList();
+    String secondId = "";
+    boolean isMethod = false;
+    boolean isBuiltInMethod = false;
+    List identTupleList = new ArrayList();
+    IdentPrimaryTuple tp = null;
+    SPLSymbolTable sTab = symTab;
+}
+
+:
+          e = collectExpr[symTab]
+        |
+         #( 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;
+         				sTab = new SPLSymbolTable();
+         				tp = new IdentPrimaryTuple(arrexp, paramList, secondId, isMethod,sTab);
+         				identTupleList.add(tp);
+         				
+  
+         			    
+         			}
+         		)*
+         	)	
+         		 
+          )       
+         {
+            if(m2!=null)
+            {
+                isBuiltInMethod = true;
+               //System.out.println("is isBuiltInMethod=true");
+            }
+            // do the symbol validation here
+            try
+            {
+            	if(!isBuiltInMethod)
+            	{
+            		e = ExpressionFactory.createExpression(i1.getText(),identTupleList,isBuiltInMethod,symTab);
+	            	if(logger.isLoggable(Level.FINE))
+	            	{
+  						logger.fine(Thread.currentThread().getName()+
+  							" CIMSPLTreeParser:: expression created "+e.toString());
+	            	}		
+            	}
+            	else
+            	{
+            		e = ExpressionFactory.createExpression(i1.getText(),paramList,isBuiltInMethod,symTab);
+            		if(logger.isLoggable(Level.FINE))
+            		{
+  						logger.fine(Thread.currentThread().getName()+
+  							" CIMSPLTreeParser:: expression created "+e.toString());
+            		}		
+            	}			
+   
+            }
+            catch(SPLException excep)
+            {
+            	ASTWithLineNumber q = (ASTWithLineNumber)i1;
+				logger.severe(excep.getMessage());
+				logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+				//System.out.println(excep.getMessage());
+				//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+				System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+				throw new RecognitionException(excep.getMessage());				
+            }
+              
+            		
+         } 
+        |  e = basicCollectExpr[symTab]
+         
+        ;
+
+collectExpr[SPLSymbolTable symTab]  returns [Expression expr=null]
+{
+  ArrayList paramList = new ArrayList();
+  Expression arrExp = null;
+  Expression postExpr = null;
+  SPLSymbolTable collectSymbolTable = new SPLSymbolTable();
+  collectSymbolTable.setSymbolTableType(SPLSymbolTable.COLLECT);
+  collectSymbolTable.setParentSymbolTable(symTab) ;
+  collectSymbolTable.setDefaultQualifier(symTab.getDefaultQualifier());
+  
+
+}  
+        :
+       #(c:COLLECT_OP #(COLLECT_CALL paramList = exprList[collectSymbolTable]) (postExpr = methodPropArrForCollect[symTab,collectSymbolTable])?  )
+{
+	try
+	{
+		//System.out.println("createCollectExpression"); 
+        expr = ExpressionFactory.createCollectExpression(paramList,postExpr,collectSymbolTable);
+        if(logger.isLoggable(Level.FINE))
+  			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+expr.toString());
+   
+	}
+	catch (SPLException excep)  
+	{
+            ASTWithLineNumber q = (ASTWithLineNumber)c;
+			logger.severe(excep.getMessage()); 
+			logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+			//System.out.println(excep.getMessage());
+			//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+			throw new RecognitionException(excep.getMessage());			
+	}	    
+}   
+;
+
+methodPropArrForCollect[SPLSymbolTable symTab, SPLSymbolTable cSymTab] returns [Expression exp = null] 
+{
+   Expression arrExp1 = null;
+   Expression arrExp2 = null;
+   ArrayList pList = null;
+   String ident = "";
+}
+        :
+        (arrExp1 = arrayIndex[symTab] ( id:IDENT {ident = id.getText();}( #(INDEX_OP arrExp2=expression[symTab]) | #(METHOD_CALL (pList = exprList[symTab])? )  )? )? )
+         
+{
+	try
+	{
+        exp = ExpressionFactory.createPostCollectExpression(arrExp1, ident,arrExp2 ,pList,cSymTab);
+        if(logger.isLoggable(Level.FINE))
+  			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+exp.toString());
+   }
+	catch (SPLException excep)  
+	{
+            ASTWithLineNumber q = (ASTWithLineNumber)id; 
+			logger.severe(excep.getMessage()); 
+			logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+			//System.out.println(excep.getMessage());
+			//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+			throw new RecognitionException(excep.getMessage());			
+	}	 
+}
+          
+         ;           
+
+
+
+basicCollectExpr[SPLSymbolTable symTab]  returns [Expression expr=null]
+{
+  ArrayList paramList = new ArrayList();
+  Expression arrExp = null;
+  Expression postExpr = null;
+  SPLSymbolTable collectSymbolTable = new SPLSymbolTable();
+  collectSymbolTable.setSymbolTableType(SPLSymbolTable.BASICCOLLECT);
+  collectSymbolTable.setParentSymbolTable(symTab) ;
+  collectSymbolTable.setDefaultQualifier(symTab.getDefaultQualifier());
+  
+  //symTab.addChildSymbolTable(collectSymbolTable);
+  
+
+}  
+        :
+       #(c:BASICCOLLECTION_OP paramList = exprList[collectSymbolTable]  )
+{
+	try
+	{
+		//System.out.println("calling Expression factory to create Basic Collection Expression");
+        expr = ExpressionFactory.createBasicCollectExpression(paramList,collectSymbolTable);
+		if(expr!=null){
+			if(logger.isLoggable(Level.FINE))
+  				logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+expr.toString());
+   
+		}
+		else{
+			logger.severe(Thread.currentThread().getName()+" "+"Basic collection expression not created by expression factory");
+		 	throw new SPLException("Basic collection expression not created by expression factory");
+		}
+		
+	}
+	catch (SPLException excep)  
+	{
+		ASTWithLineNumber q = (ASTWithLineNumber)c;
+		logger.severe(excep.getMessage());
+		logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+		//System.out.println(excep.getMessage());
+		//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+		System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+		throw new RecognitionException(excep.getMessage());	
+	}	    
+}   
+;
+   //
+//collectmethodcall[SPLSymbolTable symTab, SPLSymbolTable cSymTab] returns [ArrayList pList = null]
+//{
+  //      pList = new ArrayList();
+   //     Expression e= null;
+//}
+//:
+ //e=expression[symTab] {pList.add(e);} e=expression[symTab] {pList.add(e);}  e=expression[symTab] {pList.add(e);} e=expression[symTab] {pList.add(e);} e=expression[symTab] { cSymTab.setAnchorObject(s.getText());} ( e=expression[cSymTab] {pList.add(e);})? e=expression[cSymTab] {pList.add(e);} 
+ 
+//;
+
+         
+        
+
+exprList[SPLSymbolTable symTab] returns [ArrayList eList = new ArrayList()]
+{
+   Expression e = null;
+}
+	:	#( ELIST (e = expression[symTab] {eList.add(e);/*//System.out.println("exprlist: created expression, added it to eList"+e);*/} )* )
+	;
+       
+ arrayIndex[SPLSymbolTable symTab] returns [Expression e = null]
+	:	#(INDEX_OP e=expression[symTab] )
+	; 
+
+
+constant returns [Expression ce = null]:  
+			  
+       		ni:NUM_INT  
+			{ 
+				try 
+				{
+					ce = ExpressionFactory.createExpression(ni.getText(),TypeConstants.intType);
+					if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+				}
+				catch (SPLException excep) 
+				{
+					ASTWithLineNumber q = (ASTWithLineNumber)ni;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+					System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());	
+				}
+			}
+        |   cl:CHAR_LITERAL  
+        	{ 
+        		try 
+        		{
+        			ce = ExpressionFactory.createExpression(cl.getText(),TypeConstants.charType);
+        			if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+        		}
+        		catch (SPLException excep) 
+        		{
+        			ASTWithLineNumber q = (ASTWithLineNumber)cl;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+        			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());
+        		}
+        	}
+        |   sl:STRING_LITERAL 
+        	{ 
+        		try 
+        		{
+        			ce = ExpressionFactory.createExpression(sl.getText(),TypeConstants.stringType);
+        			if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+        		}catch (SPLException excep) 
+        		{
+        			ASTWithLineNumber q = (ASTWithLineNumber)sl;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+        			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());
+        		}
+        	}
+        |   nf:NUM_FLOAT 
+        	{ 
+        		try 
+        		{
+        			ce = ExpressionFactory.createExpression(nf.getText(),TypeConstants.floatType);
+        			if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+        		}
+        		catch (SPLException excep) 
+        		{
+        			ASTWithLineNumber q = (ASTWithLineNumber)nf;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+        			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());
+        		}
+        	}
+        |   nl:NUM_LONG  
+        	{ 
+        		try 
+        		{
+        			ce = ExpressionFactory.createExpression(nl.getText(),TypeConstants.longType);
+        			if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+        		}
+        		catch (SPLException excep) 
+        		{
+        			ASTWithLineNumber q = (ASTWithLineNumber)nl;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+        			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());
+        		}
+        	}
+        |   nd:NUM_DOUBLE 
+        	{ 
+        		try 
+        		{
+        			ce = ExpressionFactory.createExpression(nd.getText(),TypeConstants.doubleType);
+        			if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: expression created "+ce.toString());
+   
+        		} 
+        		catch (SPLException excep) 
+        		{
+        			ASTWithLineNumber q = (ASTWithLineNumber)nd;
+					logger.severe(excep.getMessage());
+					logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+					//System.out.println(excep.getMessage());
+					//System.out.println("TreeParser::Exception inserting symbol at line "+q.getLine());
+        			System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+excep.getMessage());
+					throw new RecognitionException(excep.getMessage());
+        		}
+        	}
+;
+
+
+
+actionBlock[SPLSymbolTable symTab] returns [ActionBlock ab = null]
+{
+  ActionBlock ab1 = null;
+  ActionBlock ab2 = null;
+}
+:
+                 #(ARROW ab1 = actionBlock[symTab] ab2 = actionBlock[symTab]) 
+                {
+                 	ab = ActionFactory.createAction(ab1,ab2,ARROW,symTab); 
+                 	if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: ARROW ActionBlock created ");
+   
+                }
+                |#(LOR ab1 = actionBlock[symTab] ab2 = actionBlock[symTab]) 
+                {
+                	ab = ActionFactory.createAction(ab1,ab2,LOR,symTab); 
+                	if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: LOR ActionBlock created ");
+   
+                }
+                |#(LAND ab1 = actionBlock[symTab] ab2 = actionBlock[symTab])
+                {
+                	ab = ActionFactory.createAction(ab1,ab2,LAND,symTab); 
+                	if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: LAND ActionBlock created ");
+   
+                }
+                |#(BOR ab1 = actionBlock[symTab] ab2 = actionBlock[symTab]) 
+                {
+                	ab = ActionFactory.createAction(ab1,ab2,BOR,symTab); 
+                	if(logger.isLoggable(Level.FINE))
+  						logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: BOR ActionBlock created ");
+   
+                }
+                | ab = basicActionBlock[symTab]
+       ;
+                             
+                        
+basicActionBlock[SPLSymbolTable symTab] returns [ActionBlock ab=null] :
+{
+        ArrayList paramList = new ArrayList();
+        String ident1 = null;
+        String ident2 = "";
+        String st = "";
+        String op = ""; 
+        MethodSymbol x=null;
+        SPLSymbolTable table=symTab;
+        Expression c = null;
+       
+}
+   #( ACTIONBLOCK
+   				( 
+   					id1:IDENT {ident1 = id1.getText(); } 
+            	|     
+            		s:"Set" {st = s.getText();} 
+            	|
+            		i:"InvokePolicy" {st = i.getText();} 
+            	) 
+            	
+            	( 
+            		id2:IDENT 
+            			{
+            				ident2 = id2.getText();
+            				try
+            				{
+            					//System.out.println(" trying to get method  : "+ ident1+"."+ident2	);
+            					x = (MethodSymbol)symTab.getSymbol(ident1+"."+ident2);
+            				}
+            				catch (SPLException ex)
+            				{
+            					//System.out.println(" symTab get method Symbol failed : "+ ex.getMessage()	);
+            				}		
+            				if(x!=null)
+            				{
+            					//System.out.println(" x != null");
+            					SPLSymbolTable methodTable=x.getMethodSymbolTable(); 
+            					if(methodTable!=null)
+            					{
+            						//System.out.println("table is not null therefore table.setParentSymbolTable(symTab)");
+            						table=methodTable;
+            						table.setParentSymbolTable(symTab); 
+            					}
+            					else
+            					{
+            						//System.out.println("table is null therefore table=symTab");
+            						table=symTab;
+            					}
+            				}
+            				else
+            				{
+            					//System.out.println("x is null therefore table=symTab");
+            					table=symTab;
+            				}
+            			} 
+            	)?  
+            	
+    			#(METHOD_CALL 
+    						(
+    							paramList = exprList[table]
+    						)
+      			 ) 
+      			 
+            	(
+            		(
+            			e:EQUAL {op = e.getText();}
+            		| 
+            			ne:NOT_EQUAL {op = ne.getText();} 
+            		|
+            			ge:GE {op = ge.getText();}
+            		| 
+            			gt:GT {op = gt.getText();}
+            		| 
+            			lt:LT {op = lt.getText();}
+            		| 
+            			le:LE {op = le.getText();} 
+            		) 
+            	
+            		c=constant
+           		)?
+     )  
+{
+       //System.out.println("ident1, ident2 "+ident1+" "+ ident2);
+       try
+       {
+       	//System.out.println("creating action : "+ident1+" "+ident2+" "+st+" "+op);
+        ab = ActionFactory.createAction(ident1, ident2, paramList, st, op, c,symTab);
+        if(logger.isLoggable(Level.FINE))
+  			logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: basicActionBlock created ");
+       }
+       catch (SPLException ex)
+       {
+       	   ASTWithLineNumber q = (ASTWithLineNumber)id1;
+			logger.severe(ex.getMessage());
+			logger.severe(Thread.currentThread().getName()+" "+"TreeParser::Exception creating Expression at line "+q.getLine());
+		//System.out.println(ex.getMessage());
+		//System.out.println("TreeParser::Exception inserting action at line "+q.getLine());
+        	System.err.println("$SPLTreeParser$ Error at line no#"+q.getLine()+":"+ex.getMessage());
+			throw new RecognitionException(ex.getMessage());
+       	
+       }		 	
+   
+        
+}                 
+             
+;    
+
+policyGroup[SPLSymbolTable symTab] returns [PolicyGroup pg = null]:
+{
+   String assocName = "CIM_Component";
+   String role1="GroupComponent";
+   String role2="PartComponent";
+   SPLPolicy c = null;
+ 
+}
+#(POLICY_GRP_DEF (#(ASSOCIATION #(id1:IDENT id2:IDENT id3:IDENT {assocName = id1.getText(); role1=id2.getText(); role2=id3.getText();} ))) c=splpolicy[dataCollector,symTab] p:priority)
+{
+   
+   pg = new PolicyGroup(assocName,role1,role2,c,p.getText(),symTab);
+   if(logger.isLoggable(Level.FINE))
+  		logger.fine(Thread.currentThread().getName()+" CIMSPLTreeParser:: PolicyGroup created ");
+         
+}        
+;    
+              
+
+splType returns [String tp]
+{
+    boolean isArray = false;
+    tp="";
+    
+    
+}
+:
+	 t:basicSplTypes (LBRACK RBRACK {isArray = true;})?
+{
+    tp = t.getText();
+    //System.out.println(" cimtype = "+tp);
+    if (isArray)
+    {
+        tp=tp+"[]";
+        //System.out.println(" adding [] to cimtype = "+tp);
+    }
+    //System.out.println(" cimtype = "+tp);
+   
+}         
+        ;
+        
+basicSplTypes :
+"Sint8" | "Sint16" | "Uint8" | "Uint16" | 
+ "Sint32" | "Sint64" | "Uint32" | "Uint64" |
+    "Real32" | "Real64" | "Boolean" | "Char16"|
+     "String" | "DateTime" | "Reference" 
+;    
+
+
+

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.java?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.java (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.java Sat Dec 22 11:33:46 2007
@@ -0,0 +1,134 @@
+// $ANTLR : "cimspl.g" -> "SPLParser.java"$
+
+  	/*
+ * Copyright 2007 The Apache Software Foundation.
+ * 
+ * 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.compiler;
+  
+public interface cimsplTokenTypes {
+	int EOF = 1;
+	int NULL_TREE_LOOKAHEAD = 3;
+	int STRATEGY_DEF = 4;
+	int IMPORT_DEF = 5;
+	int DECL_DEF = 6;
+	int CONSTANT_DEFN = 7;
+	int MACRO_DEFN = 8;
+	int POLICY_DEF = 9;
+	int CONDITION_DEF = 10;
+	int POLICY_GRP_DEF = 11;
+	int DECISION_DEF = 12;
+	int TYPE = 13;
+	int ARGUMENTS = 14;
+	int ARG_DEF = 15;
+	int EXPR = 16;
+	int ELIST = 17;
+	int METHOD_CALL = 18;
+	int UNARY_MINUS = 19;
+	int QUALIFIER = 20;
+	int PARAMETERS = 21;
+	int PARAMETER_DEF = 22;
+	int UNARY_PLUS = 23;
+	int ARRAY_DECLARATOR = 24;
+	int INDEX_OP = 25;
+	int COLLECT_OP = 26;
+	int ASSOCIATION = 27;
+	int ACTIONBLOCK = 28;
+	int COLLECT_CALL = 29;
+	int UNARY_NOT = 30;
+	int BASICCOLLECTION_OP = 31;
+	int LITERAL_Import = 32;
+	int LITERAL_Class = 33;
+	int IDENT = 34;
+	int DOT = 35;
+	int SEMI = 36;
+	int LITERAL_Qualifier = 37;
+	int COLON = 38;
+	int COMMA = 39;
+	int LITERAL_Strategy = 40;
+	int LITERAL_Execute_All_Applicable = 41;
+	int LITERAL_Execute_First_Applicable = 42;
+	int LITERAL_Declaration = 43;
+	int LCURLY = 44;
+	int RCURLY = 45;
+	int ASSIGN = 46;
+	int LITERAL_Macro = 47;
+	int LITERAL_Name = 48;
+	int LITERAL_type = 49;
+	int LITERAL_procedure = 50;
+	int LITERAL_argument = 51;
+	int LITERAL_Policy = 52;
+	int LITERAL_Condition = 53;
+	int LITERAL_Decision = 54;
+	int NUM_INT = 55;
+	int LOR = 56;
+	int LAND = 57;
+	int BXOR = 58;
+	int NOT_EQUAL = 59;
+	int EQUAL = 60;
+	int LT = 61;
+	int GT = 62;
+	int LE = 63;
+	int GE = 64;
+	int PLUS = 65;
+	int MINUS = 66;
+	int STAR = 67;
+	int DIV = 68;
+	int LNOT = 69;
+	int LITERAL_true = 70;
+	int LITERAL_false = 71;
+	int LITERAL_Self = 72;
+	int LPAREN = 73;
+	int RPAREN = 74;
+	int LITERAL_collect = 75;
+	int LBRACK = 76;
+	int RBRACK = 77;
+	int CHAR_LITERAL = 78;
+	int STRING_LITERAL = 79;
+	int NUM_FLOAT = 80;
+	int NUM_LONG = 81;
+	int NUM_DOUBLE = 82;
+	int ARROW = 83;
+	int BOR = 84;
+	int LITERAL_Set = 85;
+	int LITERAL_InvokePolicy = 86;
+	int LITERAL_PolicyGroup = 87;
+	// "Sint8" = 88
+	// "Sint16" = 89
+	// "Uint8" = 90
+	// "Uint16" = 91
+	// "Sint32" = 92
+	// "Sint64" = 93
+	// "Uint32" = 94
+	// "Uint64" = 95
+	// "Real32" = 96
+	// "Real64" = 97
+	int LITERAL_Boolean = 98;
+	// "Char16" = 99
+	int LITERAL_String = 100;
+	int LITERAL_DateTime = 101;
+	int LITERAL_Reference = 102;
+	int WS = 103;
+	int SL_COMMENT = 104;
+	int ML_COMMENT = 105;
+	int ESC = 106;
+	int HEX_DIGIT = 107;
+	int EXPONENT = 108;
+	int FLOAT_SUFFIX = 109;
+}

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.txt
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.txt?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.txt (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/cimsplTokenTypes.txt Sat Dec 22 11:33:46 2007
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+// $ANTLR : cimspl.g -> cimsplTokenTypes.txt$
+cimspl    // output token vocab name
+STRATEGY_DEF=4
+IMPORT_DEF=5
+DECL_DEF=6
+CONSTANT_DEFN=7
+MACRO_DEFN=8
+POLICY_DEF=9
+CONDITION_DEF=10
+POLICY_GRP_DEF=11
+DECISION_DEF=12
+TYPE=13
+ARGUMENTS=14
+ARG_DEF=15
+EXPR=16
+ELIST=17
+METHOD_CALL=18
+UNARY_MINUS=19
+QUALIFIER=20
+PARAMETERS=21
+PARAMETER_DEF=22
+UNARY_PLUS=23
+ARRAY_DECLARATOR=24
+INDEX_OP=25
+COLLECT_OP=26
+ASSOCIATION=27
+ACTIONBLOCK=28
+COLLECT_CALL=29
+UNARY_NOT=30
+BASICCOLLECTION_OP=31
+LITERAL_Import="Import"=32
+LITERAL_Class="Class"=33
+IDENT=34
+DOT=35
+SEMI=36
+LITERAL_Qualifier="Qualifier"=37
+COLON=38
+COMMA=39
+LITERAL_Strategy="Strategy"=40
+LITERAL_Execute_All_Applicable="Execute_All_Applicable"=41
+LITERAL_Execute_First_Applicable="Execute_First_Applicable"=42
+LITERAL_Declaration="Declaration"=43
+LCURLY=44
+RCURLY=45
+ASSIGN=46
+LITERAL_Macro="Macro"=47
+LITERAL_Name="Name"=48
+LITERAL_type="type"=49
+LITERAL_procedure="procedure"=50
+LITERAL_argument="argument"=51
+LITERAL_Policy="Policy"=52
+LITERAL_Condition="Condition"=53
+LITERAL_Decision="Decision"=54
+NUM_INT=55
+LOR=56
+LAND=57
+BXOR=58
+NOT_EQUAL=59
+EQUAL=60
+LT=61
+GT=62
+LE=63
+GE=64
+PLUS=65
+MINUS=66
+STAR=67
+DIV=68
+LNOT=69
+LITERAL_true="true"=70
+LITERAL_false="false"=71
+LITERAL_Self="Self"=72
+LPAREN=73
+RPAREN=74
+LITERAL_collect="collect"=75
+LBRACK=76
+RBRACK=77
+CHAR_LITERAL=78
+STRING_LITERAL=79
+NUM_FLOAT=80
+NUM_LONG=81
+NUM_DOUBLE=82
+ARROW=83
+BOR=84
+LITERAL_Set="Set"=85
+LITERAL_InvokePolicy="InvokePolicy"=86
+LITERAL_PolicyGroup="PolicyGroup"=87
+"Sint8"=88
+"Sint16"=89
+"Uint8"=90
+"Uint16"=91
+"Sint32"=92
+"Sint64"=93
+"Uint32"=94
+"Uint64"=95
+"Real32"=96
+"Real64"=97
+LITERAL_Boolean="Boolean"=98
+"Char16"=99
+LITERAL_String="String"=100
+LITERAL_DateTime="DateTime"=101
+LITERAL_Reference="Reference"=102
+WS=103
+SL_COMMENT=104
+ML_COMMENT=105
+ESC=106
+HEX_DIGIT=107
+EXPONENT=108
+FLOAT_SUFFIX=109

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java Sat Dec 22 11:33:46 2007
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.InstanceInfo;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class AnchorData 
+{
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="AnchorData";
+    
+	private Map _classNameToQualifierMap;
+	private Map _classNameToInstanceInfoListMap;
+	
+	public AnchorData()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "AnchorData");
+		_classNameToQualifierMap = new Hashtable();
+		_classNameToInstanceInfoListMap = new Hashtable();
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "AnchorData");
+		
+	}
+	
+	public List getAnchorClassList()
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAnchorClassList");
+		List anchorClassList = new ArrayList();
+		Iterator anchorKeySetIt = _classNameToInstanceInfoListMap.keySet().iterator();
+		while(anchorKeySetIt.hasNext())
+		{
+			String className = (String)anchorKeySetIt.next();
+			anchorClassList.add(className);
+		}
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getAnchorClassList");
+		return anchorClassList;
+		
+	}
+	
+	public Object getInstance(String instanceName) 
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getInstance");
+		Object instance = null;
+		Iterator anchorKeySetIt = _classNameToInstanceInfoListMap.keySet().iterator();
+		while(anchorKeySetIt.hasNext())
+		{	
+			String className = (String)anchorKeySetIt.next();
+			List instanceInfoList = (List)_classNameToInstanceInfoListMap.get(className);
+			Iterator instanceInfoListIt = instanceInfoList.iterator();
+			while(instanceInfoListIt.hasNext())
+			{
+				InstanceInfo ii = (InstanceInfo)instanceInfoListIt.next();
+				if(ii.getInstanceName().equals(instanceName))
+				{
+					instance = ii.getInstance();
+					return instance;
+					
+				}
+			}
+		}	
+		
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getInstance");
+		return instance;
+		
+		
+	}
+	
+	public void insertInstanceObject(String className, 
+			String instanceName, 
+			Object instance) throws SPLException 
+	{
+		
+		List instanceInfoList = (List)_classNameToInstanceInfoListMap.get(className);
+		
+
+		boolean instanceFound = false;
+		
+		Iterator instanceInfoListIt = instanceInfoList.iterator();
+		while(instanceInfoListIt.hasNext())
+		{
+			InstanceInfo instanceInfo = (InstanceInfo) instanceInfoListIt.next();
+			//System.out.println(" instanceInfo.getInstanceName() "+instanceInfo.getInstanceName());
+			//System.out.println(" instanceName "+instanceName);
+			
+			if(instanceInfo.getInstanceName() != null)
+			{	
+				if(instanceInfo.getInstanceName().equalsIgnoreCase(instanceName))
+				{
+					//System.out.println(" instanceInfo.getInstanceName() "+instanceInfo.getInstanceName());
+					instanceInfo.setInstance(instance);
+					instanceFound = true;
+					break;
+				}
+			}
+			else 
+			{
+				
+				
+//				break;
+			}
+		
+			
+		}
+		if(!instanceFound)
+		{
+			throw new SPLException("Invalid instance Name " + instanceName);
+		}
+		
+		
+	}
+	
+	public String getQualifierForClass(String className)
+	{
+		String qualifier = (String)_classNameToQualifierMap.get(className);
+		return qualifier;
+	}
+	
+	public List getInstanceInfoList(String className)
+	{
+		List instanceInfoList = (List)_classNameToInstanceInfoListMap.get(className);
+		return instanceInfoList;
+		
+	}
+	
+	public void addInstanceInfoListForClass(String className, List instanceInfoList)
+	{
+		//System.out.println("className "+className);
+		//System.out.println("instanceInfoList "+instanceInfoList);
+		_classNameToInstanceInfoListMap.put(className, instanceInfoList);
+		
+	}
+	
+	public void addQualifierForClass(String className, String qualifier)
+	{
+		if(qualifier != null)
+		{	
+			_classNameToQualifierMap.put(className, qualifier);
+		}	
+		
+	}
+	
+
+}

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java Sat Dec 22 11:33:46 2007
@@ -0,0 +1,193 @@
+/*
+ * 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.compiler.symboltable;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.statements.impl.MacroDefinition;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class MacroSymbol implements Symbol 
+{
+	private String _macroName;
+	private TypeInfo _returnType = new TypeInfo();
+	private List _argTypeList;
+	private MacroDefinition _macroDefn;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+	private static final String sourceClass="MacroSymbol";
+    private boolean _isArray=false;
+	
+	public MacroSymbol(String macroName, TypeInfo retType, List argTypes, MacroDefinition md) 
+		throws SPLException
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
+		
+		this._macroName = macroName;
+		this._returnType.copy(retType);
+		_returnType.setReferenceTypeName(md.getReferenceTypeName());
+		this._argTypeList = argTypes;
+		this._macroDefn = md;
+        if(md.isArray())
+        {
+            this._isArray=true;
+        }
+       //System.out.println("new MacroSymbol : "+macroName+" "+retType+" "+argTypes);
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
+		
+		
+	}
+	
+	public TypeInfo getType() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+		
+		// TODO Auto-generated method stub
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+		
+		return _returnType;
+	}
+
+	public Object getValue() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
+		
+		// TODO Auto-generated method stub
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
+		
+		return null;
+	}
+
+	public List getArgTypeList() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
+		
+		
+		return _argTypeList;
+	}
+
+	public void setArgTypeList(List argTypeList) {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
+		
+		_argTypeList = argTypeList;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
+		
+		
+	}
+
+	public MacroDefinition getMacroDefn() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
+		
+		
+		return _macroDefn;
+	}
+
+	public void setMacroDefn(MacroDefinition macroDefn) {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
+		
+		
+		_macroDefn = macroDefn;
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
+		
+	}
+
+	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");
+		_macroName = macroName;
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
+		
+	}
+
+	
+	public void setReturnType(TypeInfo returnType) {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
+		
+		_returnType.copy(returnType);
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
+		
+	}
+
+	public boolean isArray() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+		
+		
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+		
+		return _returnType.getIsArray();
+	}
+
+	public boolean isKey() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
+		
+		// TODO Auto-generated method stub
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
+		
+		return false;
+	}
+
+	public boolean isClassSymbol() {
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
+		
+		// TODO Auto-generated method stub
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
+		
+		return false;
+	}
+
+     public boolean isArray(boolean isArray)
+        {
+            return _returnType.getIsArray();
+        }
+     
+    public void setArray(boolean isArray)
+    {
+        _returnType.setIsArray(isArray);
+    }
+
+	public String getReferenceTypeName() 
+	{
+		//String referenceTypeName;
+		/*try 
+		{
+			referenceTypeName = _macroDefn.getReferenceTypeName();
+		} catch (SPLException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			referenceTypeName = "";
+		}*/
+		//return referenceTypeName;
+		return _returnType.getReferenceTypeName();
+	}
+
+}

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java Sat Dec 22 11:33:46 2007
@@ -0,0 +1,165 @@
+/*
+ * 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.compiler.symboltable;
+
+import java.util.List;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+
+public class MethodSymbol implements Symbol 
+{
+	private String _methodName;
+	private TypeInfo _returnType = new TypeInfo();
+	private List _argList;
+	private SPLSymbolTable _methodSymbolTable=null;
+	
+	public MethodSymbol(String nName, 
+			int retType, 
+			boolean isReturnArray, 
+			String returnReferenceType, 
+			List argList,
+			SPLSymbolTable metSym) throws SPLException
+	{
+		
+		
+		_methodName = nName;
+		_returnType.setIsArray(isReturnArray);
+		_returnType.setReferenceTypeName(returnReferenceType);
+		_returnType.setType(retType);
+		//_returnType = new TypeInfo(retType,returnReferenceType,isReturnArray);
+		_argList=argList;
+		_methodSymbolTable = metSym;
+		
+	}
+	
+	public MethodSymbol(String nName, 
+			TypeInfo retType, 
+			List argTypeList,
+			SPLSymbolTable argSymbols)
+	{
+		
+		
+		_methodName = nName;
+		_returnType.copy(retType);
+		_argList=argTypeList;
+		_methodSymbolTable=argSymbols;
+		
+	}
+	
+	public String getMethodName() 
+	{
+		
+		return _methodName;
+	}
+
+
+	public void setMethodName(String methodName) 
+	{
+			
+		_methodName = methodName;
+	
+		
+	}
+
+
+	public TypeInfo getType() 
+	{
+			
+		return _returnType;
+	}
+
+	public Object getValue() 
+	{
+	
+		return null;
+	}
+
+
+	public boolean isArray() 
+	{
+	
+		return false;
+	}
+
+
+	public boolean isKey() 
+	{
+	
+		return false;
+	}
+
+
+	public boolean isClassSymbol() 
+	{
+	
+		return true;
+	}
+
+
+	public List getArgumentList() 
+	{
+	
+		
+		return _argList;
+	}
+
+
+	public void setArgumentList(List argList) 
+	{
+	
+		
+		_argList = argList;
+	
+		
+	}
+
+
+	public String getReferenceTypeName() 
+	{
+			return _returnType.getReferenceTypeName();
+	}
+
+	public boolean isReturnArray() 
+	{
+		return _returnType.getIsArray();
+	}
+
+	
+
+	public TypeInfo getReturnType() {
+		return _returnType;
+	}
+
+	public SPLSymbolTable getMethodSymbolTable() {
+		return _methodSymbolTable;
+	}
+
+	public void getMethodSymbolTable(SPLSymbolTable symbolTable) {
+		_methodSymbolTable = symbolTable;
+	}
+
+}

Added: incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java?rev=606479&view=auto
==============================================================================
--- incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java (added)
+++ incubator/imperius/trunk/trunk/modules/imperius-splcore/src/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java Sat Dec 22 11:33:46 2007
@@ -0,0 +1,123 @@
+/*
+ * 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.compiler.symboltable;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+
+
+public class PropertySymbol implements Symbol 
+{
+	
+	private TypeInfo _dataType = new TypeInfo();
+	private String _name;
+	private Object _value;
+	//private boolean _isArray;
+	private boolean _isKey;
+	//private String _referenceTypeName;
+	private boolean _isPropertyOfClass;
+	
+	public PropertySymbol(String n, 
+			int type, 
+			String referenceType, 
+			boolean isArray, 
+			boolean isKey, 
+			boolean isProp) throws SPLException
+	{
+		_dataType = new TypeInfo(type,referenceType,isArray);
+		_name = n;
+		_isKey = isKey;
+		_isPropertyOfClass = isProp;
+	}
+	
+	public PropertySymbol(
+			String n, 
+			TypeInfo tp ,
+			boolean isKey, 
+			boolean isProp)
+	{
+		
+		this._name = n;
+		this._dataType.copy(tp);
+		
+		this._isKey = isKey;
+		this._isPropertyOfClass = isProp;
+		
+		
+	}
+
+	public TypeInfo getType() 
+	{
+		
+		return _dataType;
+	}
+	
+	public Object getValue() 
+	{
+		
+		return _value;
+	}
+	
+	public void setValue(Object o) 
+	{
+		
+		_value = o;
+	}
+
+
+	public String getName() 
+	{
+			
+		return _name;
+	}
+
+
+	public boolean isArray() 
+	{
+		
+		return _dataType.getIsArray();
+	}
+
+
+	public boolean isKey() 
+	{
+			
+		return _isKey;
+	}
+
+	public boolean isClassSymbol() 
+	{
+	
+		return _isPropertyOfClass;
+	}
+
+	public String getReferenceTypeName() 
+	{
+		
+		return _dataType.getReferenceTypeName();
+	}
+
+}



Mime
View raw message