public void Visit(NBreak nBreak) { if (nestedLoopCount <= 0) { throw new SemanticError("Break statement not allowed outside a loop", nBreak.AnchorToken); } }
//----------------------------------------------------------- public void Visit(NBreak node) { Console.WriteLine($"+++++++++++++++ NBreak ++++++++++++++++"); if (pasones == 2) { if (inloop > 0) { VisitChildren(node); } else { throw new SemanticError("unexpected 'break'", node.AnchorToken); } } else { VisitChildren(node); } }
public string Visit(NBreak nBreak) { return("\t\tbr " + currentBreakLabel + "\n"); }