Package uk.co.badgersinfoil.metaas

Examples of uk.co.badgersinfoil.metaas.SyntaxException


  }

  protected StatementContainer getStatementContainer() {
    LinkedListTree body = body();
    if (body.getType() != AS3Parser.BLOCK) {
      throw new SyntaxException("'with' body is not a block");
    }
    return new ASTStatementList(body);
  }
View Full Code Here


  }

  public ASFinallyClause newFinallyClause() {
    LinkedListTree finallyClause = finallyClause();
    if (finallyClause != null) {
      throw new SyntaxException("only one finally-clause allowed");
    }
    finallyClause = ASTBuilder.newFinallyClause();
    ast.addChildWithTokens(finallyClause);
    return new ASTASFinallyClause(finallyClause);
  }
View Full Code Here

    return findDecl().getText();
  }

  public void setName(String name) {
    if (name.indexOf('.') != -1) {
      throw new SyntaxException("field name must not contain '.'");
    }
    findDecl().getToken().setText(name);
  }
View Full Code Here

      case AS3Parser.CONTINUE:
        return new ASTASContinueStatement(ast);
      case AS3Parser.THROW:
        return new ASTASThrowStatement(ast);
      default:
        throw new SyntaxException("Unsupported statement node type: "+ASTUtils.tokenName(ast)+" in "+ActionScriptFactory.str(ASTUtils.stringifyNode(ast)));
    }
  }
View Full Code Here

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

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

    return ASTUtils.typeSpecText(type);
  }

  public void setType(String typeName) {
    if (isRest()) {
      throw new SyntaxException("type specification not allowed for 'rest' parameters");
    }
    LinkedListTree type = ASTUtils.findChildByType(ast, AS3Parser.TYPE_SPEC);
    if (typeName == null) {
      if (type != null) {
        ast.deleteChild(1);
View Full Code Here

    return getName() + ":" + type;
  }

  public void setDefault(String value) {
    if (isRest()) {
      throw new SyntaxException("default value not allowed for 'rest' parameters");
    }
    ASTIterator i = new ASTIterator(ast);
    LinkedListTree assign = i.search(AS3Parser.ASSIGN);
    if (value == null) {
      if (assign != null) {
View Full Code Here

    return (LinkedListTree)ast.getChild(index);
  }
  protected StatementContainer getStatementContainer() {
    LinkedListTree stmt = stmt();
    if (stmt.getType() != AS3Parser.BLOCK) {
      throw new SyntaxException("Loop body is not a block");
    }
    return new ASTStatementList(stmt);
  }
View Full Code Here

    return name.getText();
  }

  public void setName(String name) {
    if (name.indexOf('.') != -1) {
      throw new SyntaxException("Method name must not contain '.'");
    }
    if (name.indexOf(':') != -1) {
      throw new SyntaxException("Method name must not contain ':'");
    }
    ASTIterator i = new ASTIterator(ast);
    i.find(AS3Parser.IDENT);
    LinkedListTree newName = AS3FragmentParser.parseIdent(name).getFirstChild();
    i.replace(newName);
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.