Package dk.brics.string.intermediate

Examples of dk.brics.string.intermediate.ArrayAddAll


        return factory.getNothing();
      }
      else if (methodName.equals("toArray") && numArgs == 0) {
        Variable result = factory.createVariable(VariableType.ARRAY);
        factory.addStatement(new ArrayNew(result));
        factory.addStatement(new ArrayAddAll(result, callee));
        return result;
      }
      else if (methodName.equals("toArray") && numArgs == 1) {
        Variable result = factory.createVariable(VariableType.ARRAY);
       
        // the elements MIGHT be stored into the argument
        factory.startBranch();
        // 1) not stored in argument
        {
          factory.addStatement(new ArrayNew(result));
          factory.useBranch();
        }
        // 2) stored in argument
        {
          // note: existing elements in the array may remain
          // in particular if the array is larger than the collection,
          // the exceeding elements are unchanged, so do not clear the array here
          factory.addStatement(new ArrayAssignment(result, arguments.get(0)));
          factory.useBranch();
        }
        factory.endBranch();
       
        factory.addStatement(new ArrayAddAll(result, callee));
       
        return result;
      }
    }
   
View Full Code Here


   * Cannot currently be handled by method call translators, because it is
   * really <tt>Object.clone()</tt> being called, followed by a typecast (which is invisible in Java).
   */
  private Variable handleArrayClone(Variable callee) {
    Variable result = factory.createVariable(VariableType.ARRAY);
    factory.addStatement(new ArrayAddAll(result, callee));
    return result;
  }
View Full Code Here

TOP

Related Classes of dk.brics.string.intermediate.ArrayAddAll

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.