Esempio n. 1
0
        internal EGT(BinaryReader Reader)
        {
            EGTReader EGT     = new EGTReader(Reader);
            EGTRecord RecType = default(EGTRecord);

            try
            {
                while (!EGT.EndOfFile())
                {
                    EGT.GetNextRecord();

                    RecType = (EGTRecord)EGT.RetrieveByte();

                    switch (RecType)
                    {
                    case EGTRecord.Property:
                    {
                        //Index, Name, Value
                        int    Index = 0;
                        string Name  = null;

                        Index = EGT.RetrieveInt16();
                        Name  = EGT.RetrieveString();
                        //Just discard
                        m_Grammar.SetValue(Index, EGT.RetrieveString());
                    }
                    break;

                    case EGTRecord.TableCounts:
                        //Symbol, CharacterSet, Rule, DFA, LALR
                        m_SymbolTable     = new SymbolList(EGT.RetrieveInt16());
                        m_CharSetTable    = new CharacterSetList(EGT.RetrieveInt16());
                        m_ProductionTable = new ProductionList(EGT.RetrieveInt16());
                        m_DFA             = new FAStateList(EGT.RetrieveInt16());
                        m_LRStates        = new LRStateList(EGT.RetrieveInt16());
                        m_GroupTable      = new GroupList(EGT.RetrieveInt16());

                        break;

                    case EGTRecord.InitialStates:
                        //DFA, LALR
                        m_DFA.InitialState      = EGT.RetrieveInt16();
                        m_LRStates.InitialState = EGT.RetrieveInt16();

                        break;

                    case EGTRecord.Symbol:
                    {
                        //#, Name, Kind
                        short      Index = 0;
                        string     Name  = null;
                        SymbolType Type  = default(SymbolType);

                        Index = EGT.RetrieveInt16();
                        Name  = EGT.RetrieveString();
                        Type  = (SymbolType)EGT.RetrieveInt16();

                        m_SymbolTable[Index] = new Symbol(Name, Type, Index);
                    }
                    break;

                    case EGTRecord.Group:
                        //#, Name, Container#, Start#, End#, Tokenized, Open Ended, Reserved, Count, (Nested Group #...)
                    {
                        Group G = new Group();

                        G.TableIndex = EGT.RetrieveInt16();
                        //#

                        G.Name      = EGT.RetrieveString();
                        G.Container = m_SymbolTable[EGT.RetrieveInt16()];
                        G.Start     = m_SymbolTable[EGT.RetrieveInt16()];
                        G.End       = m_SymbolTable[EGT.RetrieveInt16()];

                        G.Advance = (Group.AdvanceMode)EGT.RetrieveInt16();
                        G.Ending  = (Group.EndingMode)EGT.RetrieveInt16();
                        EGT.RetrieveEntry();
                        //Reserved

                        int Count = EGT.RetrieveInt16();
                        for (int n = 1; n <= Count; n++)
                        {
                            G.Nesting.Add(EGT.RetrieveInt16());
                        }

                        //=== Link back
                        m_GroupStart.Add(G.Start, G);
                        m_GroupTable[G.TableIndex] = G;
                    }
                    break;

                    case EGTRecord.CharRanges:
                        //#, Total Sets, RESERVED, (Start#, End#  ...)
                    {
                        int Index = 0;
                        int Total = 0;

                        Index = EGT.RetrieveInt16();
                        EGT.RetrieveInt16();
                        //Codepage
                        Total = EGT.RetrieveInt16();
                        EGT.RetrieveEntry();
                        //Reserved

                        m_CharSetTable[Index] = new CharacterSet();
                        while (!(EGT.RecordComplete()))
                        {
                            m_CharSetTable[Index].Add(new CharacterRange(EGT.RetrieveUInt16(), EGT.RetrieveUInt16()));
                        }
                    }
                    break;

                    case EGTRecord.Production:
                        //#, ID#, Reserved, (Symbol#,  ...)
                    {
                        short Index     = 0;
                        int   HeadIndex = 0;
                        int   SymIndex  = 0;

                        Index     = EGT.RetrieveInt16();
                        HeadIndex = EGT.RetrieveInt16();
                        EGT.RetrieveEntry();
                        //Reserved

                        List <Symbol> symbols = new List <Symbol>();
                        while (!(EGT.RecordComplete()))
                        {
                            SymIndex = EGT.RetrieveInt16();
                            //m_ProductionTable[Index].Handle().Add(m_SymbolTable[SymIndex]);
                            symbols.Add(m_SymbolTable[SymIndex]);
                        }
                        SymbolList symbolList = new SymbolList(symbols);
                        m_ProductionTable[Index] = new Production(m_SymbolTable[HeadIndex], Index, symbolList);
                    }
                    break;

                    case EGTRecord.DFAState:
                        //#, Accept?, Accept#, Reserved (CharSet#, Target#, Reserved)...
                    {
                        int   Index       = 0;
                        bool  Accept      = false;
                        int   AcceptIndex = 0;
                        int   SetIndex    = 0;
                        short Target      = 0;

                        Index       = EGT.RetrieveInt16();
                        Accept      = EGT.RetrieveBoolean();
                        AcceptIndex = EGT.RetrieveInt16();
                        EGT.RetrieveEntry();
                        //Reserved

                        if (Accept)
                        {
                            m_DFA[Index] = new FAState(m_SymbolTable[AcceptIndex]);
                        }
                        else
                        {
                            m_DFA[Index] = new FAState();
                        }

                        //(Edge chars, Target#, Reserved)...
                        while (!(EGT.RecordComplete()))
                        {
                            SetIndex = EGT.RetrieveInt16();
                            //Char table index
                            Target = EGT.RetrieveInt16();
                            //Target
                            EGT.RetrieveEntry();
                            //Reserved

                            m_DFA[Index].Edges.Add(new FAEdge(m_CharSetTable[SetIndex], Target));
                        }
                    }
                    break;

                    case EGTRecord.LRState:
                        //#, Reserved (Symbol#, Action, Target#, Reserved)...
                    {
                        int          Index    = 0;
                        int          SymIndex = 0;
                        LRActionType Action   = 0;
                        short        Target   = 0;

                        Index = EGT.RetrieveInt16();
                        EGT.RetrieveEntry();
                        //Reserved

                        m_LRStates[Index] = new LRState();

                        //(Symbol#, Action, Target#, Reserved)...
                        while (!EGT.RecordComplete())
                        {
                            SymIndex = EGT.RetrieveInt16();
                            Action   = (LRActionType)EGT.RetrieveInt16();
                            Target   = EGT.RetrieveInt16();
                            EGT.RetrieveEntry();
                            //Reserved

                            m_LRStates[Index].Add(new LRAction(m_SymbolTable[SymIndex], Action, Target));
                        }
                    }
                    break;

                    default:
                        //RecordIDComment
                        throw new ParserException("File Error. A record of type '" + (char)RecType + "' was read. This is not a valid code.");
                    }
                }
            }
            catch (Exception ex)
            {
                throw new ParserException(ex.Message, ex, "LoadTables");
            }
        }
