public override void CaseAContinueStm(AContinueStm node) { AForStm forStm = Util.GetAncestor<AForStm>(node); AABlock pBlock; if (!(node.Parent() is AABlock)) { pBlock = new AABlock(new ArrayList(), new TRBrace("}", node.GetToken().Line, node.GetToken().Pos)); ABlockStm blockStm = new ABlockStm(new TLBrace("{", node.GetToken().Line, node.GetToken().Pos), pBlock); node.ReplaceBy(blockStm); pBlock.GetStatements().Add(node); } pBlock = (AABlock) node.Parent(); pBlock.GetStatements().Insert(pBlock.GetStatements().IndexOf(node), forStm.GetUpdate().Clone()); }
public override void CaseAContinueStm(AContinueStm node) { AABlock pBlock = (AABlock) node.Parent(); ALocalLvalue replaceVarRef = new ALocalLvalue(new TIdentifier("whileVar")); ASimpleInvokeExp clone = (ASimpleInvokeExp)Util.MakeClone(this.node, data); AAssignmentExp assignment = new AAssignmentExp(new TAssign("="), replaceVarRef, clone); data.LocalLinks[replaceVarRef] = replaceVarDecl; data.ExpTypes[assignment] = data.LvalueTypes[replaceVarRef] = replaceVarDecl.GetType(); pBlock.GetStatements().Insert(pBlock.GetStatements().IndexOf(node), new AExpStm(new TSemicolon(";"), assignment)); replacementExpressions.Add(clone); }