public void VisitInstructionString(CilInstructionString instruction)
 {
     if (instruction is LoadStringInstruction loadStringInstruction)
     {
         VisitLoadStringInstruction(loadStringInstruction);
     }
     else
     {
         throw new ArgumentException($"CIL instruction string cannot be recognized: '{instruction.ToString()}'.");
     }
 }
示例#2
0
        public override void Init(AstContext context, ParseTreeNode parseNode)
        {
            // _("ldstr")
            var ldstrChildren = AstChildren.Empty()
                                .Add("ldstr");

            if (ldstrChildren.PopulateWith(parseNode))
            {
                Instruction = new LoadStringInstruction();

                return;
            }

            throw new InitAstNodeException(nameof(INSTR_STRINGAstNode));
        }