public override object VisitConstant_declaration(RosMessageParser.Constant_declarationContext context) { var type = (RosTypeInfo)Visit(context.GetChild(0)); var identifier = (string)Visit(context.GetChild(1)); // child 2 = '=' var value = Visit(context.GetChild(3)); var constDescriptor = ConstantDescriptor.Create(type, identifier, value); _listener.OnVisitConstantDeclaration(constDescriptor); return(constDescriptor); }
/// <summary> /// Visit a parse tree produced by <see cref="RosMessageParser.constant_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 VisitConstant_declaration([NotNull] RosMessageParser.Constant_declarationContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="RosMessageParser.constant_declaration"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitConstant_declaration([NotNull] RosMessageParser.Constant_declarationContext context) { }