public override string VisitASTFlow(ASTFlow astFlow) { var result = new MermaidFlowMapper(astFlow).ToString(); this.Parts.Add(result); return(result); }
public T Visit(IASTNode node) { return(node switch { ASTType n => VisitASTType(n), ASTTypeField n => VisitASTTypeField(n), ASTTypeDefinition n => VisitASTTypeDefinition(n), ASTRestriction n => VisitASTRestriction(n), ASTAlias n => VisitASTAlias(n), ASTData n => VisitASTData(n), ASTAnnotation n => VisitASTAnnotation(n), ASTDirective n => VisitASTDirective(n), ASTChoice n => VisitASTChoice(n), ASTOption n => VisitASTOption(n), ASTChapter n => VisitASTChapter(n), ASTParagraph n => VisitASTParagraph(n), ASTFlow n => VisitASTFlow(n), _ => VisitDefault(node), });
public IEnumerable <IASTNode> Parse() { var annotations = new List <ASTAnnotation>(); var directives = new List <ASTDirective>(); while (HasNext() && Current.TokenType != TokenType.EndOfFile) { if (Current.TokenType == TokenType.KW_Type) { var(errors, t) = ASTType.Parse(this, annotations, directives); Errors.AddRange(errors); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); yield return(t); } else if (Current.TokenType == TokenType.KW_Alias) { var(errors, alias) = ASTAlias.Parse(this, annotations, directives); Errors.AddRange(errors); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); yield return(alias); } else if (Current.TokenType == TokenType.KW_Choice) { var(errors, result) = ASTChoice.Parse(this); Errors.AddRange(errors); yield return(result); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); } else if (Current.TokenType == TokenType.KW_Data) { var(errors, data) = ASTData.Parse(this, annotations, directives); Errors.AddRange(errors); yield return(data); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); } else if (Current.TokenType == TokenType.KW_View) { var(errors, data) = ASTView.Parse(this, annotations, directives); Errors.AddRange(errors); yield return(data); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); } else if (Current.TokenType == TokenType.KW_Open) { var(errors, data) = ASTImport.Parse(this); Errors.AddRange(errors); yield return(data); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); } else if (Current.TokenType == TokenType.KW_Flow) { var(errors, data) = ASTFlow.Parse(this); Errors.AddRange(errors); yield return(data); annotations = new List <ASTAnnotation>(); directives = new List <ASTDirective>(); } else if (Current.TokenType == TokenType.Annotation) { annotations = ASTAnnotation.Parse(this).ToList(); } else if (Current.TokenType == TokenType.Directive) { var(errors, dirs) = ASTDirective.Parse(this); Errors.AddRange(errors.ToList()); directives = dirs.ToList(); } else if (Current.TokenType == TokenType.Chapter) { yield return(new ASTChapter(Current.Value)); Next(); } else if (Current.TokenType == TokenType.Paragraph) { yield return(new ASTParagraph(Current.Value)); Next(); } else { Next(); } } yield break; }
public MermaidFlowMapper(ASTFlow flow) { this.Flow = flow; }
public override T VisitASTFlow(ASTFlow astFlow) => d;
public override string VisitASTFlow(ASTFlow astFlow) => throw new NotImplementedException();
public override XmlSchemaObject?VisitASTFlow(ASTFlow astFlow) { return(null); }
public override string VisitASTFlow(ASTFlow astFlow) { return(""); }