예제 #1
0
        public void PropertyWithImpliedMultiline11()
        {
            Reader reader = Reader.CreateStringReader(ExampleStrings.Occurs.PropertyWithImpliedMultiLine11);

            IDataParser parser = CreateDataParser(reader, PropertyParser.HierarchyParser(5));

            IModel model =
                Build.Property("STOCK-SECTION-N", "[ 28] Group item for stock-section-n.")
                .With(
                    Build.Occurs("STOCK-SECTION OCCURS 10 INDEXED BY STOCK-SECTION-IDX",
                                 "[ 28] Internal Stock Sections (Positional) DB")
                    .WithDataType("PIC X(2)", "Implied")
                    )
                .Model();

            AssertParsedUsingXml(parser, model);
        }
예제 #2
0
 public static IModelParser HierarchyParser(int level)
 {
     if (LevelDictionary.ContainsKey(level))
     {
         HierarchyParser hierarchyParser;
         if (!ParserDictionary.TryGetValue(level, out hierarchyParser))
         {
             hierarchyParser = new HierarchyParser(
                 SimpleLineParser(level),
                 new[]
             {
                 PropertyParser.HierarchyParser(level + 1),
                 DataTypeParser.HierarchyParser(level + 1),
                 RedefinesParser.HierarchyParser(level + 1),
                 OccursParser.HierarchyParser(level + 1)
             }
                 );
             ParserDictionary.Add(level, hierarchyParser);
         }
         return(hierarchyParser);
     }
     return(new EmptyParser());
 }