public override string VisitStage_declaration([NotNull] LogstashconfigParser.Stage_declarationContext context) { //初始化各个配置节对象 var type = ""; var input = context.INPUT(); if (input != null) { type = input.GetText(); } var filter = context.FILTER(); if (filter != null) { type = filter.GetText(); } var output = context.OUTPUT(); if (output != null) { type = output.GetText(); } if (!Config.Plugins.ContainsKey(type)) { Config.Plugins.Add(type, new List <Plugin>()); } curplugtype = type; return(base.VisitStage_declaration(context)); }
/// <summary> /// Visit a parse tree produced by <see cref="LogstashconfigParser.stage_declaration"/>. /// <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 VisitStage_declaration([NotNull] LogstashconfigParser.Stage_declarationContext context) { return VisitChildren(context); }
/// <summary> /// Exit a parse tree produced by <see cref="LogstashconfigParser.stage_declaration"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitStage_declaration([NotNull] LogstashconfigParser.Stage_declarationContext context) { }