Package uk.co.badgersinfoil.metaas

Examples of uk.co.badgersinfoil.metaas.SyntaxException


        case AS3Parser.GET:
      return AccessorRole.GETTER;
        case AS3Parser.SET:
      return AccessorRole.SETTER;
        default:
      throw new SyntaxException("expected GET or SET; got "+roleNode);
    }
  }
View Full Code Here


    }
  }

  private ASTStatementList stmtList() {
    if (stmtList == null) {
      throw new SyntaxException("Interface methods don't have a body");
    }
    return stmtList;
  }
View Full Code Here

    return new ASTASMethod(def);
  }

  public static ASTASField newField(String name, Visibility visibility, String type) {
    if (name.indexOf('.') != -1) {
      throw new SyntaxException("field name must not contain '.'");
    }
    LinkedListTree decl = ASTUtils.newImaginaryAST(AS3Parser.VAR_DEF);
    LinkedListTree annos = ASTUtils.newPlaceholderAST(AS3Parser.ANNOTATIONS);
    decl.addChildWithTokens(annos);
    decl.addChildWithTokens(ModifierUtils.toModifiers(visibility));
View Full Code Here

  }

  public static void assertNoParent(String astDescription, LinkedListTree ast)
  {
    if (ast.getParent() != null) {
      throw new SyntaxException(astDescription+" cannot be added to a second parent node");
    }
  }
View Full Code Here

  }

  public static void assertValidContent(String text) {
    int pos = text.indexOf("*/");
    if (pos != -1) {
      throw new SyntaxException("End-on-comment marker found at position "+pos);
    }
  }
View Full Code Here

    try {
      JavadocParser parser = parserOn(description);
      LinkedListTree desc = (LinkedListTree)parser.description().getTree();
      LinkedListToken after = (LinkedListToken)parser.getTokenStream().LT(1);
      if (!isEOF(after)) {
        throw new SyntaxException("trailing content after description: "+ActionScriptFactory.str(after.getText()));
      }
      trimEOF(desc);
      return desc;
    } catch (IOException e) {
      throw new SyntaxException(e);
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

      JavadocParser parser = parserOn(body);
      LinkedListTree result = (LinkedListTree)parser.comment_body().getTree();
      trimEOF(result);
      return result;
    } catch (IOException e) {
      throw new SyntaxException(e);
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

      JavadocParser parser = parserOn(text);
      LinkedListTree result = (LinkedListTree)parser.paragraph_tag().getTree();
      trimEOF(result);
      return result;
    } catch (IOException e) {
      throw new SyntaxException(e);
    } catch (MismatchedTokenException e) {
      throw new SyntaxException("Expexted "+JavadocParser.tokenNames[e.expecting]+" but found "+JavadocParser.tokenNames[e.getUnexpectedType()], e);
    } catch (RecognitionException e) {
      throw new SyntaxException(e);
    }
  }
View Full Code Here

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

      ensureRemainingInputIs(parser.getTokenStream(), AS3Parser.RPAREN, expr);
      // zap the trailing ')'
      result.getStopToken().setNext(null);
      return result;
    } catch (RecognitionException e) {
      throw new SyntaxException("invalid expression "+ActionScriptFactory.str(expr), e);
    }
  }
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.