Beispiel #1
0
            /// <summary>
            /// When match a path lookup prefix context adds a <see cref="StepLookupPrefix"/>.
            /// </summary>
            /// <param name="context">The context<see cref="UserAgentTreeWalkerParser.MatcherPathLookupPrefixContext"/>.</param>
            /// <returns>null.</returns>
            public override object VisitMatcherPathLookupPrefix([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupPrefixContext context)
            {
                this.Visit(context.matcher());

                this.FromHereItCannotBeInHashMapAnymore();

                var lookupName = context.lookup.Text;
                var lookup     = this.GetLookup(lookupName);

                this.Add(new StepLookupPrefix(lookupName, lookup, this.ExtractText(context.defaultValue)));
                return(null); // Void
            }
	/// <summary>
	/// Exit a parse tree produced by the <c>matcherPathLookupPrefix</c>
	/// labeled alternative in <see cref="UserAgentTreeWalkerParser.matcher"/>.
	/// <para>The default implementation does nothing.</para>
	/// </summary>
	/// <param name="context">The parse tree.</param>
	public virtual void ExitMatcherPathLookupPrefix([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupPrefixContext context) { }
Beispiel #3
0
 /// <summary>
 /// Removes quotes from default value when visiting a MatcherPathLookupPrefixContext.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>null.</returns>
 public override object VisitMatcherPathLookupPrefix([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupPrefixContext context)
 {
     this.UnQuoteToken(context.defaultValue);
     return(base.VisitMatcherPathLookupPrefix(context));
 }
 /// <summary>
 /// Visit a parse tree produced by the <c>matcherPathLookupPrefix</c>
 /// labeled alternative in <see cref="UserAgentTreeWalkerParser.matcher"/>.
 /// <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 VisitMatcherPathLookupPrefix([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupPrefixContext context)
 {
     return(VisitChildren(context));
 }