public override void EnterActionBlock([NotNull] ANTLRv4Parser.ActionBlockContext context) { var text = context.GetText(); text = text.Substring(1, text.Length - 2); var textSpan = context.GetTextSpan(GrammarSource); textSpan = new TextSpan(textSpan.Start + 1, textSpan.Length - 2, GrammarSource); if (_lexer || _parser) { var codeInsertion = new CodeInsertion { TextSpan = textSpan, Text = text, Lexer = _lexer, Predicate = _question }; CodeInsertions.Add(codeInsertion); } }
/// <summary> /// Exit a parse tree produced by <see cref="ANTLRv4Parser.actionBlock"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitActionBlock([NotNull] ANTLRv4Parser.ActionBlockContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="ANTLRv4Parser.actionBlock"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitActionBlock([NotNull] ANTLRv4Parser.ActionBlockContext context) { return(VisitChildren(context)); }