Esempio n. 2
0
        public bool LoadTables(BinaryReader reader)
        {
            var  egt = new EGTReader();
            bool success;

            try
            {
                egt.Open(reader);

                this.Restart();
                success = true;
                while (!(egt.EndOfFile() || success == false))
                {
                    egt.GetNextRecord();

                    var recType = (EGTRecord)egt.RetrieveByte();

                    switch (recType)
                    {
                    case EGTRecord.Property:
                    {
                        // Index, Name, Value
                        var index = egt.RetrieveInt16();
                        egt.RetrieveString();

                        // Just discard
                        this.m_Grammar.SetValue(index, egt.RetrieveString());

                        break;
                    }

                    case EGTRecord.TableCounts:
                    {
                        // Symbol, CharacterSet, Rule, DFA, LALR
                        this.m_SymbolTable     = new SymbolList(egt.RetrieveInt16());
                        this.m_CharSetTable    = new CharacterSetList(egt.RetrieveInt16());
                        this.m_ProductionTable = new ProductionList(egt.RetrieveInt16());
                        this.m_DFA             = new FAStateList(egt.RetrieveInt16());
                        this.m_LRStates        = new LRStateList(egt.RetrieveInt16());
                        this.m_GroupTable      = new GroupList(egt.RetrieveInt16());

                        break;
                    }

                    case EGTRecord.InitialStates:
                    {
                        // DFA, LALR
                        this.m_DFA.InitialState      = (short)egt.RetrieveInt16();
                        this.m_LRStates.InitialState = (short)egt.RetrieveInt16();

                        break;
                    }

                    case EGTRecord.Symbol:
                    {
                        // #, Name, Kind
                        var index = (short)egt.RetrieveInt16();
                        var name  = egt.RetrieveString();
                        var type  = (SymbolType)egt.RetrieveInt16();

                        this.m_SymbolTable[index] = new Symbol(name, type, index);

                        break;
                    }

                    case EGTRecord.Group:
                    {
                        // #, Name, Container#, Start#, End#, Tokenized, Open Ended, Reserved, Count, (Nested Group #...)
                        var g = new Group();
                        int n;

                        var with1 = g;
                        var index = egt.RetrieveInt16();

                        // #
                        with1.Name      = egt.RetrieveString();
                        with1.Container = this.SymbolTable()[egt.RetrieveInt16()];
                        with1.Start     = this.SymbolTable()[egt.RetrieveInt16()];
                        with1.End       = this.SymbolTable()[egt.RetrieveInt16()];

                        with1.Advance = (Group.AdvanceMode)egt.RetrieveInt16();
                        with1.Ending  = (Group.EndingMode)egt.RetrieveInt16();
                        egt.RetrieveEntry();

                        // Reserved
                        var count = egt.RetrieveInt16();
                        for (n = 1; n <= count; n++)
                        {
                            with1.Nesting.Add(egt.RetrieveInt16());
                        }

                        // === Link back
                        g.Container.Group = g;
                        g.Start.Group     = g;
                        g.End.Group       = g;

                        this.m_GroupTable[index] = g;

                        break;
                    }

                    case EGTRecord.CharRanges:
                    {
                        // #, Total Sets, RESERVED, (Start#, End#  ...)
                        var index = egt.RetrieveInt16();
                        egt.RetrieveInt16();

                        // Codepage
                        egt.RetrieveInt16();
                        egt.RetrieveEntry();

                        // Reserved
                        this.m_CharSetTable[index] = new CharacterSet();
                        while (!egt.RecordComplete())
                        {
                            this.m_CharSetTable[index].Add(
                                new CharacterRange((ushort)egt.RetrieveInt16(), (ushort)egt.RetrieveInt16()));
                        }

                        break;
                    }

                    case EGTRecord.Production:
                    {
                        // #, ID#, Reserved, (Symbol#,  ...)
                        var index     = egt.RetrieveInt16();
                        var headIndex = egt.RetrieveInt16();
                        egt.RetrieveEntry();

                        // Reserved
                        this.m_ProductionTable[index] = new Production(this.m_SymbolTable[headIndex], (short)index);

                        while (!egt.RecordComplete())
                        {
                            var symIndex = egt.RetrieveInt16();
                            this.m_ProductionTable[index].Handle().Add(this.m_SymbolTable[symIndex]);
                        }

                        break;
                    }

                    case EGTRecord.DFAState:
                    {
                        // #, Accept?, Accept#, Reserved (CharSet#, Target#, Reserved)...
                        var index       = egt.RetrieveInt16();
                        var accept      = egt.RetrieveBoolean();
                        var acceptIndex = egt.RetrieveInt16();
                        egt.RetrieveEntry();

                        // Reserved
                        if (accept)
                        {
                            this.m_DFA[index] = new FAState(this.m_SymbolTable[acceptIndex]);
                        }
                        else
                        {
                            this.m_DFA[index] = new FAState();
                        }

                        // (Edge chars, Target#, Reserved)...
                        while (!egt.RecordComplete())
                        {
                            var setIndex = egt.RetrieveInt16();

                            // Char table index
                            var target = egt.RetrieveInt16();

                            // Target
                            egt.RetrieveEntry();

                            // Reserved
                            this.m_DFA[index].Edges.Add(new FAEdge(this.m_CharSetTable[setIndex], target));
                        }

                        break;
                    }

                    case EGTRecord.LRState:
                    {
                        // #, Reserved (Symbol#, Action, Target#, Reserved)...
                        var index = egt.RetrieveInt16();
                        egt.RetrieveEntry();

                        // Reserved
                        this.m_LRStates[index] = new LRState();

                        // (Symbol#, Action, Target#, Reserved)...
                        while (!egt.RecordComplete())
                        {
                            var symIndex = egt.RetrieveInt16();
                            var action   = egt.RetrieveInt16();
                            var target   = egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            this.m_LRStates[index].Add(
                                new LRAction(this.m_SymbolTable[symIndex], (LRActionType)action, (short)target));
                        }

                        break;
                    }

                    default:

                        // RecordIDComment
                        throw new ParserException(
                                  "File Error. A record of type '" + (char)recType
                                  + "' was read. This is not a valid code.");
                    }
                }

                egt.Close();
            }
            catch (Exception ex)
            {
                throw new ParserException(ex.Message, ex, "LoadTables");
            }

            this.m_TablesLoaded = success;

            return(success);
        }
