public void VisitInstructionString(CilInstructionString instruction) { if (instruction is LoadStringInstruction loadStringInstruction) { VisitLoadStringInstruction(loadStringInstruction); } else { throw new ArgumentException($"CIL instruction string cannot be recognized: '{instruction.ToString()}'."); } }
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)); }