예제 #1
0
        internal Group ReadGroup()
        {
            ushort           index     = ReadUInt16();
            string           name      = ReadString();
            Symbol           container = grammarTables.Symbols[ReadUInt16()];
            Symbol           start     = grammarTables.Symbols[ReadUInt16()];
            Symbol           end       = grammarTables.Symbols[ReadUInt16()];
            GroupAdvanceMode advance   = ReadAdvanceMode();
            GroupEndingMode  ending    = ReadEndingMode();

            //Reserved; skip
            ReadEntry();

            Group group = new Group(index, name, container, start, end, advance, ending);

            ushort nestingsCount = ReadUInt16();

            for (int i = 0; i < nestingsCount; i++)
            {
                group.Nesting.Add(ReadUInt16());
            }

            group.Container.Group = group.Start.Group = group.End.Group = group;

            return(group);
        }
예제 #2
0
파일: Group.cs 프로젝트: JensFF/GSAKWrapper
 internal Group(CompiledGrammar owner, int index, string name, GroupAdvanceMode advanceMode, GroupEndingMode endingMode) : base(owner, index)
 {
     this.name        = name;
     this.advanceMode = advanceMode;
     this.endingMode  = endingMode;
     nesting          = new GrammarObjectSet <Group>();
 }
예제 #3
0
 internal Group(ushort tableIndex, string name, Symbol container, Symbol start, Symbol end,
                GroupAdvanceMode advance, GroupEndingMode ending)
 {
     TableIndex = tableIndex;
     Name       = name;
     Container  = container;
     Start      = start;
     End        = end;
     Advance    = advance;
     Ending     = ending;
     Nesting    = new List <ushort>();
 }
 internal Group(ushort tableIndex, string name, Symbol container, Symbol start, Symbol end,
     GroupAdvanceMode advance, GroupEndingMode ending)
 {
     TableIndex = tableIndex;
     Name = name;
     Container = container;
     Start = start;
     End = end;
     Advance = advance;
     Ending = ending;
     Nesting = new List<ushort>();
 }
예제 #5
0
        private void ReadGroup(LoadContext context)
        {
            int              index          = context.ReadIntegerEntry();
            string           name           = context.ReadStringEntry();
            int              containerIndex = context.ReadIntegerEntry();
            int              startIndex     = context.ReadIntegerEntry();
            int              endIndex       = context.ReadIntegerEntry();
            GroupAdvanceMode advanceMode    = (GroupAdvanceMode)context.ReadIntegerEntry();
            GroupEndingMode  endingMode     = (GroupEndingMode)context.ReadIntegerEntry();

            context.ReadEmptyEntry();
            int nestingCount = context.ReadIntegerEntry();

            Debug.Assert(nestingCount == context.EntryCount);
            int[] nesting = new int[nestingCount];
            for (int i = 0; i < nesting.Length; i++)
            {
                nesting[i] = context.ReadIntegerEntry();
            }
            groupTable[index] = new Group(this, index, name, advanceMode, endingMode);
            context.GroupInfos.Add(index, new GroupInfo(containerIndex, startIndex, endIndex, nesting));
        }