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

Examples of org.apache.imperius.spl.parser.compiler.SPLParser


      // Create a scanner that reads from the input stream passed to us
      SPLLexer lexer = new SPLLexer(r);
      lexer.setFilename(f);

      // Create a parser that reads from the scanner
      SPLParser parser = new SPLParser(lexer);
      parser.setASTNodeClass("org.apache.imperius.spl.parser.compiler.ASTWithLineNumber");
      parser.setFilename(f);
     
      logger.fine(Thread.currentThread().getName() + " parsing file started...");

      // start parsing at the compilationUnit rule
      parser.splpolicy();
     
      if(parser.getErrorList() != null && parser.getErrorList().size() > 0)
      {
        throw new SPLException(Messages
            .getString("SPL_POLICY_PARSING_EXCEPTION_MSG"));
      }
     
      logger.fine(Thread.currentThread().getName() + " parsing file completed here...");
     
      AST t = parser.getAST();
     
      if (t != null)
      {
        traverseTree(t);
      }
      else
      {
        logger.log(Level.SEVERE, Messages.SPLOF0007E);
      }

      // do something with the tree
      SPLPolicy pol = doTreeAction(f, parser.getAST(), parser.getTokenNames());
     
      logger.exiting(sourceClass, Thread.currentThread().getName() + " "
          + "parseFile");
     
      return pol;
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.compiler.SPLParser

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.