Package org.destecs.core.parsers.contract

Examples of org.destecs.core.parsers.contract.ContractParser


      throws IOException
  {
    super.lexer = new ContractLexer(data);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
   
    ContractParser thisParser = new ContractParser(tokens);
    parser = thisParser;

    ((ContractLexer)lexer).enableErrorMessageCollection(true);
    thisParser.enableErrorMessageCollection(true);
    try
    {
      thisParser.contract();

      if (((ContractLexer)lexer).hasExceptions())
      {
        List<RecognitionException> exps = ((ContractLexer)lexer).getExceptions();
        addErrorsLexer(source, exps);
        return null;
      }

      if (thisParser.hasExceptions())
      {

        List<RecognitionException> exps = thisParser.getExceptions();
        addErrorsParser(source, exps);
      } else
      {
        return thisParser.getContract();
      }
    } catch (RecognitionException errEx)
    {
      errEx.printStackTrace();
      addError(new ParseError(source, errEx.line, errEx.charPositionInLine, getErrorMessage(errEx, parser.getTokenNames())));
View Full Code Here

TOP

Related Classes of org.destecs.core.parsers.contract.ContractParser

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.