public override Object VisitElseIf([NotNull] MFSHParser.ElseIfContext context) { const String fcn = "VisitElseIf"; this.TraceMsg(context, fcn); ConditionalBlock conditionalBlock = this.Current as ConditionalBlock; if (conditionalBlock == null) { this.Error(fcn, context.Start.Line.ToString(), $"Error '#else if' found with no starting '#if'"); } MIConditional.Condition condition = new MIConditional.Condition(); condition.State = (MIConditional.CState) this.Visit(context.condition()); conditionalBlock.AddCondition(condition); return(null); }
/// <summary> /// Visit a parse tree produced by <see cref="MFSHParser.elseIf"/>. /// <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 VisitElseIf([NotNull] MFSHParser.ElseIfContext context) { return(VisitChildren(context)); }