Esempio n. 3
0
        public bool LoadTables(BinaryReader reader)
        {
            var egt = new EGTReader();
            bool success;

            try
            {
                egt.Open(reader);

                this.Restart();
                success = true;
                while (!(egt.EndOfFile() || success == false))
                {
                    egt.GetNextRecord();

                    var recType = (EGTRecord)egt.RetrieveByte();

                    switch (recType)
                    {
                        case EGTRecord.Property:
                        {
                            // Index, Name, Value
                            var index = egt.RetrieveInt16();
                            egt.RetrieveString();

                            // Just discard
                            this.m_Grammar.SetValue(index, egt.RetrieveString());

                            break;
                        }

                        case EGTRecord.TableCounts:
                        {
                            // Symbol, CharacterSet, Rule, DFA, LALR
                            this.m_SymbolTable = new SymbolList(egt.RetrieveInt16());
                            this.m_CharSetTable = new CharacterSetList(egt.RetrieveInt16());
                            this.m_ProductionTable = new ProductionList(egt.RetrieveInt16());
                            this.m_DFA = new FAStateList(egt.RetrieveInt16());
                            this.m_LRStates = new LRStateList(egt.RetrieveInt16());
                            this.m_GroupTable = new GroupList(egt.RetrieveInt16());

                            break;
                        }

                        case EGTRecord.InitialStates:
                        {
                            // DFA, LALR
                            this.m_DFA.InitialState = (short)egt.RetrieveInt16();
                            this.m_LRStates.InitialState = (short)egt.RetrieveInt16();

                            break;
                        }

                        case EGTRecord.Symbol:
                        {
                            // #, Name, Kind
                            var index = (short)egt.RetrieveInt16();
                            var name = egt.RetrieveString();
                            var type = (SymbolType)egt.RetrieveInt16();

                            this.m_SymbolTable[index] = new Symbol(name, type, index);

                            break;
                        }

                        case EGTRecord.Group:
                        {
                            // #, Name, Container#, Start#, End#, Tokenized, Open Ended, Reserved, Count, (Nested Group #...)
                            var g = new Group();
                            int n;

                            var with1 = g;
                            var index = egt.RetrieveInt16();

                            // #
                            with1.Name = egt.RetrieveString();
                            with1.Container = this.SymbolTable()[egt.RetrieveInt16()];
                            with1.Start = this.SymbolTable()[egt.RetrieveInt16()];
                            with1.End = this.SymbolTable()[egt.RetrieveInt16()];

                            with1.Advance = (Group.AdvanceMode)egt.RetrieveInt16();
                            with1.Ending = (Group.EndingMode)egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            var count = egt.RetrieveInt16();
                            for (n = 1; n <= count; n++)
                            {
                                with1.Nesting.Add(egt.RetrieveInt16());
                            }

                            // === Link back
                            g.Container.Group = g;
                            g.Start.Group = g;
                            g.End.Group = g;

                            this.m_GroupTable[index] = g;

                            break;
                        }

                        case EGTRecord.CharRanges:
                        {
                            // #, Total Sets, RESERVED, (Start#, End#  ...)
                            var index = egt.RetrieveInt16();
                            egt.RetrieveInt16();

                            // Codepage
                            egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            this.m_CharSetTable[index] = new CharacterSet();
                            while (!egt.RecordComplete())
                            {
                                this.m_CharSetTable[index].Add(
                                    new CharacterRange((ushort)egt.RetrieveInt16(), (ushort)egt.RetrieveInt16()));
                            }

                            break;
                        }

                        case EGTRecord.Production:
                        {
                            // #, ID#, Reserved, (Symbol#,  ...)
                            var index = egt.RetrieveInt16();
                            var headIndex = egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            this.m_ProductionTable[index] = new Production(this.m_SymbolTable[headIndex], (short)index);

                            while (!egt.RecordComplete())
                            {
                                var symIndex = egt.RetrieveInt16();
                                this.m_ProductionTable[index].Handle().Add(this.m_SymbolTable[symIndex]);
                            }

                            break;
                        }

                        case EGTRecord.DFAState:
                        {
                            // #, Accept?, Accept#, Reserved (CharSet#, Target#, Reserved)...
                            var index = egt.RetrieveInt16();
                            var accept = egt.RetrieveBoolean();
                            var acceptIndex = egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            if (accept)
                            {
                                this.m_DFA[index] = new FAState(this.m_SymbolTable[acceptIndex]);
                            }
                            else
                            {
                                this.m_DFA[index] = new FAState();
                            }

                            // (Edge chars, Target#, Reserved)...
                            while (!egt.RecordComplete())
                            {
                                var setIndex = egt.RetrieveInt16();

                                // Char table index
                                var target = egt.RetrieveInt16();

                                // Target
                                egt.RetrieveEntry();

                                // Reserved
                                this.m_DFA[index].Edges.Add(new FAEdge(this.m_CharSetTable[setIndex], target));
                            }

                            break;
                        }

                        case EGTRecord.LRState:
                        {
                            // #, Reserved (Symbol#, Action, Target#, Reserved)...
                            var index = egt.RetrieveInt16();
                            egt.RetrieveEntry();

                            // Reserved
                            this.m_LRStates[index] = new LRState();

                            // (Symbol#, Action, Target#, Reserved)...
                            while (!egt.RecordComplete())
                            {
                                var symIndex = egt.RetrieveInt16();
                                var action = egt.RetrieveInt16();
                                var target = egt.RetrieveInt16();
                                egt.RetrieveEntry();

                                // Reserved
                                this.m_LRStates[index].Add(
                                    new LRAction(this.m_SymbolTable[symIndex], (LRActionType)action, (short)target));
                            }

                            break;
                        }

                        default:

                            // RecordIDComment
                            throw new ParserException(
                                "File Error. A record of type '" + (char)recType
                                + "' was read. This is not a valid code.");
                    }
                }

                egt.Close();
            }
            catch (Exception ex)
            {
                throw new ParserException(ex.Message, ex, "LoadTables");
            }

            this.m_TablesLoaded = success;

            return success;
        }
