Package anvil.script.statements

Examples of anvil.script.statements.Statement


  }


  public void endDocument()
  {
    Statement stmt = _current;
    while(stmt != null && stmt != this) {
      error(stmt.getLocation(), "Unexpected end of file, " + stmt.name() + " open");
      stmt = stmt.getParentStatement();
    }
  }
View Full Code Here


  }


  public void handleCharacters(String characters)
  {
    Statement statement = peek();
    if (statement != null) {
      statement.onCharacters(this, characters);
    }
  }
View Full Code Here

  {
    if (characters.startsWith("--/**") && characters.endsWith("*/--")) {
      _document = characters.substring(5, characters.length() - 4);
    } else {
      _document = null;
      Statement statement = peek();
      if (statement != null) {
        statement.onCharacters(this, "<!"+characters+'>');
      }
    }
  }
View Full Code Here

        type = ST_TAG;
      }
     
    }
   
    Statement statement = peek();
    if (statement != null) {
      if (!statement.onTag(this, type, tag)) {
        error(getLocation(), "Unexpected element: "+tag);
      }
    }
   
    _document = null;
View Full Code Here

  }
 

  public void handleProcessingInstruction(String data)
  {
    Statement statement = peek();
    if (statement != null) {
      if (!statement.onProcessingInstruction(this, data)) {
        error(getLocation(), "Unexpected processing instruction: "+data);
      }
    }
    _document = null;
  }
View Full Code Here

 
 
  public static final int countEscapeDepth(FunctionStatement context, Statement target)
  {
    int depth = 0;
    Statement target_parent = target.getFunctionStatement().getContext();
    while(context != null) {
      if (context == target) {
        break;
      }
      if (context == target_parent) {
View Full Code Here

    }


    public Statement flowPop()
    {
      Statement stmt = _current;
      if (stmt != null) {
        _current = stmt.getParentStatement();
      }
      //System.out.println("||pop:"+stmt+" --> "+_current);
      return stmt;
    }
View Full Code Here

    }


    protected TryStatement getEnclosingTryBlock()
    {
      Statement stmt = flowPeek();
      switch(stmt.typeOf()) {
      case Statement.ST_BLOCK:
      case Statement.ST_IMPLICIT_BLOCK:
        {
          TryStatement trystmt;
          BlockStatement block = (BlockStatement)stmt;
          stmt = block.getTail();
          if (stmt != null && stmt.typeOf() == Statement.ST_TRY) {
            trystmt = (TryStatement)stmt;
            if (trystmt.hasFinally()) {
              trystmt = block.replaceWithTry();
            }
          } else {
            trystmt = block.replaceWithTry();
          }
          return trystmt;
        }

      default:
        {
          TryStatement trystmt = new TryStatement(stmt, stmt.getLocation());
          stmt.setChildStatement(trystmt);
          return trystmt;
        }
      }
    }
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public void Namespace() throws ParseException {
  Token t;
  Statement stmt = flowPeek();
  DefinitionStatement scope = stmt.getScopeStatement();
    try {
      t = jj_consume_token(NAMESPACE);
        Location location = toLocation(t);
      scope = NamespacePart(location, scope);
      label_3:
View Full Code Here

    default:
      jj_la1[33] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
      Statement stmt = flowPeek();
      DefinitionStatement parent = stmt.getScopeStatement();
      FunctionStatement context  = stmt.getFunctionStatement();
      FunctionStatement function;
      String name = "inline$" + parent.getNextInlined();
      if (parent.typeOf() == Statement.ST_CLASS) {
        function = new MethodStatement(toLocation(t), parent, context, false, name, null, parameters);
      } else {
View Full Code Here

TOP

Related Classes of anvil.script.statements.Statement

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.