/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
/** * Get hashcode for WhileStatement. WARNING: This hash code relies on the * hash codes of the block and the criteria. Hash code is only valid after the block has been * completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the blocks and criteria for this statement int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getCondition()); myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
case Statement.TYPE_WHILE: WhileStatement whileStatement = (WhileStatement) statement; Criteria crit = whileStatement.getCondition(); crit = rewriteCriteria(crit); whileStatement.setCondition(crit); if(crit.equals(FALSE_CRITERIA) || crit.equals(UNKNOWN_CRITERIA)) { return; whileStatement.setBlock(rewriteBlock(whileStatement.getBlock())); if (whileStatement.getBlock().getStatements().isEmpty()) { return;
Program whileProgram = planBlock(parentProcCommand, whileStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); if(debug) { analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$ instruction = new WhileInstruction(whileProgram, whileStmt.getCondition(), whileStmt.getLabel()); break;
final public WhileStatement whileStatement(ParseInfo info) throws ParseException { WhileStatement whileStmt = null; Criteria criteria = null; Statement stmt = null; jj_consume_token(WHILE); jj_consume_token(LPAREN); criteria = criteria(info); jj_consume_token(RPAREN); stmt = statement(info); whileStmt = new WhileStatement(criteria, asBlock(stmt)); {if (true) return whileStmt;} throw new Error("Missing return statement in function"); }
/** * Compare two WhileStatements for equality. They will only evaluate to equal if * they are IDENTICAL: the block is same and the condition on is same. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof WhileStatement)) { return false; } WhileStatement other = (WhileStatement) obj; return // Compare the condition EquivalenceUtil.areEqual(getCondition(), other.getCondition()) && // Compare the if block EquivalenceUtil.areEqual(whileBlock, other.whileBlock) && StringUtil.equalsIgnoreCase(this.label, other.label); }
public void testGetIfBlock() { WhileStatement b1 = sample1(); assertTrue("Incorrect Block on statement", b1.getBlock().equals(TestBlock.sample1())); //$NON-NLS-1$ }
case Statement.TYPE_WHILE: WhileStatement whileStatement = (WhileStatement) statement; Criteria crit = whileStatement.getCondition(); crit = rewriteCriteria(crit); whileStatement.setCondition(crit); if(crit.equals(FALSE_CRITERIA) || crit.equals(UNKNOWN_CRITERIA)) { return; whileStatement.setBlock(rewriteBlock(whileStatement.getBlock())); if (whileStatement.getBlock().getStatements().isEmpty()) { return;
Program whileProgram = planBlock(parentProcCommand, whileStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); if(debug) { analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$ instruction = new WhileInstruction(whileProgram, whileStmt.getCondition(), whileStmt.getLabel()); break;
final public WhileStatement whileStatement(ParseInfo info) throws ParseException { WhileStatement whileStmt = null; Criteria criteria = null; Statement stmt = null; jj_consume_token(WHILE); jj_consume_token(LPAREN); criteria = criteria(info); jj_consume_token(RPAREN); stmt = statement(info); whileStmt = new WhileStatement(criteria, asBlock(stmt)); {if (true) return whileStmt;} throw new Error("Missing return statement in function"); }
/** * Compare two WhileStatements for equality. They will only evaluate to equal if * they are IDENTICAL: the block is same and the condition on is same. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof WhileStatement)) { return false; } WhileStatement other = (WhileStatement) obj; return // Compare the condition EquivalenceUtil.areEqual(getCondition(), other.getCondition()) && // Compare the if block EquivalenceUtil.areEqual(whileBlock, other.whileBlock) && StringUtil.equalsIgnoreCase(this.label, other.label); }
/** * Get hashcode for WhileStatement. WARNING: This hash code relies on the * hash codes of the block and the criteria. Hash code is only valid after the block has been * completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the blocks and criteria for this statement int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getCondition()); myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
case Statement.TYPE_WHILE: WhileStatement whileStatement = (WhileStatement) statement; Criteria crit = whileStatement.getCondition(); crit = rewriteCriteria(crit); whileStatement.setCondition(crit); if(crit.equals(FALSE_CRITERIA) || crit.equals(UNKNOWN_CRITERIA)) { return; whileStatement.setBlock(rewriteBlock(whileStatement.getBlock())); if (whileStatement.getBlock().getStatements().isEmpty()) { return;
Program whileProgram = planBlock(parentProcCommand, whileStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); if(debug) { analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$ instruction = new WhileInstruction(whileProgram, whileStmt.getCondition(), whileStmt.getLabel()); break;
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
final public WhileStatement whileStatement(ParseInfo info) throws ParseException { WhileStatement whileStmt = null; Criteria criteria = null; Statement stmt = null; jj_consume_token(WHILE); jj_consume_token(LPAREN); criteria = criteria(info); jj_consume_token(RPAREN); stmt = statement(info); whileStmt = new WhileStatement(criteria, asBlock(stmt)); {if (true) return whileStmt;} throw new Error("Missing return statement in function"); }
/** * Compare two WhileStatements for equality. They will only evaluate to equal if * they are IDENTICAL: the block is same and the condition on is same. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof WhileStatement)) { return false; } WhileStatement other = (WhileStatement) obj; return // Compare the condition EquivalenceUtil.areEqual(getCondition(), other.getCondition()) && // Compare the if block EquivalenceUtil.areEqual(whileBlock, other.whileBlock) && StringUtil.equalsIgnoreCase(this.label, other.label); }
/** * Get hashcode for WhileStatement. WARNING: This hash code relies on the * hash codes of the block and the criteria. Hash code is only valid after the block has been * completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the blocks and criteria for this statement int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getCondition()); myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
public static final WhileStatement sample1() { Block block = TestBlock.sample1(); Criteria criteria = TestSetCriteria.sample1(); return new WhileStatement(criteria, block); }