public override CSNode VisitClass_initializer(CSScriptParser.Class_initializerContext context) { CSClassInitializerNode node = new CSClassInitializerNode(context.Start.Line, context.Start.Column); CSScriptParser.Class_initializer_elementContext[] elements = context.class_initializer_element(); if (elements != null) { int len = elements.Length; node._variableNames = new string[len]; node._children = new CSNode[len]; for (int i = 0; i < len; ++i) { CSScriptParser.Class_initializer_elementContext element = elements[i]; node._variableNames[i] = element.NAME().GetText(); node._children[i] = Visit(element.expression()); } } return(node); }
/// <summary> /// Visit a parse tree produced by <see cref="CSScriptParser.class_initializer_element"/>. /// <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 VisitClass_initializer_element([NotNull] CSScriptParser.Class_initializer_elementContext context) { return(VisitChildren(context)); }