コード例 #1
0
 public void Visit(NBreak nBreak)
 {
     if (nestedLoopCount <= 0)
     {
         throw new SemanticError("Break statement not allowed outside a loop", nBreak.AnchorToken);
     }
 }
コード例 #2
0
//-----------------------------------------------------------
        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);
            }
        }
コード例 #3
0
 public string Visit(NBreak nBreak)
 {
     return("\t\tbr " + currentBreakLabel + "\n");
 }