예제 #1
0
 public void VisitInstructionSwitch(CilInstructionSwitch instruction)
 {
     if (instruction is SwitchInstruction switchInstruction)
     {
         VisitSwitchInstruction(switchInstruction);
     }
     else
     {
         throw new ArgumentException($"CIL instruction switch cannot be recognized: '{instruction.ToString()}'.");
     }
 }
예제 #2
0
        public override void Init(AstContext context, ParseTreeNode parseNode)
        {
            // _("switch")
            var switchChildren = AstChildren.Empty()
                                 .Add("switch");

            if (switchChildren.PopulateWith(parseNode))
            {
                Instruction = new SwitchInstruction();

                return;
            }

            throw new NotImplementedException();
        }