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 [3/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/antlr/org/apache/imperius/spl/parser/compiler/cimspl.tree.g
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/cimspl.tree.g?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/cimspl.tree.g (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/cimspl.tree.g Fri Jan 11 10:56:30 2008
@@ -1,1455 +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(className.toString(),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" 
-;    
-
-
-
+/*
+ * 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(className.toString(),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());

[... 674 lines stripped ...]


Mime
View raw message