Package dk.brics.string.intermediate

Examples of dk.brics.string.intermediate.PrimitiveInit


    case ARRAY:
      addStatement(new ArrayNew(v));
      addStatement(new ArrayWriteElement(v, makeAnyStringVariable()));
      break;
    case PRIMITIVE:
        addStatement(new PrimitiveInit(v, Automaton.makeAnyChar()));
        break;
    default:
      // no initialization necessary of uncertain objects
    }
  }
View Full Code Here


 
  @Override
  public Variable caseIntConstant(IntConstant v, ValueBox question) {
      Variable result = makeVariable(VariableType.PRIMITIVE);
      if (v.value >= Character.MIN_VALUE && v.value <= Character.MAX_VALUE) {
          addStatement(new PrimitiveInit(result, Automaton.makeChar((char)v.value)));
      } else {
          addStatement(new PrimitiveInit(result, Automaton.makeAnyChar()));
      }
      return result;
  }
View Full Code Here

  }
  @Override
  public Variable caseLongConstant(LongConstant v, ValueBox question) {
    Variable result = makeVariable(VariableType.PRIMITIVE);
      if (v.value >= Character.MIN_VALUE && v.value <= Character.MAX_VALUE) {
          addStatement(new PrimitiveInit(result, Automaton.makeChar((char)v.value)));
      } else {
          addStatement(new PrimitiveInit(result, Automaton.makeAnyChar()));
      }
      return result;
  }
View Full Code Here

                        case ARRAY:
                            s = new ArrayCorrupt(arg);
                            break;
                        case PRIMITIVE:
                            // TODO: Integers can contain two characters, right? look deeper into which primitive type
                            s = new PrimitiveInit(arg, Automaton.makeAnyChar());
                            break;
                        default:
                            s = new ObjectCorrupt(arg);
                            // (case NONE or NULL cannot occur because such
                            // parameters do not get created for intermediate
View Full Code Here

            // String.contentEquals(CharSequence) and String.contentEquals(StringBuffer)
            } else if (methodName.equals("contentEquals") && numArgs == 1) {
                // we can't say anything meaningful except the argument is NOT corrupted
                // (the argument will be considered corrupted if we do not handle it here)
                Variable result = factory.createVariable(VariableType.PRIMITIVE);
                factory.addStatement(new PrimitiveInit(result, Basic.getBinaryBooleans()));
                return result;
            }
           
            // String.toCharArray()
            else if (methodName.equals("toCharArray") && numArgs == 0) {
View Full Code Here

    return null;
  }
 
  private Variable anybool(IntermediateFactory factory) {
    Variable var = factory.createVariable(VariableType.PRIMITIVE);
    factory.addStatement(new PrimitiveInit(var, Basic.getBinaryBooleans()));
    return var;
  }
View Full Code Here

TOP

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

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.