Exemple #1
0
        public IParseResult Parse(string text)
        {
            // ```ea-table-notes
            // User
            // Customer
            // ```
            var lines = text.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries);

            if (lines.Count() == 0)
            {
                return(new ParseFailure(
                           new ParseError(new Range(new Position(0, 0), new Position(0, 0)), "specify optional package and tables")));
            }
            var model = new TableNotes();
            var path  = lines[0].Replace("package: ", string.Empty);

            model.PackagePath = new Path(path);

            if (lines.Count() > 1)
            {
                model.Tables = lines.Skip(1).Select(l => new Table {
                    Name = l
                });
            }
            else
            {
                model.AllTables = true;
            }
            return(new ParseSuccess(model));
        }
Exemple #2
0
 public static bool Include(TableNotes tnm, Element e)
 {
     if (e.Stereotype != "table")
     {
         return(false);
     }
     if (tnm.AllTables)
     {
         return(true);
     }
     return(tnm.Tables.Any(t => Equals(t.Name, e.Name)));
 }