public override object VisitString([NotNull] StringGrammarParser.StringContext context) { string s = context.STRING().ToString(); for (int i = 1; i < s.Length - 1; i++) { if (s[i] == '"') { s = s.Substring(0, i - 1) + s.Substring(i); } } return(s.Substring(1, s.Length - 2)); }
/// <summary> /// Exit a parse tree produced by the <c>string</c> /// labeled alternative in <see cref="StringGrammarParser.expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitString([NotNull] StringGrammarParser.StringContext context) { }
/// <summary> /// Visit a parse tree produced by the <c>string</c> /// labeled alternative in <see cref="StringGrammarParser.expression"/>. /// <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 VisitString([NotNull] StringGrammarParser.StringContext context) { return(VisitChildren(context)); }