Package org.apache.imperius.spl.parser.compiler.symboltable

Examples of org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable


   
   
    //SensorLookup lookup = new SensorLookupImpl(map);

    try {
      SPLSymbolTable t =new SPLSymbolTable();
      Vector v = new Vector();
      v.add(propertySensor1);
      v.add(propertySensor2);
      v.add(propertySensor3);
      v.add(propertySensor4);
View Full Code Here


            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" method : "+cimMethod.getName()+ " Parameter count "+cimMethod.getParameterCount()+" is of type "+cimMethod.getType());
//            //ArrayList argTypeList=new ArrayList ();
            List methodArgs=new ArrayList();
            SPLSymbolTable methodArgsSymbolTable=new SPLSymbolTable();

            for(int j=0;j<cimMethod.getParameterCount();j++)
            {
              CIMParameter cimparameter=cimMethod.getParameter(j);
              String parameterName=cimparameter.getName();
              boolean isArr=cimparameter.isArray();
              int type=CIMSPLTypeConstants.convertCIMTypeToInternalType(cimparameter.getType().getType());

              String referenceTypeName="";

              if(type == TypeConstants.referenceType)
              { 
                referenceTypeName = CIMSPLTypeConstants.getReferenceTypeName(cimparameter.getReferenceClassName());
              }
              Argument arg=new ArgumentImpl(type, parameterName, isArr, referenceTypeName);

              methodArgsSymbolTable.insertVariableSymbol(parameterName, type, referenceTypeName, isArr, false, false);
              //System.out.println(" inserted variable symbol into methodArgsSymbolTable "+parameterName);
              methodArgs.add(arg);
            }
            String methodName=cimMethod.getName();
            if( ! symbols.containsKey(methodName))
View Full Code Here

      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" method : "+cimMethod.getName()+
            " Parameter count "+cimMethod.getParameters()+" is of type "+cimMethod.getType());
//      //ArrayList argTypeList=new ArrayList ();
      List methodArgs=new ArrayList();
      SPLSymbolTable methodArgsSymbolTable=new SPLSymbolTable();
     
            Vector parameters = cimMethod.getParameters();
      for(int j=0; j<parameters.size(); j++)
      {
        CIMParameter cimparameter = (CIMParameter)parameters.get(j);
        String parameterName=cimparameter.getName();
        //boolean isArr=cimparameter.isArray();
        int type=CIMSPLTypeConstants.convertCIMTypeToInternalType(cimparameter.getType().getType());
        boolean isArray = CIMSPLTypeConstants.getIsArray(cimparameter.getType().getType());
        String referenceTypeName="";
       
        if(type == TypeConstants.referenceType)
        { 
          referenceTypeName = CIMSPLTypeConstants.getReferenceTypeName(cimparameter.getName());
        }
        Argument arg=new ArgumentImpl(type, parameterName, isArray, referenceTypeName);
       
        methodArgsSymbolTable.insertVariableSymbol(parameterName, type, referenceTypeName, isArray, false, false);
        //System.out.println(" inserted variable symbol into methodArgsSymbolTable "+parameterName);
        methodArgs.add(arg);
      }
      String methodName=cimMethod.getName();
      if( ! symbols.containsKey(methodName))
View Full Code Here

    SPLTreeParser tparse = new SPLTreeParser();
    tparse.setASTNodeClass("org.apache.imperius.spl.parser.compiler.ASTWithLineNumber");
    try
    {
      DataCollector dc = DataCollectorFactory.getDataCollector();
      SPLSymbolTable st = new SPLSymbolTable();
      SPLPolicy cp = tparse.splpolicy(t, dc, st);
      if(tparse.getErrorList() != null && tparse.getErrorList().size() > 0)
      {
        throw new SPLException(Messages.getString("SPL_POLICY_TREE_PARSING_EXCEPTION_MSG"));
      }
View Full Code Here

      ImportStatement importStmt=(ImportStatement)it.next();
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" 2Creating SPL Policy instance :"+importStmt);

      SPLSymbolTable symtab=importStmt.getSymTab();
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" 3Creating SPL Policy instance :"+symtab);

      AnchorData anchor=symtab.getAnchorData();
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" 4Creating SPL Policy instance :"+anchor);

      List classes=anchor.getAnchorClassList();
      if(logger.isLoggable(Level.FINE))
View Full Code Here

    public Object evaluate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");

        // TODO Auto-generated method stub
        SPLSymbolTable macroSymbolTable = _macroDefn.getMacroSymTab();
       
        populateMacroSymbolTable(macroSymbolTable, _passedParams);
        Object result = _macroDefn.evaluate();
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
       
View Full Code Here

    {
       logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
         //System.out.println("evaluating Self expression");
       String referenceTypeName = null;
        
          SPLSymbolTable symbtab=sTab;
          while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
            symbtab=sTab.getParentSymbolTable();
          }
         
         
          if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
          { 
              SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
              List anchorClassList = parentSymTab.getAnchorClassList();
              Iterator anchorClassListIt = anchorClassList.iterator();
            
               referenceTypeName = (String)anchorClassListIt.next();
            
            
View Full Code Here

    {
        logger.entering(sourceClass, Thread.currentThread().getName() + " "
        + "evaluate");

    Object ins = null;
    SPLSymbolTable symbtab = sTab;
    while (sTab.getParentSymbolTable() != null
        && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT)
    {
      symbtab = sTab.getParentSymbolTable();
    }

    if (symbtab.getParentSymbolTable() != null
        && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT)
    {
      SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
      String referenceTypeName = null;
      List anchorClassList = parentSymTab.getAnchorClassList();
      Iterator anchorClassListIt = anchorClassList.iterator();

      referenceTypeName = (String) anchorClassListIt.next();

      ins = parentSymTab.getInstance(referenceTypeName);
    }
    else
    {
      throw new SPLException(Messages.getString("SPL_SELF_EXPRESSION_EXCEPTION_MSG"));
    }
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.