/// <summary> /// Visit a parse tree produced by <see cref="ANTLRv4Parser.labeledElement"/>. /// <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 VisitLabeledElement([NotNull] ANTLRv4Parser.LabeledElementContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="ANTLRv4Parser.labeledElement"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitLabeledElement([NotNull] ANTLRv4Parser.LabeledElementContext context) { }
private DiagramItem Transform(ANTLRv4Parser.LabeledElementContext context) => new Sequence(new DiagramItem[] { new Terminal($"{context.identifier().GetText()} {context.ASSIGN()?.GetText() ?? context.PLUS_ASSIGN()?.GetText() }", noneString, noneString), context.atom() != null ? Transform(context.atom()) : Transform(context.block()) }.Select(FSharpChoice <DiagramItem, string> .NewChoice1Of2));