/// <summary> /// When match a path lookup context adds a <see cref="StepLookup"/>. /// </summary> /// <param name="context">The context<see cref="UserAgentTreeWalkerParser.MatcherPathLookupContext"/>.</param> /// <returns>null.</returns> public override object VisitMatcherPathLookup([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupContext context) { this.Visit(context.matcher()); this.FromHereItCannotBeInHashMapAnymore(); var lookupName = context.lookup.Text; var lookup = this.GetLookup(lookupName); this.Add(new StepLookup(lookupName, lookup, this.ExtractText(context.defaultValue))); return(null); // Void }
/// <summary> /// When match a path lookup visit the lookups. /// </summary> /// <param name="context">The context<see cref="UserAgentTreeWalkerParser.MatcherPathLookupContext"/>.</param> /// <returns>The <see cref="string"/>.</returns> public override string VisitMatcherPathLookup([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupContext context) { return(this.VisitLookups(context.matcher(), context.lookup, context.defaultValue)); }
/// <summary> /// Exit a parse tree produced by the <c>matcherPathLookup</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 ExitMatcherPathLookup([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupContext context) { }
/// <summary> /// Removes quotes from default value when visiting a MatcherPathLookupContext. /// </summary> /// <param name="context">The context.</param> /// <returns>null.</returns> public override object VisitMatcherPathLookup([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupContext context) { this.UnQuoteToken(context.defaultValue); return(base.VisitMatcherPathLookup(context)); }
/// <summary> /// Visit a parse tree produced by the <c>matcherPathLookup</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 VisitMatcherPathLookup([NotNull] UserAgentTreeWalkerParser.MatcherPathLookupContext context) { return(VisitChildren(context)); }