Package railo.transformer.bytecode.literal

Examples of railo.transformer.bytecode.literal.LitString



    if(!cfml.forwardIfCurrent(quoter))
      throw new TemplateException(cfml,"Invalid Syntax Closing ["+quoter+"] not found");
 
    LitString rtn = new LitString(str.toString(),line,cfml.getPosition());
    cfml.removeSpace();
    return rtn;
  }
View Full Code Here


      else sb.append(cfml.getCurrent());
      cfml.next();
    }
    cfml.removeSpace();
   
    return new LitString(sb.toString(),line,cfml.getPosition());
  }
View Full Code Here

   
    public static ExprString toExprString(Expression left, Expression right, boolean concatStatic) {
        if(concatStatic && left instanceof Literal && right instanceof Literal) {
            String l = ((Literal)left).getString();
          String r = ((Literal)right).getString();
          if((l.length()+r.length())<=LitString.MAX_SIZE)return new LitString(l.concat(r),left.getStart(),right.getEnd());
        }
        return new OpString(left,right);
    }
View Full Code Here

     
      // Data Member
      if(member instanceof DataMember)  {
        ExprString name = ((DataMember)member).getName();
        if(last && ASMUtil.isDotKey(name)){
          LitString ls = (LitString)name;
          if(ls.getString().equalsIgnoreCase("RECORDCOUNT")){
            adapter.invokeStatic(VARIABLE_UTIL_IMPL, RECORDCOUNT);
          }
          else if(ls.getString().equalsIgnoreCase("CURRENTROW")){
            adapter.invokeStatic(VARIABLE_UTIL_IMPL, CURRENTROW);
          }
          else if(ls.getString().equalsIgnoreCase("COLUMNLIST")){
            adapter.invokeStatic(VARIABLE_UTIL_IMPL, COLUMNLIST);
          }
          else {
           
            if(registerKey(bc,name))adapter.invokeVirtual(Types.PAGE_CONTEXT,asCollection(asCollection, last)?GET_COLLECTION_KEY:GET_KEY);
View Full Code Here

  public static boolean registerKey(BytecodeContext bc,Expression name,boolean doUpperCase) throws BytecodeException {
   
    if(name instanceof Literal) {
      Literal l=(Literal) name;
     
      LitString ls = name instanceof LitString?(LitString)l:LitString.toLitString(l.getString());
      if(doUpperCase){
        ls=ls.duplicate();
        ls.upperCase();
      }
      String key=KeyConstants.getFieldName(ls.getString());
      if(key!=null){
        bc.getAdapter().getStatic(KEY_CONSTANTS, key, Types.COLLECTION_KEY);
        return true;
      }
      int index=bc.registerKey(ls);
View Full Code Here

   
      // this
      if(scope==Scope.SCOPE_UNDEFINED) {
        ExprString name = member.getName();
        if(ASMUtil.isDotKey(name)){
          LitString ls = (LitString)name;
        if(ls.getString().equalsIgnoreCase("THIS")){
          if(startIndex!=null)startIndex.setValue(1);
          adapter.loadArg(0);
          adapter.checkCast(Types.PAGE_CONTEXT_IMPL);
          if(defaultValue!=null) {
            defaultValue.writeOut(bc, MODE_REF);
View Full Code Here

    FieldVisitor fv = bc.getClassWriter().visitField(Opcodes.ACC_PRIVATE ,
        "keys", Types.COLLECTION_KEY_ARRAY.toString(), null, null);
    fv.visitEnd();
   
    int index=0;
    LitString value;
    Iterator<LitString> it = keys.iterator();
    ga.visitVarInsn(Opcodes.ALOAD, 0);
    ga.push(keys.size());
    ga.newArray(Types.COLLECTION_KEY);
    while(it.hasNext()) {
View Full Code Here

  public TagLib execute(Config config,Tag tag, TagLibTag libTag, FunctionLib[] flibs,Data data) throws TemplateException {
    TagLoop loop=(TagLoop) tag;
    // label
    try {
      if(ASMUtil.isLiteralAttribute(tag, "label", ASMUtil.TYPE_STRING, false, true)) {
        LitString ls=(LitString) CastString.toExprString(tag.getAttribute("label").getValue());
        String l = ls.getString();
        if(!StringUtil.isEmpty(l,true)) {
          loop.setLabel(l.trim());
          tag.removeAttribute("label");
        }
      }
View Full Code Here

          if (!data.cfml.isCurrent('#'))
            throw new TemplateException(data.cfml,"Invalid Syntax Closing [#] not found");
         
          ExprString exprStr=null;
          if(str.length()!=0) {
            exprStr=new LitString(str.toString(),line,data.cfml.getPosition());
            if(expr!=null){
              expr = OpString.toExprString(expr, exprStr);
            }
            else expr=exprStr;
            str=new StringBuffer();
          }
          if(expr==null) {
            expr=inner;
          }
          else  {
            expr = OpString.toExprString(expr, inner);
         
        }
      }
      // check quoter
      else if(data.cfml.isCurrent(quoter)) {
        // Ecaped sharp
        if(data.cfml.isNext(quoter)){
          data.cfml.next();
          str.append(quoter);
        }
        // finsish
        else {
          break;
        }       
      }
      // all other character
      else {
        str.append(data.cfml.getCurrent());
      }
    }
    if(!data.cfml.forwardIfCurrent(quoter))
      throw new TemplateException(data.cfml,"Invalid Syntax Closing ["+quoter+"] not found");
   
    if(expr==null)
      expr=new LitString(str.toString(),line,data.cfml.getPosition());
    else if(str.length()!=0) {
      expr = OpString.toExprString(expr, new LitString(str.toString(),line,data.cfml.getPosition()));
    }
        comments(data);
       
        if(expr instanceof Variable) {
          Variable var=(Variable) expr;
View Full Code Here

    if(!(m instanceof DataMember)) return expr;
   
    ExprString n = ((DataMember)m).getName();
    if(!(n instanceof LitString)) return expr;
   
    LitString ls=(LitString) n;
   
   
    if(!"new".equalsIgnoreCase(ls.getString())) return expr;
   
    int start=data.cfml.getPos();
      String name=null;
     
     
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.literal.LitString

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.