Esempio n. 4
0
        internal EGT(BinaryReader Reader)
        {
            EGTReader EGT = new EGTReader(Reader);
            EGTRecord RecType = default(EGTRecord);

            try
            {
                while (!EGT.EndOfFile())
                {
                    EGT.GetNextRecord();

                    RecType = (EGTRecord)EGT.RetrieveByte();

                    switch (RecType)
                    {
                        case EGTRecord.Property:
                            {
                                //Index, Name, Value
                                int Index = 0;
                                string Name = null;

                                Index = EGT.RetrieveInt16();
                                Name = EGT.RetrieveString();
                                //Just discard
                                m_Grammar.SetValue(Index, EGT.RetrieveString());
                            }
                            break;
                        case EGTRecord.TableCounts:
                            //Symbol, CharacterSet, Rule, DFA, LALR
                            m_SymbolTable = new SymbolList(EGT.RetrieveInt16());
                            m_CharSetTable = new CharacterSetList(EGT.RetrieveInt16());
                            m_ProductionTable = new ProductionList(EGT.RetrieveInt16());
                            m_DFA = new FAStateList(EGT.RetrieveInt16());
                            m_LRStates = new LRStateList(EGT.RetrieveInt16());
                            m_GroupTable = new GroupList(EGT.RetrieveInt16());

                            break;
                        case EGTRecord.InitialStates:
                            //DFA, LALR
                            m_DFA.InitialState = EGT.RetrieveInt16();
                            m_LRStates.InitialState = EGT.RetrieveInt16();

                            break;
                        case EGTRecord.Symbol:
                            {
                                //#, Name, Kind
                                short Index = 0;
                                string Name = null;
                                SymbolType Type = default(SymbolType);

                                Index = EGT.RetrieveInt16();
                                Name = EGT.RetrieveString();
                                Type = (SymbolType)EGT.RetrieveInt16();

                                m_SymbolTable[Index] = new Symbol(Name, Type, Index);
                            }
                            break;
                        case EGTRecord.Group:
                            //#, Name, Container#, Start#, End#, Tokenized, Open Ended, Reserved, Count, (Nested Group #...)
                            {
                                Group G = new Group();

                                G.TableIndex = EGT.RetrieveInt16();
                                //#

                                G.Name = EGT.RetrieveString();
                                G.Container = m_SymbolTable[EGT.RetrieveInt16()];
                                G.Start = m_SymbolTable[EGT.RetrieveInt16()];
                                G.End = m_SymbolTable[EGT.RetrieveInt16()];

                                G.Advance = (Group.AdvanceMode)EGT.RetrieveInt16();
                                G.Ending = (Group.EndingMode)EGT.RetrieveInt16();
                                EGT.RetrieveEntry();
                                //Reserved

                                int Count = EGT.RetrieveInt16();
                                for (int n = 1; n <= Count; n++)
                                {
                                    G.Nesting.Add(EGT.RetrieveInt16());
                                }

                                //=== Link back
                                m_GroupStart.Add(G.Start, G);
                                m_GroupTable[G.TableIndex] = G;
                            }
                            break;
                        case EGTRecord.CharRanges:
                            //#, Total Sets, RESERVED, (Start#, End#  ...)
                            {
                                int Index = 0;
                                int Total = 0;

                                Index = EGT.RetrieveInt16();
                                EGT.RetrieveInt16();
                                //Codepage
                                Total = EGT.RetrieveInt16();
                                EGT.RetrieveEntry();
                                //Reserved

                                m_CharSetTable[Index] = new CharacterSet();
                                while (!(EGT.RecordComplete()))
                                {
                                    m_CharSetTable[Index].Add(new CharacterRange(EGT.RetrieveUInt16(), EGT.RetrieveUInt16()));
                                }
                            }
                            break;
                        case EGTRecord.Production:
                            //#, ID#, Reserved, (Symbol#,  ...)
                            {
                                short Index = 0;
                                int HeadIndex = 0;
                                int SymIndex = 0;

                                Index = EGT.RetrieveInt16();
                                HeadIndex = EGT.RetrieveInt16();
                                EGT.RetrieveEntry();
                                //Reserved

                                List<Symbol> symbols = new List<Symbol>();
                                while (!(EGT.RecordComplete()))
                                {
                                    SymIndex = EGT.RetrieveInt16();
                                    //m_ProductionTable[Index].Handle().Add(m_SymbolTable[SymIndex]);
                                    symbols.Add(m_SymbolTable[SymIndex]);
                                }
                                SymbolList symbolList = new SymbolList(symbols);
                                m_ProductionTable[Index] = new Production(m_SymbolTable[HeadIndex], Index, symbolList);
                            }
                            break;
                        case EGTRecord.DFAState:
                            //#, Accept?, Accept#, Reserved (CharSet#, Target#, Reserved)...
                            {
                                int Index = 0;
                                bool Accept = false;
                                int AcceptIndex = 0;
                                int SetIndex = 0;
                                short Target = 0;

                                Index = EGT.RetrieveInt16();
                                Accept = EGT.RetrieveBoolean();
                                AcceptIndex = EGT.RetrieveInt16();
                                EGT.RetrieveEntry();
                                //Reserved

                                if (Accept)
                                {
                                    m_DFA[Index] = new FAState(m_SymbolTable[AcceptIndex]);
                                }
                                else
                                {
                                    m_DFA[Index] = new FAState();
                                }

                                //(Edge chars, Target#, Reserved)...
                                while (!(EGT.RecordComplete()))
                                {
                                    SetIndex = EGT.RetrieveInt16();
                                    //Char table index
                                    Target = EGT.RetrieveInt16();
                                    //Target
                                    EGT.RetrieveEntry();
                                    //Reserved

                                    m_DFA[Index].Edges.Add(new FAEdge(m_CharSetTable[SetIndex], Target));
                                }
                            }
                            break;
                        case EGTRecord.LRState:
                            //#, Reserved (Symbol#, Action, Target#, Reserved)...
                            {
                                int Index = 0;
                                int SymIndex = 0;
                                LRActionType Action = 0;
                                short Target = 0;

                                Index = EGT.RetrieveInt16();
                                EGT.RetrieveEntry();
                                //Reserved

                                m_LRStates[Index] = new LRState();

                                //(Symbol#, Action, Target#, Reserved)...
                                while (!EGT.RecordComplete())
                                {
                                    SymIndex = EGT.RetrieveInt16();
                                    Action = (LRActionType)EGT.RetrieveInt16();
                                    Target = EGT.RetrieveInt16();
                                    EGT.RetrieveEntry();
                                    //Reserved

                                    m_LRStates[Index].Add(new LRAction(m_SymbolTable[SymIndex], Action, Target));
                                }
                            }
                            break;
                        default:
                            //RecordIDComment
                            throw new ParserException("File Error. A record of type '" + (char)RecType + "' was read. This is not a valid code.");
                    }
                }
            }
            catch (Exception ex)
            {
                throw new ParserException(ex.Message, ex, "LoadTables");
            }
        }