// Create the list of reserved words
        public static ReserveTable CreateReserveWordsTable()
        {
            ReserveTable reserveWordsTable = new ReserveTable(25);

            reserveWordsTable.Add("GOTO", 0);
            reserveWordsTable.Add("INTEGER", 1);
            reserveWordsTable.Add("TO", 2);
            reserveWordsTable.Add("DO", 3);
            reserveWordsTable.Add("IF", 4);
            reserveWordsTable.Add("THEN", 5);
            reserveWordsTable.Add("ELSE", 6);
            reserveWordsTable.Add("FOR", 7);
            reserveWordsTable.Add("OF", 8);
            reserveWordsTable.Add("WRITELN", 9);
            reserveWordsTable.Add("BEGIN", 10);
            reserveWordsTable.Add("END", 11);
            reserveWordsTable.Add("ARRAY", 12);
            reserveWordsTable.Add("VAR", 13);
            reserveWordsTable.Add("WHILE", 14);
            reserveWordsTable.Add("UNIT", 15);
            reserveWordsTable.Add("LABEL", 16);
            reserveWordsTable.Add("REPEAT", 17);
            reserveWordsTable.Add("UNTIL", 18);
            reserveWordsTable.Add("PROCEDURE", 19);
            reserveWordsTable.Add("DOWNTO", 20);
            reserveWordsTable.Add("READLN", 21);
            reserveWordsTable.Add("RETURN", 22);
            reserveWordsTable.Add("FLOAT", 23);
            reserveWordsTable.Add("STRING", 24);

            return(reserveWordsTable);
        }
        static ReserveTable BuildReserveTable(int size)
        {
            // Create a ReserveTable to store ReserveRow objects
            ReserveTable returnReserveTable = new ReserveTable(size);

            // Add each reserve row individually in the form name, code
            returnReserveTable.Add("STOP", 0);
            returnReserveTable.Add("DIV", 1);
            returnReserveTable.Add("MUL", 2);
            returnReserveTable.Add("SUB", 3);
            returnReserveTable.Add("ADD", 4);
            returnReserveTable.Add("MOV", 5);
            returnReserveTable.Add("STI", 6);
            returnReserveTable.Add("LDI", 7);
            returnReserveTable.Add("BNZ", 8);
            returnReserveTable.Add("BNP", 9);
            returnReserveTable.Add("BNN", 10);
            returnReserveTable.Add("BZ", 11);
            returnReserveTable.Add("BP", 12);
            returnReserveTable.Add("BN", 13);
            returnReserveTable.Add("BR", 14);
            returnReserveTable.Add("BINDR", 15);
            returnReserveTable.Add("PRINT", 16);

            // Return the reserve table
            return(returnReserveTable);
        }
        // Create mnemonic list
        public static ReserveTable CreateCodeTable()
        {
            ReserveTable codeTable = new ReserveTable(50);

            codeTable.Add("GOTO", 0);
            codeTable.Add("INTG", 1);
            codeTable.Add("TO__", 2);
            codeTable.Add("DO__", 3);
            codeTable.Add("IF__", 4);
            codeTable.Add("THEN", 5);
            codeTable.Add("ELSE", 6);
            codeTable.Add("FOR_", 7);
            codeTable.Add("OF__", 8);
            codeTable.Add("WRTL", 9);
            codeTable.Add("BEGN", 10);
            codeTable.Add("END_", 11);
            codeTable.Add("ARRY", 12);
            codeTable.Add("VAR_", 13);
            codeTable.Add("WHLE", 14);
            codeTable.Add("UNIT", 15);
            codeTable.Add("LABL", 16);
            codeTable.Add("REPT", 17);
            codeTable.Add("UNTL", 18);
            codeTable.Add("PCDR", 19);
            codeTable.Add("DWNT", 20);
            codeTable.Add("RDLN", 21);
            codeTable.Add("RTRN", 22);
            codeTable.Add("FLT_", 23);
            codeTable.Add("STR_", 24);
            codeTable.Add("SLSH", 30);
            codeTable.Add("STAR", 31);
            codeTable.Add("PLUS", 32);
            codeTable.Add("MINS", 33);
            codeTable.Add("LPRN", 34);
            codeTable.Add("RPRN", 35);
            codeTable.Add("SCLN", 36);
            codeTable.Add("BCMS", 37);
            codeTable.Add("GRTR", 38);
            codeTable.Add("LEST", 39);
            codeTable.Add("GRTE", 40);
            codeTable.Add("LSTE", 41);
            codeTable.Add("EQUL", 42);
            codeTable.Add("EQQL", 43);
            codeTable.Add("CMMA", 44);
            codeTable.Add("LBRK", 45);
            codeTable.Add("RBRK", 46);
            codeTable.Add("COLN", 47);
            codeTable.Add("PERD", 48);
            codeTable.Add("IDTY", 50);
            codeTable.Add("NCNI", 51);
            codeTable.Add("NCNF", 52);
            codeTable.Add("SCN_", 53);
            codeTable.Add("BAD_", 99);

            return(codeTable);
        }
 public static void InitializeStructures()
 {
     LEXDFA            = new DFA();                 // Creates DFA
     ReserveWordsTable = CreateReserveWordsTable(); // Creates reserve word table
     CodeTable         = CreateCodeTable();         // Creates mnemonic table
 }
 // Sets the QuadTable's max size and what reserve table its using
 // This does not however put 'size' many objects into the structure
 public void Initialize(int size)
 {
     _quadTable    = new List <Quad>(size);
     _reserveTable = BuildReserveTable(17);
 }