Package uk.co.badgersinfoil.metaas

Examples of uk.co.badgersinfoil.metaas.SyntaxException


  public static LinkedListTree parseExprList(String expr) {
    AS3Parser parser = ASTUtils.parse(expr + ")");
    try {
      return tree(parser.expressionList());
    } catch (RecognitionException e) {
      throw new SyntaxException("invalid expression-list "+ActionScriptFactory.str(expr), e);
    }
  }
View Full Code Here


    try {
      LinkedListTree result = tree(parser.identifier());
      parser.endOfFile();
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException("invalid identifier "+ActionScriptFactory.str(value), e);
    }
  }
View Full Code Here

    AS3Parser parser = ASTUtils.parse("="+value);
    LinkedListTree def;
    try {
      def = tree(parser.parameterDefault());
    } catch (RecognitionException e) {
      throw new SyntaxException(e.getMessage());
    }
    return def;
  }
View Full Code Here

    try {
      LinkedListTree result = tree(parser.forInit());
      ensureRemainingInputIs(parser.getTokenStream(), AS3Parser.SEMI, expr);
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

    try {
      LinkedListTree result = tree(parser.forCond());
      ensureRemainingInputIs(parser.getTokenStream(), AS3Parser.SEMI, expr);
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

    try {
      LinkedListTree result = tree(parser.forIter());
      ensureRemainingInputIs(parser.getTokenStream(), AS3Parser.RPAREN, expr);
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

    try {
      LinkedListTree result = tree(parser.importDefinition());
      parser.endOfFile()// assert no trailing data
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

    try {
      LinkedListTree result = tree(parser.typeExpression());
      ensureNoMoreInput(parser.getTokenStream(), value);
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException("invalid type-spec "+ActionScriptFactory.str(value), e);
    }
  }
View Full Code Here

    }
  }

  private static void ensureNoMoreInput(TokenStream input, String value) {
    if (input.LA(1) != AS3Parser.EOF) {
      throw new SyntaxException("Unexpected tokens in input: "+value);
    }
  }
View Full Code Here

    }
  }

  private static void ensureRemainingInputIs(TokenStream input, int expectedTokenType, String value) {
    if (input.LA(1) != expectedTokenType) {
      throw new SyntaxException("Unexpected tokens in input: "+value);
    }
  }
View Full Code Here

TOP

Related Classes of uk.co.badgersinfoil.metaas.SyntaxException

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.