Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.Expression


      return null;
   
    Position line = data.cfml.getPosition();
   
    comments(data);
    Expression expr = super.expression(data);
    comments(data);
    // end )
    if(!data.cfml.forwardIfCurrent(')'))
      throw new TemplateException(data.cfml,"switch statement must end with a [)]");
    comments(data);
View Full Code Here


    if(!data.cfml.forwardIfCurrentAndNoWordAfter("case"))
      return false;
   
    //int line=data.cfml.getLine();   
    comments(data);
    Expression expr = super.expression(data);
    comments(data);
   
    if(!data.cfml.forwardIfCurrent(':'))
      throw new TemplateException(data.cfml,"case body must start with [:]");
   
View Full Code Here

    //if(!data.cfml.forwardIfCurrent("for",'('))
    //  return null;
   
   
   
    Expression left=null;
    Body body=new BodyBase();
    Position line = data.cfml.getPosition();
    comments(data);
    if(!data.cfml.isCurrent(';')) {
      // left
      left=expression(data);
      comments(data);
    }
    // middle for
      if(data.cfml.forwardIfCurrent(';')) {

        Expression cont=null;
        Expression update=null;
        // condition
          comments(data);
          if(!data.cfml.isCurrent(';')) {
            cont=condition(data);
            comments(data);
          }
        // middle
        if(!data.cfml.forwardIfCurrent(';'))
          throw new TemplateException(data.cfml,"invalid syntax in for statement");
        // update
          comments(data);
          if(!data.cfml.isCurrent(')')) {
            update=expression(data);
            comments(data);
          }
        // start )
        if(!data.cfml.forwardIfCurrent(')'))
          throw new TemplateException(data.cfml,"invalid syntax in for statement, for statement must end with a [)]");
        // ex block
        statement(data,body,CTX_FOR);
   
        return new For(left,cont,update,body,line,data.cfml.getPosition(),id);         
      }
    // middle foreach
      else if(data.cfml.forwardIfCurrent("in")) {
        // condition
          comments(data);
          Expression value = expression(data);
          comments(data);
        if(!data.cfml.forwardIfCurrent(')'))
          throw new TemplateException(data.cfml,"invalid syntax in for statement, for statement must end with a [)]");
       
        // ex block
View Full Code Here

      if(!data.cfml.forwardIfCurrent('('))
        throw new TemplateException(data.cfml,"invalid syntax in function head, missing begin [(]");
   
      // arguments
      LitBoolean passByRef;
      Expression displayName;
      Expression hint;
      Map<String,Attribute> meta;
      String _name;
      do  {
        comments(data);
        // finish
        if(data.cfml.isCurrent(')'))break;
       
        // attribute
       
        // name
        //String idName=identifier(data,false,true);
        boolean required=false;
       
        String idName = variableDec(data, false);
        // required
        if("required".equalsIgnoreCase(idName)){
          comments(data);
          String idName2=variableDec(data, false);
          if(idName2!=null){
            idName=idName2;
            required=true;
          }
        }
       
       
        String typeName="any";
        if(idName==null) throw new TemplateException(data.cfml,"invalid argument definition");
        comments(data);
        if(!data.cfml.isCurrent(')') && !data.cfml.isCurrent('=') && !data.cfml.isCurrent(':') && !data.cfml.isCurrent(',')) {
          typeName=idName.toLowerCase();
          idName=identifier(data,false); // MUST was upper case before, is this a problem?
        }
        else if(idName.indexOf('.')!=-1 || idName.indexOf('[')!=-1) {
          throw new TemplateException(data.cfml,"invalid argument name ["+idName+"] definition");
        }
       
        comments(data);
        Expression defaultValue;
        if(data.cfml.isCurrent('=') || data.cfml.isCurrent(':')) {
          data.cfml.next();
          comments(data);
          defaultValue=expression(data);
        }
View Full Code Here

      Return rtn;
     
      comments(data);
      if(checkSemiColonLineFeed(data, false,false)) rtn=new Return(line,data.cfml.getPosition());
      else {
        Expression expr = expression(data);
        checkSemiColonLineFeed(data, true,true);
        rtn=new Return(expr,line,data.cfml.getPosition());
      }
    comments(data);
View Full Code Here

    comments(data);
   
    // attribute
    TagLibTagAttr attr = tlt.getScript().getSingleAttr();
    String attrName=null;
    Expression attrValue=null;
    short attrType=ATTR_TYPE_NONE;
    if(attr!=null){
      attrType = attr.getScriptSupport();
      char c = data.cfml.getCurrent();
      if(ATTR_TYPE_REQUIRED==attrType || (!data.cfml.isCurrent(';') && ATTR_TYPE_OPTIONAL==attrType)) {
View Full Code Here

   * @param parent
   * @return Ausdruck
   * @throws TemplateException
   */
  private Statement expressionStatement(ExprData data, Body parent) throws TemplateException {
    Expression expr=expression(data);
    checkSemiColonLineFeed(data,true,true);
    if(expr instanceof ClosureAsExpression)
      return ((ClosureAsExpression)expr).getClosure();
     
    return new ExpressionAsStatement(expr);
View Full Code Here

      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);
View Full Code Here

      String name=attributeName(data.cfml,args,tlt,dynamic,sbType, allowTwiceAttr);
      boolean allowExpression=false;
      if(oAllowExpression instanceof Boolean)allowExpression=((Boolean)oAllowExpression).booleanValue();
      else if(oAllowExpression instanceof String)allowExpression=((String)oAllowExpression).equalsIgnoreCase(name);

          Expression value=null;
     
      CFMLTransformer.comment(data.cfml,true);
     
      // value
      if(data.cfml.forwardIfCurrent('='))  {
View Full Code Here

 
  /**
   * @see railo.transformer.cfml.ExprTransformer#transform(railo.transformer.library.function.FunctionLib[], org.w3c.dom.Document, railo.transformer.util.CFMLString)
   */
  public Expression transform(Page page,EvaluatorPool ep,FunctionLib[] fld,TagLibTag[] scriptTags, CFMLString cfml, TransfomerSettings settings) throws TemplateException {
      Expression expr=null;
      // String
        if((expr=string(cfml))!=null) {
          return expr;
        }
      // Simple
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.expression.Expression

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.