Package railo.transformer.bytecode

Examples of railo.transformer.bytecode.Body


    //  return null;
   
   
   
    Expression left=null;
    Body body=new BodyBase();
    Position line = data.cfml.getPosition();
    comments(data);
    if(!data.cfml.isCurrent(';')) {
      // left
      left=expression(data);
View Full Code Here


      return closurePart(data, id,access,rtnType,line,false);
  }

  protected  final Function closurePart(ExprData data, String id, int access, String rtnType, Position line,boolean closure) throws TemplateException {   
   
    Body body=new FunctionBody();
    Function func=closure?
        new Closure(data.page,id,access,rtnType,body,line,null)
        :new FunctionImpl(data.page,id,access,rtnType,body,line,null);
   
      comments(data);
View Full Code Here

   
    comments(data);
 
    // body
    if(tlt.getHasBody()){
      Body body=new BodyBase();
      boolean wasSemiColon=statement(data,body,script.getContext());
      if(!wasSemiColon || !tlt.isBodyFree() || body.hasStatements())
        tag.setBody(body);
     
     
     
    }
View Full Code Here

  private final TryCatchFinally tryStatement(ExprData data) throws TemplateException {
    if(!data.cfml.forwardIfCurrent("try",'{') && !data.cfml.forwardIfCurrent("try ") && !data.cfml.forwardIfCurrent("try",'/'))
      return null;
    data.cfml.previous();

    Body body=new BodyBase();
    TryCatchFinally tryCatchFinally=new TryCatchFinally(body,data.cfml.getPosition(),null);
   
    statement(data,body,CTX_TRY);
    comments(data);
   
    // catches
    short catchCount=0;
    while(data.cfml.forwardIfCurrent("catch",'(')) {
      catchCount++;
      comments(data);
     
      // type
      int pos=data.cfml.getPos();
      Position line=data.cfml.getPosition();
      Expression name = null,type = null;
     
      StringBuffer sbType=new StringBuffer();
            String id;
            while(true) {
              id=identifier(data,false);
                if(id==null)break;
                sbType.append(id);
                data.cfml.removeSpace();
                if(!data.cfml.forwardIfCurrent('.'))break;
                sbType.append('.');
                data.cfml.removeSpace();
            }
       
           
      if(sbType.length()==0) {
          type=string(data);
          if(type==null)         
              throw new TemplateException(data.cfml,"a catch statement must begin with the throwing type (query, application ...).");
      }
      else {
        type=LitString.toExprString(sbType.toString());
      }
           
           
      //name = expression();
      comments(data);
     
      // name
      if(!data.cfml.isCurrent(')')) {
        name=expression(data);
      }
      else {
        data.cfml.setPos(pos);
        name=expression(data);
        type = LitString.toExprString( "any" );
      }
      comments(data);

            Body b=new BodyBase();
      try {
        tryCatchFinally.addCatch(type,name,b,line);
      }
      catch (BytecodeException e) {
        throw new TemplateException(data.cfml,e.getMessage());
View Full Code Here

   * @param tag Ausgangspunkt, nach diesem tag darf das angegebene nicht vorkommen.
   * @param nameToFind Tag Name der nicht vorkommen darf
   * @return kommt das Tag vor.
   */
  public static boolean hasSisterTagAfter(Tag tag, String nameToFind) {
    Body body=(Body) tag.getParent();
    List<Statement> stats = body.getStatements();
    Iterator<Statement> it = stats.iterator();
    Statement other;
   
    boolean isAfter=false;
    while(it.hasNext()) {
View Full Code Here

   * @param tag Ausgangspunkt, nach diesem tag darf das angegebene nicht vorkommen.
   * @return kommt das Tag vor.
   */
  public static boolean hasSisterTagWithSameName(Tag tag) {
   
    Body body=(Body) tag.getParent();
    List<Statement> stats = body.getStatements();
    Iterator<Statement> it = stats.iterator();
    Statement other;
    String name=tag.getTagLibTag().getName();
   
    while(it.hasNext()) {
View Full Code Here

  /**
   * remove this tag from his parent body
   * @param tag
   */
  public static void remove(Tag tag) {
    Body body=(Body) tag.getParent();
    body.getStatements().remove(tag);
  }
View Full Code Here

   * @param trg
   */
  public static void replace(Tag src, Tag trg, boolean moveBody) {
    trg.setParent(src.getParent());
   
    Body p=(Body) src.getParent();
    List<Statement> stats = p.getStatements();
    Iterator<Statement> it = stats.iterator();
    Statement stat;
    int count=0;
   
    while(it.hasNext()) {
View Full Code Here

  }



  public static void removeLiterlChildren(Tag tag, boolean recursive) {
    Body body=tag.getBody();
    if(body!=null) {
          List<Statement> list = body.getStatements();
          Statement[] stats = list.toArray(new Statement[list.size()]);
          PrintOut po;
          Tag t;
          for(int i=0;i<stats.length;i++) {
              if(stats[i] instanceof PrintOut) {
                po=(PrintOut) stats[i];
                if(po.getExpr() instanceof Literal) {
                  body.getStatements().remove(po);
                }
              }
              else if(recursive && stats[i] instanceof Tag) {
                t=(Tag) stats[i];
                if(t.getTagLibTag().isAllowRemovingLiteral()) {
View Full Code Here

      }
    }
  }

  public static void throwIfNotEmpty(Tag tag) throws EvaluatorException {
    Body body = tag.getBody();
    List<Statement> statments = body.getStatements();
    Statement stat;
    Iterator<Statement> it = statments.iterator();
    TagLibTag tlt;
   
    while(it.hasNext()) {
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.Body

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.