/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.loopBlock.clone(); Command otherQuery = (Command) this.query.clone(); LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName); ls.setLabel(label); return ls; }
public void visit(LoopStatement obj) { preVisitVisitor(obj); if (deep) { visitNode(obj.getCommand()); } visitNode(obj.getBlock()); postVisitVisitor(obj); } public void visit(MatchCriteria obj) {
public void testGetCursorName(){ LoopStatement b1 = sample1(); LoopStatement b2 = sample2(); assertEquals(b1.getCursorName(), b2.getCursorName()); }
public void testCloneNonSimpleQuery(){ Block block = TestBlock.sample1(); LoopStatement ls = new LoopStatement(block, TestSetQuery.sample1(), "cursor"); //$NON-NLS-1$ LoopStatement clone = (LoopStatement) ls.clone(); UnitTestUtil.helpTestEquivalence(0, ls, clone); }
@Override public void visit( LoopStatement obj ) { addLabel(obj); append(LOOP); append(" "); //$NON-NLS-1$ append(ON); append(" ("); //$NON-NLS-1$ visitNode(obj.getCommand()); append(") "); //$NON-NLS-1$ append(AS); append(" "); //$NON-NLS-1$ outputDisplayName(obj.getCursorName()); append("\n"); //$NON-NLS-1$ addTabs(0); visitNode(obj.getBlock()); }
analysisRecord.println("\tLOOP STATEMENT:\n" + statement); //$NON-NLS-1$ String rsName = loopStmt.getCursorName(); ProcessorPlan commandPlan = loopStmt.getCommand().getProcessorPlan(); Program loopProgram = planBlock(parentProcCommand, loopStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); instruction = new LoopInstruction(loopProgram, rsName, commandPlan, loopStmt.getLabel()); break;
public static final LoopStatement sample1() { Block block = TestBlock.sample1(); return new LoopStatement(block, query1(), "cursor"); //$NON-NLS-1$ }
public void testGetBlock() { LoopStatement b1 = sample1(); assertTrue("Incorrect Block on statement", b1.getBlock().equals(TestBlock.sample1())); //$NON-NLS-1$ }
/** * Visit a language object and collect symbols. This method should <b>NOT</b> be * called directly. * @param obj Language object */ public void visit(LoopStatement obj) { this.commands.add(obj.getCommand()); }
@Override public void visit( LoopStatement obj ) { addLabel(obj); append(LOOP); append(" "); //$NON-NLS-1$ append(ON); append(" ("); //$NON-NLS-1$ visitNode(obj.getCommand()); append(") "); //$NON-NLS-1$ append(AS); append(" "); //$NON-NLS-1$ outputDisplayName(obj.getCursorName()); append("\n"); //$NON-NLS-1$ addTabs(0); visitNode(obj.getBlock()); }
analysisRecord.println("\tLOOP STATEMENT:\n" + statement); //$NON-NLS-1$ String rsName = loopStmt.getCursorName(); ProcessorPlan commandPlan = loopStmt.getCommand().getProcessorPlan(); Program loopProgram = planBlock(parentProcCommand, loopStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); instruction = new LoopInstruction(loopProgram, rsName, commandPlan, loopStmt.getLabel()); break;
public static final LoopStatement sample2() { Block block = TestBlock.sample2(); return new LoopStatement(block, query2(), "cursor"); //$NON-NLS-1$ }
assertEquals(ProcedureReservedWords.VARIABLES, ((ElementSymbol)assStmt.getExpression()).getGroupSymbol().getName()); Block inner = ((LoopStatement)block.getStatements().get(2)).getBlock();
/** * Visit a language object and collect symbols. This method should <b>NOT</b> be * called directly. * @param obj Language object */ public void visit(LoopStatement obj) { this.commands.add(obj.getCommand()); }
@Override public void visit( LoopStatement obj ) { addLabel(obj); append(LOOP); append(" "); //$NON-NLS-1$ append(ON); append(" ("); //$NON-NLS-1$ visitNode(obj.getCommand()); append(") "); //$NON-NLS-1$ append(AS); append(" "); //$NON-NLS-1$ outputDisplayName(obj.getCursorName()); append("\n"); //$NON-NLS-1$ addTabs(0); visitNode(obj.getBlock()); }
analysisRecord.println("\tLOOP STATEMENT:\n" + statement); //$NON-NLS-1$ String rsName = loopStmt.getCursorName(); ProcessorPlan commandPlan = loopStmt.getCommand().getProcessorPlan(); Program loopProgram = planBlock(parentProcCommand, loopStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context); instruction = new LoopInstruction(loopProgram, rsName, commandPlan, loopStmt.getLabel()); break;
final public LoopStatement loopStatement(ParseInfo info) throws ParseException { LoopStatement loopStmt = null; String cursor = null; QueryCommand query = null; Statement stmt = null; jj_consume_token(LOOP); jj_consume_token(ON); jj_consume_token(LPAREN); query = queryExpression(info); jj_consume_token(RPAREN); jj_consume_token(AS); cursor = id(null); stmt = statement(info); loopStmt = new LoopStatement(asBlock(stmt), query, cursor); {if (true) return loopStmt;} throw new Error("Missing return statement in function"); }
public void visit(LoopStatement obj) { preVisitVisitor(obj); if (deep) { visitNode(obj.getCommand()); } visitNode(obj.getBlock()); postVisitVisitor(obj); } public void visit(MatchCriteria obj) {
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.loopBlock.clone(); Command otherQuery = (Command) this.query.clone(); LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName); ls.setLabel(label); return ls; }