Exemple #1
0
        public override CodeQueryVisitor VisitConstantString(CodeQueryParser.ConstantStringContext context)
        {
            var stringValue = context.STRING().GetText().Trim('"');

            _constants.Push(stringValue);
            return(base.VisitConstantString(context));
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="CodeQueryParser.ConstantString"/>.
 /// <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 VisitConstantString([NotNull] CodeQueryParser.ConstantStringContext context)
 {
     return(VisitChildren(context));
 }
Exemple #3
0
        /// <summary>
        /// Visit a parse tree produced by <see cref="CodeQueryParser.ConstantString" />.
        /// <para>
        /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)" />
        /// on <paramref name="context" />.
        /// </para>
        /// </summary>
        public override Object VisitConstantString(CodeQueryParser.ConstantStringContext context)
        {
            var value = context.STRING().GetText().Trim('"');

            return(TreeFactory.CreateString(value));
        }
 /// <summary>
 /// Exit a parse tree produced by <see cref="CodeQueryParser.ConstantString"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitConstantString([NotNull] CodeQueryParser.ConstantStringContext context)
 {
 }