parser: use C tables in lexer
authorJean Privat <jean@pryen.org>
Mon, 24 Jan 2011 21:31:55 +0000 (16:31 -0500)
committerJean Privat <jean@pryen.org>
Mon, 24 Jan 2011 21:31:55 +0000 (16:31 -0500)
The new module parser/tables contains the tables used during the lexical
analysis.
Therefore, we do not need to have big tables in the Nit code for the lexer.

During the conversion, the handling of states (aka lexical contexts)
is removed since it is not used.

Signed-off-by: Jean Privat <jean@pryen.org>

src/parser/lexer.nit
src/parser/tables.nit [new file with mode: 0644]
src/parser/tables_nit.c [new file with mode: 0644]
src/parser/tables_nit.h [new file with mode: 0644]
src/parser/xss/lexer.xss
src/parser/xss/main.xss

index 7f40b02..e968e5d 100644 (file)
@@ -3,6 +3,7 @@
 package lexer
 
 intrude import parser_nodes
+private import tables
 
 redef class Token
     readable var _text: String
@@ -1173,6 +1174,7 @@ end
 # The lexer extract NIT tokens from an input stream.
 # It is better user with the Parser
 class Lexer
+special TablesCapable
        # Last peeked token
        var _token: nullable Token
 
@@ -1217,8 +1219,6 @@ class Lexer
                _stream = stream
                _stream_pos = -1
                _stream_buf = new Buffer
-               build_goto_table
-               build_accept_table
        end
 
        # Give the next token (but do not consume it)
@@ -1255,8 +1255,6 @@ class Lexer
                var accept_pos = -1
                var accept_line = -1
 
-               var goto_table = _goto_table[_state]
-               var accept = _accept_table[_state]
                var text = _text
                text.clear
 
@@ -1293,22 +1291,20 @@ class Lexer
 
                                        dfa_state = -1
 
-                                       var tmp0 = goto_table[old_state]
                                        var low = 0
-                                       var high = tmp0.length - 1
+                                       var high = lexer_goto(old_state, 0) - 1
 
                                        if high >= 0 then
-                                               var tmp1 = tmp0.intern_items
                                                while low <= high do
                                                        var middle = (low + high) / 2
-                                                       var tmp2 = tmp1[middle].intern_items
+                                                       var offset = middle * 3 + 1 # +1 because length is at 0
 
-                                                       if c < tmp2[0] then
+                                                       if c < lexer_goto(old_state, offset) then
                                                                high = middle - 1
-                                                       else if c > tmp2[1] then
+                                                       else if c > lexer_goto(old_state, offset+1) then
                                                                low = middle + 1
                                                        else
-                                                               dfa_state = tmp2[2]
+                                                               dfa_state = lexer_goto(old_state, offset+2)
                                                                break
                                                        end
                                                end
@@ -1324,9 +1320,10 @@ class Lexer
                        end
 
                        if dfa_state >= 0 then
-                               if accept[dfa_state] != -1 then
+                               var tok = lexer_accept(dfa_state)
+                               if tok != -1 then
                                        accept_state = dfa_state
-                                       accept_token = accept[dfa_state]
+                                       accept_token = tok
                                        accept_length = text.length
                                        accept_pos = _pos
                                        accept_line = _line
@@ -1668,1224 +1665,5 @@ class Lexer
                        i = i - 1
                end
        end
-
-       var _goto_table: Array[Array[Array[Array[Int]]]]
-       private fun build_goto_table
-       do
-               _goto_table = once [
-                       [
-                               [
-                                       [9, 9, 1],
-                                       [10, 10, 2],
-                                       [13, 13, 3],
-                                       [32, 32, 4],
-                                       [33, 33, 5],
-                                       [34, 34, 6],
-                                       [35, 35, 7],
-                                       [37, 37, 8],
-                                       [39, 39, 9],
-                                       [40, 40, 10],
-                                       [41, 41, 11],
-                                       [42, 42, 12],
-                                       [43, 43, 13],
-                                       [44, 44, 14],
-                                       [45, 45, 15],
-                                       [46, 46, 16],
-                                       [47, 47, 17],
-                                       [48, 57, 18],
-                                       [58, 58, 19],
-                                       [60, 60, 20],
-                                       [61, 61, 21],
-                                       [62, 62, 22],
-                                       [65, 90, 23],
-                                       [91, 91, 24],
-                                       [93, 93, 25],
-                                       [95, 95, 26],
-                                       [97, 97, 27],
-                                       [98, 98, 28],
-                                       [99, 99, 29],
-                                       [100, 100, 30],
-                                       [101, 101, 31],
-                                       [102, 102, 32],
-                                       [103, 104, 33],
-                                       [105, 105, 34],
-                                       [106, 107, 33],
-                                       [108, 108, 35],
-                                       [109, 109, 33],
-                                       [110, 110, 36],
-                                       [111, 111, 37],
-                                       [112, 112, 38],
-                                       [113, 113, 33],
-                                       [114, 114, 39],
-                                       [115, 115, 40],
-                                       [116, 116, 41],
-                                       [117, 117, 42],
-                                       [118, 118, 43],
-                                       [119, 119, 44],
-                                       [120, 122, 33],
-                                       [125, 125, 45]
-                               ],
-                               [
-                                       [9, 9, 1],
-                                       [32, 32, 4]
-                               ],
-                               nil_array,
-                               [
-                                       [10, 10, 46]
-                               ],
-                               [
-                                       [9, 32, -3]
-                               ],
-                               [
-                                       [61, 61, 47]
-                               ],
-                               [
-                                       [0, 9, 48],
-                                       [11, 12, 48],
-                                       [14, 33, 48],
-                                       [34, 34, 49],
-                                       [35, 91, 48],
-                                       [92, 92, 50],
-                                       [93, 122, 48],
-                                       [123, 123, 51],
-                                       [124, 255, 48]
-                               ],
-                               [
-                                       [0, 9, 52],
-                                       [10, 10, 53],
-                                       [11, 12, 52],
-                                       [13, 13, 54],
-                                       [14, 255, 52]
-                               ],
-                               nil_array,
-                               [
-                                       [0, 9, 55],
-                                       [11, 12, 55],
-                                       [14, 38, 55],
-                                       [39, 39, 56],
-                                       [40, 255, 55]
-                               ],
-                               nil_array,
-                               nil_array,
-                               nil_array,
-                               [
-                                       [61, 61, 57]
-                               ],
-                               nil_array,
-                               [
-                                       [61, 61, 58]
-                               ],
-                               [
-                                       [46, 46, 59],
-                                       [48, 57, 60]
-                               ],
-                               nil_array,
-                               [
-                                       [46, 46, 61],
-                                       [48, 57, 18]
-                               ],
-                               [
-                                       [58, 58, 62]
-                               ],
-                               [
-                                       [61, 61, 63]
-                               ],
-                               [
-                                       [61, 61, 64]
-                               ],
-                               [
-                                       [61, 61, 65]
-                               ],
-                               [
-                                       [48, 57, 66],
-                                       [65, 90, 67],
-                                       [95, 95, 68],
-                                       [97, 122, 69]
-                               ],
-                               nil_array,
-                               nil_array,
-                               [
-                                       [97, 122, 70]
-                               ],
-                               [
-                                       [48, 57, 71],
-                                       [65, 90, 72],
-                                       [95, 95, 73],
-                                       [97, 97, 74],
-                                       [98, 98, 75],
-                                       [99, 109, 74],
-                                       [110, 110, 76],
-                                       [111, 114, 74],
-                                       [115, 115, 77],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 113, 74],
-                                       [114, 114, 78],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 107, 74],
-                                       [108, 108, 79],
-                                       [109, 110, 74],
-                                       [111, 111, 80],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 110, 74],
-                                       [111, 111, 81],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 82],
-                                       [109, 109, 74],
-                                       [110, 110, 83],
-                                       [111, 119, 74],
-                                       [120, 120, 84],
-                                       [121, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 85],
-                                       [98, 110, 74],
-                                       [111, 111, 86],
-                                       [112, 116, 74],
-                                       [117, 117, 87],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 101, 74],
-                                       [102, 102, 88],
-                                       [103, 108, 74],
-                                       [109, 109, 89],
-                                       [110, 110, 90],
-                                       [111, 114, 74],
-                                       [115, 115, 91],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 92],
-                                       [98, 110, 74],
-                                       [111, 111, 93],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 100, 74],
-                                       [101, 101, 94],
-                                       [102, 110, 74],
-                                       [111, 111, 95],
-                                       [112, 116, 74],
-                                       [117, 117, 96],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 109, 74],
-                                       [110, 110, 97],
-                                       [111, 113, 74],
-                                       [114, 114, 98],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 99],
-                                       [98, 113, 74],
-                                       [114, 114, 100],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 101],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 102],
-                                       [102, 111, 74],
-                                       [112, 112, 103],
-                                       [113, 116, 74],
-                                       [117, 117, 104],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 103, 74],
-                                       [104, 104, 105],
-                                       [105, 113, 74],
-                                       [114, 114, 106],
-                                       [115, 120, 74],
-                                       [121, 121, 107],
-                                       [122, 122, 74]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 108],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 109],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 103, -43],
-                                       [104, 104, 110],
-                                       [105, 113, 74],
-                                       [114, 114, 111],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [0, 9, 112],
-                                       [11, 12, 112],
-                                       [14, 33, 112],
-                                       [34, 34, 113],
-                                       [35, 91, 112],
-                                       [92, 92, 114],
-                                       [93, 122, 112],
-                                       [123, 123, 115],
-                                       [124, 255, 112]
-                               ],
-                               nil_array,
-                               nil_array,
-                               [
-                                       [0, 255, -8]
-                               ],
-                               nil_array,
-                               [
-                                       [0, 9, 116],
-                                       [11, 12, 116],
-                                       [14, 255, 116]
-                               ],
-                               nil_array,
-                               [
-                                       [0, 255, -9]
-                               ],
-                               nil_array,
-                               [
-                                       [10, 10, 117]
-                               ],
-                               [
-                                       [0, 255, -11]
-                               ],
-                               nil_array,
-                               nil_array,
-                               nil_array,
-                               [
-                                       [46, 46, 118]
-                               ],
-                               [
-                                       [48, 57, 60]
-                               ],
-                               [
-                                       [48, 57, 60]
-                               ],
-                               nil_array,
-                               [
-                                       [62, 62, 119]
-                               ],
-                               nil_array,
-                               nil_array,
-                               [
-                                       [48, 122, -25]
-                               ],
-                               [
-                                       [48, 122, -25]
-                               ],
-                               [
-                                       [48, 122, -25]
-                               ],
-                               [
-                                       [48, 122, -25]
-                               ],
-                               [
-                                       [48, 57, 120],
-                                       [65, 90, 121],
-                                       [95, 95, 122],
-                                       [97, 122, 123]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 110, -32],
-                                       [111, 111, 124],
-                                       [112, 114, 74],
-                                       [115, 115, 125],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 99, 74],
-                                       [100, 100, 126],
-                                       [101, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 114, 74],
-                                       [115, 115, 127],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 128],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 129],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 130],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 114, -79],
-                                       [115, 115, 131],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 99, -78],
-                                       [100, 100, 132],
-                                       [101, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 115, 74],
-                                       [116, 116, 133],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 134],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 135],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 136],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 111, 74],
-                                       [112, 112, 137],
-                                       [113, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 104, 74],
-                                       [105, 105, 138],
-                                       [106, 115, 74],
-                                       [116, 116, 139],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 140],
-                                       [98, 114, 74],
-                                       [115, 115, 141],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 97, -29],
-                                       [98, 98, 142],
-                                       [99, 122, 74]
-                               ],
-                               [
-                                       [48, 110, -32],
-                                       [111, 111, 143],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 118, 74],
-                                       [119, 119, 144],
-                                       [120, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 145],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 146],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 98, 74],
-                                       [99, 99, 147],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 98, -99],
-                                       [99, 99, 148],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 149],
-                                       [106, 110, 74],
-                                       [111, 111, 150],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 151],
-                                       [98, 99, 74],
-                                       [100, 100, 152],
-                                       [101, 115, 74],
-                                       [116, 116, 153],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 154],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 155],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 111, -91],
-                                       [112, 112, 156],
-                                       [113, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 157],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 116, 74],
-                                       [117, 117, 158],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 111, -91],
-                                       [112, 112, 159],
-                                       [113, 122, 74]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 160],
-                                       [106, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 161],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 162],
-                                       [106, 122, 74]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 163],
-                                       [106, 122, 74]
-                               ],
-                               [
-                                       [0, 255, -47]
-                               ],
-                               nil_array,
-                               [
-                                       [0, 9, 164],
-                                       [11, 12, 164],
-                                       [14, 255, 164]
-                               ],
-                               nil_array,
-                               [
-                                       [0, 255, -8]
-                               ],
-                               nil_array,
-                               nil_array,
-                               nil_array,
-                               [
-                                       [48, 122, -72]
-                               ],
-                               [
-                                       [48, 122, -72]
-                               ],
-                               [
-                                       [48, 122, -72]
-                               ],
-                               [
-                                       [48, 122, -72]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 165],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 166],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 167],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 168],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 114, -79],
-                                       [115, 115, 169],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 170],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 171],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 172],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 114, -79],
-                                       [115, 115, 173],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 110, -32],
-                                       [111, 111, 174],
-                                       [112, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 175],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 176],
-                                       [102, 113, 74],
-                                       [114, 114, 177],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 178],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 179],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 111, -91],
-                                       [112, 112, 180],
-                                       [113, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 181],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 182],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 106, 74],
-                                       [107, 107, 183],
-                                       [108, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 117, 74],
-                                       [118, 118, 184],
-                                       [119, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 185],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 99, -78],
-                                       [100, 100, 186],
-                                       [101, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 187],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 116, -108],
-                                       [117, 117, 188],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 101, -36],
-                                       [102, 102, 189],
-                                       [103, 122, 74]
-                               ],
-                               [
-                                       [48, 98, -99],
-                                       [99, 99, 190],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 191],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 192],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 193],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 194],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 117, -151],
-                                       [118, 118, 195],
-                                       [119, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 196],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 197],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [0, 255, -47]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 198],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 199],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 200],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 106, -150],
-                                       [107, 107, 201],
-                                       [108, 122, 74]
-                               ],
-                               [
-                                       [48, 114, -79],
-                                       [115, 115, 202],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 203],
-                                       [106, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 204],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 205],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 206],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 207],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 116, -108],
-                                       [117, 117, 208],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 209],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 210],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 211],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 212],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 213],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 214],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 215],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 101, -36],
-                                       [102, 102, 216],
-                                       [103, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 217],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 104, -92],
-                                       [105, 105, 218],
-                                       [106, 122, 74]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 219],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 220],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 221],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 222],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 223],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 224],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 225],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 226],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 227],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 101, -36],
-                                       [102, 102, 228],
-                                       [103, 109, 74],
-                                       [110, 110, 229],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 99, -78],
-                                       [100, 100, 230],
-                                       [101, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 97, -29],
-                                       [98, 98, 231],
-                                       [99, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 102, 74],
-                                       [103, 103, 232],
-                                       [104, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 233],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 98, -99],
-                                       [99, 99, 234],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 97, -29],
-                                       [98, 98, 235],
-                                       [99, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 109, -39],
-                                       [110, 110, 236],
-                                       [111, 122, 74]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 237],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 113, -30],
-                                       [114, 114, 238],
-                                       [115, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 97, -29],
-                                       [98, 98, 239],
-                                       [99, 122, 74]
-                               ],
-                               [
-                                       [48, 98, -99],
-                                       [99, 99, 240],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 116, -108],
-                                       [117, 117, 241],
-                                       [118, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 242],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 243],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 244],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 245],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 246],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 247],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 248],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 249],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 114, -79],
-                                       [115, 115, 250],
-                                       [116, 122, 74]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 251],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 115, -86],
-                                       [116, 116, 252],
-                                       [117, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 253],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 98, -99],
-                                       [99, 99, 254],
-                                       [100, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 255],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 256],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 257],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 95, -29],
-                                       [97, 97, 258],
-                                       [98, 122, 74]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 259],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 100, -38],
-                                       [101, 101, 260],
-                                       [102, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 99, -78],
-                                       [100, 100, 261],
-                                       [101, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 107, -31],
-                                       [108, 108, 262],
-                                       [109, 122, 74]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ],
-                               [
-                                       [48, 122, -35]
-                               ]
-                       ]
-               ]
-       end
-
-       private fun nil_array: Array[Array[Int]]
-       do
-               return once new Array[Array[Int]]
-       end
-
-       var _accept_table: Array[Array[Int]]
-       private fun build_accept_table do
-               _accept_table = once [
-                       [
-                               -1,0,1,1,0,77,-1,-1,69,-1,52,53,67,65,56,66,64,68,81,57,72,59,74,78,54,55,-1,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,-1,1,71,-1,84,-1,85,-1,2,2,-1,83,60,61,63,82,-1,58,73,70,75,78,78,78,78,80,79,79,79,79,79,79,48,79,79,79,16,79,79,79,79,79,79,25,79,31,15,79,79,79,79,79,79,33,79,79,79,79,79,79,79,79,79,79,79,79,79,-1,87,-1,86,-1,2,62,76,80,80,80,80,79,79,32,79,79,79,79,79,10,79,79,30,11,79,79,79,41,79,79,79,40,34,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,19,79,79,-1,79,79,79,79,79,79,27,79,79,79,13,79,79,79,79,29,47,42,79,79,79,79,79,79,44,79,79,26,45,12,79,79,79,38,79,79,37,5,79,79,46,79,79,79,50,51,79,79,79,79,79,14,79,79,43,79,28,79,79,39,79,21,4,79,20,79,79,79,79,79,79,35,79,79,79,79,79,79,24,79,3,23,79,79,9,79,79,6,36,79,49,79,17,79,18,7,22,8
-
-                       ]
-               ]
-       end
 end
 
diff --git a/src/parser/tables.nit b/src/parser/tables.nit
new file mode 100644 (file)
index 0000000..66ab1ff
--- /dev/null
@@ -0,0 +1,26 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Module that interfaces the parsing tables.
+package tables
+
+# Interface allowing the acces of the tables used during the parsing.
+interface TablesCapable
+       # The goto value at row i, column j-1
+       # Note that the length of the row r is stored at (r, 0)
+       fun lexer_goto(i, j: Int): Int is extern "lexer_goto"
+
+       # The accept value at i
+       fun lexer_accept(i: Int): Int is extern "lexer_accept"
+end
diff --git a/src/parser/tables_nit.c b/src/parser/tables_nit.c
new file mode 100644 (file)
index 0000000..01465b8
--- /dev/null
@@ -0,0 +1,1683 @@
+/* This file was generated by SableCC (http://www.sablecc.org/). */
+#include <stdlib.h>
+#include "tables_nit.h"
+
+static const int lexer_goto_row1[] = {
+       49,
+       9, 9, 1,
+       10, 10, 2,
+       13, 13, 3,
+       32, 32, 4,
+       33, 33, 5,
+       34, 34, 6,
+       35, 35, 7,
+       37, 37, 8,
+       39, 39, 9,
+       40, 40, 10,
+       41, 41, 11,
+       42, 42, 12,
+       43, 43, 13,
+       44, 44, 14,
+       45, 45, 15,
+       46, 46, 16,
+       47, 47, 17,
+       48, 57, 18,
+       58, 58, 19,
+       60, 60, 20,
+       61, 61, 21,
+       62, 62, 22,
+       65, 90, 23,
+       91, 91, 24,
+       93, 93, 25,
+       95, 95, 26,
+       97, 97, 27,
+       98, 98, 28,
+       99, 99, 29,
+       100, 100, 30,
+       101, 101, 31,
+       102, 102, 32,
+       103, 104, 33,
+       105, 105, 34,
+       106, 107, 33,
+       108, 108, 35,
+       109, 109, 33,
+       110, 110, 36,
+       111, 111, 37,
+       112, 112, 38,
+       113, 113, 33,
+       114, 114, 39,
+       115, 115, 40,
+       116, 116, 41,
+       117, 117, 42,
+       118, 118, 43,
+       119, 119, 44,
+       120, 122, 33,
+       125, 125, 45
+};
+static const int lexer_goto_row2[] = {
+       2,
+       9, 9, 1,
+       32, 32, 4
+};
+static const int lexer_goto_row4[] = {
+       1,
+       10, 10, 46
+};
+static const int lexer_goto_row5[] = {
+       1,
+       9, 32, -3
+};
+static const int lexer_goto_row6[] = {
+       1,
+       61, 61, 47
+};
+static const int lexer_goto_row7[] = {
+       9,
+       0, 9, 48,
+       11, 12, 48,
+       14, 33, 48,
+       34, 34, 49,
+       35, 91, 48,
+       92, 92, 50,
+       93, 122, 48,
+       123, 123, 51,
+       124, 255, 48
+};
+static const int lexer_goto_row8[] = {
+       5,
+       0, 9, 52,
+       10, 10, 53,
+       11, 12, 52,
+       13, 13, 54,
+       14, 255, 52
+};
+static const int lexer_goto_row10[] = {
+       5,
+       0, 9, 55,
+       11, 12, 55,
+       14, 38, 55,
+       39, 39, 56,
+       40, 255, 55
+};
+static const int lexer_goto_row14[] = {
+       1,
+       61, 61, 57
+};
+static const int lexer_goto_row16[] = {
+       1,
+       61, 61, 58
+};
+static const int lexer_goto_row17[] = {
+       2,
+       46, 46, 59,
+       48, 57, 60
+};
+static const int lexer_goto_row19[] = {
+       2,
+       46, 46, 61,
+       48, 57, 18
+};
+static const int lexer_goto_row20[] = {
+       1,
+       58, 58, 62
+};
+static const int lexer_goto_row21[] = {
+       1,
+       61, 61, 63
+};
+static const int lexer_goto_row22[] = {
+       1,
+       61, 61, 64
+};
+static const int lexer_goto_row23[] = {
+       1,
+       61, 61, 65
+};
+static const int lexer_goto_row24[] = {
+       4,
+       48, 57, 66,
+       65, 90, 67,
+       95, 95, 68,
+       97, 122, 69
+};
+static const int lexer_goto_row27[] = {
+       1,
+       97, 122, 70
+};
+static const int lexer_goto_row28[] = {
+       10,
+       48, 57, 71,
+       65, 90, 72,
+       95, 95, 73,
+       97, 97, 74,
+       98, 98, 75,
+       99, 109, 74,
+       110, 110, 76,
+       111, 114, 74,
+       115, 115, 77,
+       116, 122, 74
+};
+static const int lexer_goto_row29[] = {
+       4,
+       48, 95, -29,
+       97, 113, 74,
+       114, 114, 78,
+       115, 122, 74
+};
+static const int lexer_goto_row30[] = {
+       6,
+       48, 95, -29,
+       97, 107, 74,
+       108, 108, 79,
+       109, 110, 74,
+       111, 111, 80,
+       112, 122, 74
+};
+static const int lexer_goto_row31[] = {
+       4,
+       48, 95, -29,
+       97, 110, 74,
+       111, 111, 81,
+       112, 122, 74
+};
+static const int lexer_goto_row32[] = {
+       7,
+       48, 107, -31,
+       108, 108, 82,
+       109, 109, 74,
+       110, 110, 83,
+       111, 119, 74,
+       120, 120, 84,
+       121, 122, 74
+};
+static const int lexer_goto_row33[] = {
+       7,
+       48, 95, -29,
+       97, 97, 85,
+       98, 110, 74,
+       111, 111, 86,
+       112, 116, 74,
+       117, 117, 87,
+       118, 122, 74
+};
+static const int lexer_goto_row34[] = {
+       2,
+       48, 95, -29,
+       97, 122, 74
+};
+static const int lexer_goto_row35[] = {
+       9,
+       48, 95, -29,
+       97, 101, 74,
+       102, 102, 88,
+       103, 108, 74,
+       109, 109, 89,
+       110, 110, 90,
+       111, 114, 74,
+       115, 115, 91,
+       116, 122, 74
+};
+static const int lexer_goto_row36[] = {
+       5,
+       48, 95, -29,
+       97, 97, 92,
+       98, 110, 74,
+       111, 111, 93,
+       112, 122, 74
+};
+static const int lexer_goto_row37[] = {
+       8,
+       48, 95, -29,
+       97, 100, 74,
+       101, 101, 94,
+       102, 110, 74,
+       111, 111, 95,
+       112, 116, 74,
+       117, 117, 96,
+       118, 122, 74
+};
+static const int lexer_goto_row38[] = {
+       6,
+       48, 95, -29,
+       97, 109, 74,
+       110, 110, 97,
+       111, 113, 74,
+       114, 114, 98,
+       115, 122, 74
+};
+static const int lexer_goto_row39[] = {
+       5,
+       48, 95, -29,
+       97, 97, 99,
+       98, 113, 74,
+       114, 114, 100,
+       115, 122, 74
+};
+static const int lexer_goto_row40[] = {
+       3,
+       48, 100, -38,
+       101, 101, 101,
+       102, 122, 74
+};
+static const int lexer_goto_row41[] = {
+       7,
+       48, 100, -38,
+       101, 101, 102,
+       102, 111, 74,
+       112, 112, 103,
+       113, 116, 74,
+       117, 117, 104,
+       118, 122, 74
+};
+static const int lexer_goto_row42[] = {
+       8,
+       48, 95, -29,
+       97, 103, 74,
+       104, 104, 105,
+       105, 113, 74,
+       114, 114, 106,
+       115, 120, 74,
+       121, 121, 107,
+       122, 122, 74
+};
+static const int lexer_goto_row43[] = {
+       3,
+       48, 109, -39,
+       110, 110, 108,
+       111, 122, 74
+};
+static const int lexer_goto_row44[] = {
+       3,
+       48, 95, -29,
+       97, 97, 109,
+       98, 122, 74
+};
+static const int lexer_goto_row45[] = {
+       5,
+       48, 103, -43,
+       104, 104, 110,
+       105, 113, 74,
+       114, 114, 111,
+       115, 122, 74
+};
+static const int lexer_goto_row46[] = {
+       9,
+       0, 9, 112,
+       11, 12, 112,
+       14, 33, 112,
+       34, 34, 113,
+       35, 91, 112,
+       92, 92, 114,
+       93, 122, 112,
+       123, 123, 115,
+       124, 255, 112
+};
+static const int lexer_goto_row49[] = {
+       1,
+       0, 255, -8
+};
+static const int lexer_goto_row51[] = {
+       3,
+       0, 9, 116,
+       11, 12, 116,
+       14, 255, 116
+};
+static const int lexer_goto_row53[] = {
+       1,
+       0, 255, -9
+};
+static const int lexer_goto_row55[] = {
+       1,
+       10, 10, 117
+};
+static const int lexer_goto_row56[] = {
+       1,
+       0, 255, -11
+};
+static const int lexer_goto_row60[] = {
+       1,
+       46, 46, 118
+};
+static const int lexer_goto_row61[] = {
+       1,
+       48, 57, 60
+};
+static const int lexer_goto_row62[] = {
+       1,
+       48, 57, 60
+};
+static const int lexer_goto_row64[] = {
+       1,
+       62, 62, 119
+};
+static const int lexer_goto_row67[] = {
+       1,
+       48, 122, -25
+};
+static const int lexer_goto_row68[] = {
+       1,
+       48, 122, -25
+};
+static const int lexer_goto_row69[] = {
+       1,
+       48, 122, -25
+};
+static const int lexer_goto_row70[] = {
+       1,
+       48, 122, -25
+};
+static const int lexer_goto_row71[] = {
+       4,
+       48, 57, 120,
+       65, 90, 121,
+       95, 95, 122,
+       97, 122, 123
+};
+static const int lexer_goto_row72[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row73[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row74[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row75[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row76[] = {
+       5,
+       48, 110, -32,
+       111, 111, 124,
+       112, 114, 74,
+       115, 115, 125,
+       116, 122, 74
+};
+static const int lexer_goto_row77[] = {
+       4,
+       48, 95, -29,
+       97, 99, 74,
+       100, 100, 126,
+       101, 122, 74
+};
+static const int lexer_goto_row78[] = {
+       4,
+       48, 95, -29,
+       97, 114, 74,
+       115, 115, 127,
+       116, 122, 74
+};
+static const int lexer_goto_row79[] = {
+       3,
+       48, 100, -38,
+       101, 101, 128,
+       102, 122, 74
+};
+static const int lexer_goto_row80[] = {
+       3,
+       48, 95, -29,
+       97, 97, 129,
+       98, 122, 74
+};
+static const int lexer_goto_row81[] = {
+       3,
+       48, 109, -39,
+       110, 110, 130,
+       111, 122, 74
+};
+static const int lexer_goto_row82[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row83[] = {
+       3,
+       48, 114, -79,
+       115, 115, 131,
+       116, 122, 74
+};
+static const int lexer_goto_row84[] = {
+       3,
+       48, 99, -78,
+       100, 100, 132,
+       101, 122, 74
+};
+static const int lexer_goto_row85[] = {
+       4,
+       48, 95, -29,
+       97, 115, 74,
+       116, 116, 133,
+       117, 122, 74
+};
+static const int lexer_goto_row86[] = {
+       3,
+       48, 107, -31,
+       108, 108, 134,
+       109, 122, 74
+};
+static const int lexer_goto_row87[] = {
+       3,
+       48, 113, -30,
+       114, 114, 135,
+       115, 122, 74
+};
+static const int lexer_goto_row88[] = {
+       3,
+       48, 109, -39,
+       110, 110, 136,
+       111, 122, 74
+};
+static const int lexer_goto_row89[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row90[] = {
+       4,
+       48, 95, -29,
+       97, 111, 74,
+       112, 112, 137,
+       113, 122, 74
+};
+static const int lexer_goto_row91[] = {
+       6,
+       48, 95, -29,
+       97, 104, 74,
+       105, 105, 138,
+       106, 115, 74,
+       116, 116, 139,
+       117, 122, 74
+};
+static const int lexer_goto_row92[] = {
+       5,
+       48, 95, -29,
+       97, 97, 140,
+       98, 114, 74,
+       115, 115, 141,
+       116, 122, 74
+};
+static const int lexer_goto_row93[] = {
+       3,
+       48, 97, -29,
+       98, 98, 142,
+       99, 122, 74
+};
+static const int lexer_goto_row94[] = {
+       3,
+       48, 110, -32,
+       111, 111, 143,
+       112, 122, 74
+};
+static const int lexer_goto_row95[] = {
+       4,
+       48, 95, -29,
+       97, 118, 74,
+       119, 119, 144,
+       120, 122, 74
+};
+static const int lexer_goto_row96[] = {
+       3,
+       48, 115, -86,
+       116, 116, 145,
+       117, 122, 74
+};
+static const int lexer_goto_row97[] = {
+       3,
+       48, 107, -31,
+       108, 108, 146,
+       109, 122, 74
+};
+static const int lexer_goto_row98[] = {
+       4,
+       48, 95, -29,
+       97, 98, 74,
+       99, 99, 147,
+       100, 122, 74
+};
+static const int lexer_goto_row99[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row100[] = {
+       3,
+       48, 98, -99,
+       99, 99, 148,
+       100, 122, 74
+};
+static const int lexer_goto_row101[] = {
+       5,
+       48, 104, -92,
+       105, 105, 149,
+       106, 110, 74,
+       111, 111, 150,
+       112, 122, 74
+};
+static const int lexer_goto_row102[] = {
+       7,
+       48, 95, -29,
+       97, 97, 151,
+       98, 99, 74,
+       100, 100, 152,
+       101, 115, 74,
+       116, 116, 153,
+       117, 122, 74
+};
+static const int lexer_goto_row103[] = {
+       3,
+       48, 107, -31,
+       108, 108, 154,
+       109, 122, 74
+};
+static const int lexer_goto_row104[] = {
+       3,
+       48, 100, -38,
+       101, 101, 155,
+       102, 122, 74
+};
+static const int lexer_goto_row105[] = {
+       3,
+       48, 111, -91,
+       112, 112, 156,
+       113, 122, 74
+};
+static const int lexer_goto_row106[] = {
+       3,
+       48, 100, -38,
+       101, 101, 157,
+       102, 122, 74
+};
+static const int lexer_goto_row107[] = {
+       4,
+       48, 95, -29,
+       97, 116, 74,
+       117, 117, 158,
+       118, 122, 74
+};
+static const int lexer_goto_row108[] = {
+       3,
+       48, 111, -91,
+       112, 112, 159,
+       113, 122, 74
+};
+static const int lexer_goto_row109[] = {
+       3,
+       48, 104, -92,
+       105, 105, 160,
+       106, 122, 74
+};
+static const int lexer_goto_row110[] = {
+       3,
+       48, 113, -30,
+       114, 114, 161,
+       115, 122, 74
+};
+static const int lexer_goto_row111[] = {
+       3,
+       48, 104, -92,
+       105, 105, 162,
+       106, 122, 74
+};
+static const int lexer_goto_row112[] = {
+       3,
+       48, 104, -92,
+       105, 105, 163,
+       106, 122, 74
+};
+static const int lexer_goto_row113[] = {
+       1,
+       0, 255, -47
+};
+static const int lexer_goto_row115[] = {
+       3,
+       0, 9, 164,
+       11, 12, 164,
+       14, 255, 164
+};
+static const int lexer_goto_row117[] = {
+       1,
+       0, 255, -8
+};
+static const int lexer_goto_row121[] = {
+       1,
+       48, 122, -72
+};
+static const int lexer_goto_row122[] = {
+       1,
+       48, 122, -72
+};
+static const int lexer_goto_row123[] = {
+       1,
+       48, 122, -72
+};
+static const int lexer_goto_row124[] = {
+       1,
+       48, 122, -72
+};
+static const int lexer_goto_row125[] = {
+       3,
+       48, 113, -30,
+       114, 114, 165,
+       115, 122, 74
+};
+static const int lexer_goto_row126[] = {
+       3,
+       48, 115, -86,
+       116, 116, 166,
+       117, 122, 74
+};
+static const int lexer_goto_row127[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row128[] = {
+       3,
+       48, 100, -38,
+       101, 101, 167,
+       102, 122, 74
+};
+static const int lexer_goto_row129[] = {
+       3,
+       48, 95, -29,
+       97, 97, 168,
+       98, 122, 74
+};
+static const int lexer_goto_row130[] = {
+       3,
+       48, 114, -79,
+       115, 115, 169,
+       116, 122, 74
+};
+static const int lexer_goto_row131[] = {
+       3,
+       48, 115, -86,
+       116, 116, 170,
+       117, 122, 74
+};
+static const int lexer_goto_row132[] = {
+       3,
+       48, 100, -38,
+       101, 101, 171,
+       102, 122, 74
+};
+static const int lexer_goto_row133[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row134[] = {
+       3,
+       48, 100, -38,
+       101, 101, 172,
+       102, 122, 74
+};
+static const int lexer_goto_row135[] = {
+       3,
+       48, 114, -79,
+       115, 115, 173,
+       116, 122, 74
+};
+static const int lexer_goto_row136[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row137[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row138[] = {
+       3,
+       48, 110, -32,
+       111, 111, 174,
+       112, 122, 74
+};
+static const int lexer_goto_row139[] = {
+       3,
+       48, 115, -86,
+       116, 116, 175,
+       117, 122, 74
+};
+static const int lexer_goto_row140[] = {
+       5,
+       48, 100, -38,
+       101, 101, 176,
+       102, 113, 74,
+       114, 114, 177,
+       115, 122, 74
+};
+static const int lexer_goto_row141[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row142[] = {
+       3,
+       48, 100, -38,
+       101, 101, 178,
+       102, 122, 74
+};
+static const int lexer_goto_row143[] = {
+       3,
+       48, 100, -38,
+       101, 101, 179,
+       102, 122, 74
+};
+static const int lexer_goto_row144[] = {
+       3,
+       48, 111, -91,
+       112, 112, 180,
+       113, 122, 74
+};
+static const int lexer_goto_row145[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row146[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row147[] = {
+       3,
+       48, 107, -31,
+       108, 108, 181,
+       109, 122, 74
+};
+static const int lexer_goto_row148[] = {
+       3,
+       48, 100, -38,
+       101, 101, 182,
+       102, 122, 74
+};
+static const int lexer_goto_row149[] = {
+       4,
+       48, 95, -29,
+       97, 106, 74,
+       107, 107, 183,
+       108, 122, 74
+};
+static const int lexer_goto_row150[] = {
+       4,
+       48, 95, -29,
+       97, 117, 74,
+       118, 118, 184,
+       119, 122, 74
+};
+static const int lexer_goto_row151[] = {
+       3,
+       48, 115, -86,
+       116, 116, 185,
+       117, 122, 74
+};
+static const int lexer_goto_row152[] = {
+       3,
+       48, 99, -78,
+       100, 100, 186,
+       101, 122, 74
+};
+static const int lexer_goto_row153[] = {
+       3,
+       48, 100, -38,
+       101, 101, 187,
+       102, 122, 74
+};
+static const int lexer_goto_row154[] = {
+       3,
+       48, 116, -108,
+       117, 117, 188,
+       118, 122, 74
+};
+static const int lexer_goto_row155[] = {
+       3,
+       48, 101, -36,
+       102, 102, 189,
+       103, 122, 74
+};
+static const int lexer_goto_row156[] = {
+       3,
+       48, 98, -99,
+       99, 99, 190,
+       100, 122, 74
+};
+static const int lexer_goto_row157[] = {
+       3,
+       48, 100, -38,
+       101, 101, 191,
+       102, 122, 74
+};
+static const int lexer_goto_row158[] = {
+       3,
+       48, 109, -39,
+       110, 110, 192,
+       111, 122, 74
+};
+static const int lexer_goto_row159[] = {
+       3,
+       48, 100, -38,
+       101, 101, 193,
+       102, 122, 74
+};
+static const int lexer_goto_row160[] = {
+       3,
+       48, 100, -38,
+       101, 101, 194,
+       102, 122, 74
+};
+static const int lexer_goto_row161[] = {
+       3,
+       48, 117, -151,
+       118, 118, 195,
+       119, 122, 74
+};
+static const int lexer_goto_row162[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row163[] = {
+       3,
+       48, 107, -31,
+       108, 108, 196,
+       109, 122, 74
+};
+static const int lexer_goto_row164[] = {
+       3,
+       48, 115, -86,
+       116, 116, 197,
+       117, 122, 74
+};
+static const int lexer_goto_row165[] = {
+       1,
+       0, 255, -47
+};
+static const int lexer_goto_row166[] = {
+       3,
+       48, 115, -86,
+       116, 116, 198,
+       117, 122, 74
+};
+static const int lexer_goto_row167[] = {
+       3,
+       48, 113, -30,
+       114, 114, 199,
+       115, 122, 74
+};
+static const int lexer_goto_row168[] = {
+       3,
+       48, 113, -30,
+       114, 114, 200,
+       115, 122, 74
+};
+static const int lexer_goto_row169[] = {
+       3,
+       48, 106, -150,
+       107, 107, 201,
+       108, 122, 74
+};
+static const int lexer_goto_row170[] = {
+       3,
+       48, 114, -79,
+       115, 115, 202,
+       116, 122, 74
+};
+static const int lexer_goto_row171[] = {
+       3,
+       48, 104, -92,
+       105, 105, 203,
+       106, 122, 74
+};
+static const int lexer_goto_row172[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row173[] = {
+       3,
+       48, 113, -30,
+       114, 114, 204,
+       115, 122, 74
+};
+static const int lexer_goto_row174[] = {
+       3,
+       48, 100, -38,
+       101, 101, 205,
+       102, 122, 74
+};
+static const int lexer_goto_row175[] = {
+       3,
+       48, 113, -30,
+       114, 114, 206,
+       115, 122, 74
+};
+static const int lexer_goto_row176[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row177[] = {
+       3,
+       48, 113, -30,
+       114, 114, 207,
+       115, 122, 74
+};
+static const int lexer_goto_row178[] = {
+       3,
+       48, 116, -108,
+       117, 117, 208,
+       118, 122, 74
+};
+static const int lexer_goto_row179[] = {
+       3,
+       48, 115, -86,
+       116, 116, 209,
+       117, 122, 74
+};
+static const int lexer_goto_row180[] = {
+       3,
+       48, 107, -31,
+       108, 108, 210,
+       109, 122, 74
+};
+static const int lexer_goto_row181[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row182[] = {
+       3,
+       48, 95, -29,
+       97, 97, 211,
+       98, 122, 74
+};
+static const int lexer_goto_row183[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row184[] = {
+       3,
+       48, 95, -29,
+       97, 97, 212,
+       98, 122, 74
+};
+static const int lexer_goto_row185[] = {
+       3,
+       48, 95, -29,
+       97, 97, 213,
+       98, 122, 74
+};
+static const int lexer_goto_row186[] = {
+       3,
+       48, 100, -38,
+       101, 101, 214,
+       102, 122, 74
+};
+static const int lexer_goto_row187[] = {
+       3,
+       48, 95, -29,
+       97, 97, 215,
+       98, 122, 74
+};
+static const int lexer_goto_row188[] = {
+       3,
+       48, 101, -36,
+       102, 102, 216,
+       103, 122, 74
+};
+static const int lexer_goto_row189[] = {
+       3,
+       48, 113, -30,
+       114, 114, 217,
+       115, 122, 74
+};
+static const int lexer_goto_row190[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row191[] = {
+       3,
+       48, 104, -92,
+       105, 105, 218,
+       106, 122, 74
+};
+static const int lexer_goto_row192[] = {
+       3,
+       48, 113, -30,
+       114, 114, 219,
+       115, 122, 74
+};
+static const int lexer_goto_row193[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row194[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row195[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row196[] = {
+       3,
+       48, 100, -38,
+       101, 101, 220,
+       102, 122, 74
+};
+static const int lexer_goto_row197[] = {
+       3,
+       48, 100, -38,
+       101, 101, 221,
+       102, 122, 74
+};
+static const int lexer_goto_row198[] = {
+       3,
+       48, 95, -29,
+       97, 97, 222,
+       98, 122, 74
+};
+static const int lexer_goto_row199[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row200[] = {
+       3,
+       48, 95, -29,
+       97, 97, 223,
+       98, 122, 74
+};
+static const int lexer_goto_row201[] = {
+       3,
+       48, 115, -86,
+       116, 116, 224,
+       117, 122, 74
+};
+static const int lexer_goto_row202[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row203[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row204[] = {
+       3,
+       48, 109, -39,
+       110, 110, 225,
+       111, 122, 74
+};
+static const int lexer_goto_row205[] = {
+       3,
+       48, 109, -39,
+       110, 110, 226,
+       111, 122, 74
+};
+static const int lexer_goto_row206[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row207[] = {
+       3,
+       48, 115, -86,
+       116, 116, 227,
+       117, 122, 74
+};
+static const int lexer_goto_row208[] = {
+       5,
+       48, 101, -36,
+       102, 102, 228,
+       103, 109, 74,
+       110, 110, 229,
+       111, 122, 74
+};
+static const int lexer_goto_row209[] = {
+       3,
+       48, 99, -78,
+       100, 100, 230,
+       101, 122, 74
+};
+static const int lexer_goto_row210[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row211[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row212[] = {
+       3,
+       48, 97, -29,
+       98, 98, 231,
+       99, 122, 74
+};
+static const int lexer_goto_row213[] = {
+       4,
+       48, 95, -29,
+       97, 102, 74,
+       103, 103, 232,
+       104, 122, 74
+};
+static const int lexer_goto_row214[] = {
+       3,
+       48, 115, -86,
+       116, 116, 233,
+       117, 122, 74
+};
+static const int lexer_goto_row215[] = {
+       3,
+       48, 98, -99,
+       99, 99, 234,
+       100, 122, 74
+};
+static const int lexer_goto_row216[] = {
+       3,
+       48, 97, -29,
+       98, 98, 235,
+       99, 122, 74
+};
+static const int lexer_goto_row217[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row218[] = {
+       3,
+       48, 109, -39,
+       110, 110, 236,
+       111, 122, 74
+};
+static const int lexer_goto_row219[] = {
+       3,
+       48, 95, -29,
+       97, 97, 237,
+       98, 122, 74
+};
+static const int lexer_goto_row220[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row221[] = {
+       3,
+       48, 113, -30,
+       114, 114, 238,
+       115, 122, 74
+};
+static const int lexer_goto_row222[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row223[] = {
+       3,
+       48, 97, -29,
+       98, 98, 239,
+       99, 122, 74
+};
+static const int lexer_goto_row224[] = {
+       3,
+       48, 98, -99,
+       99, 99, 240,
+       100, 122, 74
+};
+static const int lexer_goto_row225[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row226[] = {
+       3,
+       48, 116, -108,
+       117, 117, 241,
+       118, 122, 74
+};
+static const int lexer_goto_row227[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row228[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row229[] = {
+       3,
+       48, 95, -29,
+       97, 97, 242,
+       98, 122, 74
+};
+static const int lexer_goto_row230[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row231[] = {
+       3,
+       48, 100, -38,
+       101, 101, 243,
+       102, 122, 74
+};
+static const int lexer_goto_row232[] = {
+       3,
+       48, 107, -31,
+       108, 108, 244,
+       109, 122, 74
+};
+static const int lexer_goto_row233[] = {
+       3,
+       48, 100, -38,
+       101, 101, 245,
+       102, 122, 74
+};
+static const int lexer_goto_row234[] = {
+       3,
+       48, 100, -38,
+       101, 101, 246,
+       102, 122, 74
+};
+static const int lexer_goto_row235[] = {
+       3,
+       48, 115, -86,
+       116, 116, 247,
+       117, 122, 74
+};
+static const int lexer_goto_row236[] = {
+       3,
+       48, 107, -31,
+       108, 108, 248,
+       109, 122, 74
+};
+static const int lexer_goto_row237[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row238[] = {
+       3,
+       48, 107, -31,
+       108, 108, 249,
+       109, 122, 74
+};
+static const int lexer_goto_row239[] = {
+       3,
+       48, 114, -79,
+       115, 115, 250,
+       116, 122, 74
+};
+static const int lexer_goto_row240[] = {
+       3,
+       48, 107, -31,
+       108, 108, 251,
+       109, 122, 74
+};
+static const int lexer_goto_row241[] = {
+       3,
+       48, 115, -86,
+       116, 116, 252,
+       117, 122, 74
+};
+static const int lexer_goto_row242[] = {
+       3,
+       48, 100, -38,
+       101, 101, 253,
+       102, 122, 74
+};
+static const int lexer_goto_row243[] = {
+       3,
+       48, 98, -99,
+       99, 99, 254,
+       100, 122, 74
+};
+static const int lexer_goto_row244[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row245[] = {
+       3,
+       48, 100, -38,
+       101, 101, 255,
+       102, 122, 74
+};
+static const int lexer_goto_row246[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row247[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row248[] = {
+       3,
+       48, 100, -38,
+       101, 101, 256,
+       102, 122, 74
+};
+static const int lexer_goto_row249[] = {
+       3,
+       48, 100, -38,
+       101, 101, 257,
+       102, 122, 74
+};
+static const int lexer_goto_row250[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row251[] = {
+       3,
+       48, 95, -29,
+       97, 97, 258,
+       98, 122, 74
+};
+static const int lexer_goto_row252[] = {
+       3,
+       48, 100, -38,
+       101, 101, 259,
+       102, 122, 74
+};
+static const int lexer_goto_row253[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row254[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row255[] = {
+       3,
+       48, 100, -38,
+       101, 101, 260,
+       102, 122, 74
+};
+static const int lexer_goto_row256[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row257[] = {
+       3,
+       48, 99, -78,
+       100, 100, 261,
+       101, 122, 74
+};
+static const int lexer_goto_row258[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row259[] = {
+       3,
+       48, 107, -31,
+       108, 108, 262,
+       109, 122, 74
+};
+static const int lexer_goto_row260[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row261[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row262[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row263[] = {
+       1,
+       48, 122, -35
+};
+static const int lexer_goto_row_null[] = {0};
+const int* const lexer_goto_table[] = {
+       lexer_goto_row1,
+       lexer_goto_row2,
+       lexer_goto_row_null,
+       lexer_goto_row4,
+       lexer_goto_row5,
+       lexer_goto_row6,
+       lexer_goto_row7,
+       lexer_goto_row8,
+       lexer_goto_row_null,
+       lexer_goto_row10,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row14,
+       lexer_goto_row_null,
+       lexer_goto_row16,
+       lexer_goto_row17,
+       lexer_goto_row_null,
+       lexer_goto_row19,
+       lexer_goto_row20,
+       lexer_goto_row21,
+       lexer_goto_row22,
+       lexer_goto_row23,
+       lexer_goto_row24,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row27,
+       lexer_goto_row28,
+       lexer_goto_row29,
+       lexer_goto_row30,
+       lexer_goto_row31,
+       lexer_goto_row32,
+       lexer_goto_row33,
+       lexer_goto_row34,
+       lexer_goto_row35,
+       lexer_goto_row36,
+       lexer_goto_row37,
+       lexer_goto_row38,
+       lexer_goto_row39,
+       lexer_goto_row40,
+       lexer_goto_row41,
+       lexer_goto_row42,
+       lexer_goto_row43,
+       lexer_goto_row44,
+       lexer_goto_row45,
+       lexer_goto_row46,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row49,
+       lexer_goto_row_null,
+       lexer_goto_row51,
+       lexer_goto_row_null,
+       lexer_goto_row53,
+       lexer_goto_row_null,
+       lexer_goto_row55,
+       lexer_goto_row56,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row60,
+       lexer_goto_row61,
+       lexer_goto_row62,
+       lexer_goto_row_null,
+       lexer_goto_row64,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row67,
+       lexer_goto_row68,
+       lexer_goto_row69,
+       lexer_goto_row70,
+       lexer_goto_row71,
+       lexer_goto_row72,
+       lexer_goto_row73,
+       lexer_goto_row74,
+       lexer_goto_row75,
+       lexer_goto_row76,
+       lexer_goto_row77,
+       lexer_goto_row78,
+       lexer_goto_row79,
+       lexer_goto_row80,
+       lexer_goto_row81,
+       lexer_goto_row82,
+       lexer_goto_row83,
+       lexer_goto_row84,
+       lexer_goto_row85,
+       lexer_goto_row86,
+       lexer_goto_row87,
+       lexer_goto_row88,
+       lexer_goto_row89,
+       lexer_goto_row90,
+       lexer_goto_row91,
+       lexer_goto_row92,
+       lexer_goto_row93,
+       lexer_goto_row94,
+       lexer_goto_row95,
+       lexer_goto_row96,
+       lexer_goto_row97,
+       lexer_goto_row98,
+       lexer_goto_row99,
+       lexer_goto_row100,
+       lexer_goto_row101,
+       lexer_goto_row102,
+       lexer_goto_row103,
+       lexer_goto_row104,
+       lexer_goto_row105,
+       lexer_goto_row106,
+       lexer_goto_row107,
+       lexer_goto_row108,
+       lexer_goto_row109,
+       lexer_goto_row110,
+       lexer_goto_row111,
+       lexer_goto_row112,
+       lexer_goto_row113,
+       lexer_goto_row_null,
+       lexer_goto_row115,
+       lexer_goto_row_null,
+       lexer_goto_row117,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row_null,
+       lexer_goto_row121,
+       lexer_goto_row122,
+       lexer_goto_row123,
+       lexer_goto_row124,
+       lexer_goto_row125,
+       lexer_goto_row126,
+       lexer_goto_row127,
+       lexer_goto_row128,
+       lexer_goto_row129,
+       lexer_goto_row130,
+       lexer_goto_row131,
+       lexer_goto_row132,
+       lexer_goto_row133,
+       lexer_goto_row134,
+       lexer_goto_row135,
+       lexer_goto_row136,
+       lexer_goto_row137,
+       lexer_goto_row138,
+       lexer_goto_row139,
+       lexer_goto_row140,
+       lexer_goto_row141,
+       lexer_goto_row142,
+       lexer_goto_row143,
+       lexer_goto_row144,
+       lexer_goto_row145,
+       lexer_goto_row146,
+       lexer_goto_row147,
+       lexer_goto_row148,
+       lexer_goto_row149,
+       lexer_goto_row150,
+       lexer_goto_row151,
+       lexer_goto_row152,
+       lexer_goto_row153,
+       lexer_goto_row154,
+       lexer_goto_row155,
+       lexer_goto_row156,
+       lexer_goto_row157,
+       lexer_goto_row158,
+       lexer_goto_row159,
+       lexer_goto_row160,
+       lexer_goto_row161,
+       lexer_goto_row162,
+       lexer_goto_row163,
+       lexer_goto_row164,
+       lexer_goto_row165,
+       lexer_goto_row166,
+       lexer_goto_row167,
+       lexer_goto_row168,
+       lexer_goto_row169,
+       lexer_goto_row170,
+       lexer_goto_row171,
+       lexer_goto_row172,
+       lexer_goto_row173,
+       lexer_goto_row174,
+       lexer_goto_row175,
+       lexer_goto_row176,
+       lexer_goto_row177,
+       lexer_goto_row178,
+       lexer_goto_row179,
+       lexer_goto_row180,
+       lexer_goto_row181,
+       lexer_goto_row182,
+       lexer_goto_row183,
+       lexer_goto_row184,
+       lexer_goto_row185,
+       lexer_goto_row186,
+       lexer_goto_row187,
+       lexer_goto_row188,
+       lexer_goto_row189,
+       lexer_goto_row190,
+       lexer_goto_row191,
+       lexer_goto_row192,
+       lexer_goto_row193,
+       lexer_goto_row194,
+       lexer_goto_row195,
+       lexer_goto_row196,
+       lexer_goto_row197,
+       lexer_goto_row198,
+       lexer_goto_row199,
+       lexer_goto_row200,
+       lexer_goto_row201,
+       lexer_goto_row202,
+       lexer_goto_row203,
+       lexer_goto_row204,
+       lexer_goto_row205,
+       lexer_goto_row206,
+       lexer_goto_row207,
+       lexer_goto_row208,
+       lexer_goto_row209,
+       lexer_goto_row210,
+       lexer_goto_row211,
+       lexer_goto_row212,
+       lexer_goto_row213,
+       lexer_goto_row214,
+       lexer_goto_row215,
+       lexer_goto_row216,
+       lexer_goto_row217,
+       lexer_goto_row218,
+       lexer_goto_row219,
+       lexer_goto_row220,
+       lexer_goto_row221,
+       lexer_goto_row222,
+       lexer_goto_row223,
+       lexer_goto_row224,
+       lexer_goto_row225,
+       lexer_goto_row226,
+       lexer_goto_row227,
+       lexer_goto_row228,
+       lexer_goto_row229,
+       lexer_goto_row230,
+       lexer_goto_row231,
+       lexer_goto_row232,
+       lexer_goto_row233,
+       lexer_goto_row234,
+       lexer_goto_row235,
+       lexer_goto_row236,
+       lexer_goto_row237,
+       lexer_goto_row238,
+       lexer_goto_row239,
+       lexer_goto_row240,
+       lexer_goto_row241,
+       lexer_goto_row242,
+       lexer_goto_row243,
+       lexer_goto_row244,
+       lexer_goto_row245,
+       lexer_goto_row246,
+       lexer_goto_row247,
+       lexer_goto_row248,
+       lexer_goto_row249,
+       lexer_goto_row250,
+       lexer_goto_row251,
+       lexer_goto_row252,
+       lexer_goto_row253,
+       lexer_goto_row254,
+       lexer_goto_row255,
+       lexer_goto_row256,
+       lexer_goto_row257,
+       lexer_goto_row258,
+       lexer_goto_row259,
+       lexer_goto_row260,
+       lexer_goto_row261,
+       lexer_goto_row262,
+       lexer_goto_row263
+};
+
+const int lexer_accept_table[] = {
+       -1,0,1,1,0,77,-1,-1,69,-1,52,53,67,65,56,66,64,68,81,57,72,59,74,78,54,55,-1,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,-1,1,71,-1,84,-1,85,-1,2,2,-1,83,60,61,63,82,-1,58,73,70,75,78,78,78,78,80,79,79,79,79,79,79,48,79,79,79,16,79,79,79,79,79,79,25,79,31,15,79,79,79,79,79,79,33,79,79,79,79,79,79,79,79,79,79,79,79,79,-1,87,-1,86,-1,2,62,76,80,80,80,80,79,79,32,79,79,79,79,79,10,79,79,30,11,79,79,79,41,79,79,79,40,34,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,19,79,79,-1,79,79,79,79,79,79,27,79,79,79,13,79,79,79,79,29,47,42,79,79,79,79,79,79,44,79,79,26,45,12,79,79,79,38,79,79,37,5,79,79,46,79,79,79,50,51,79,79,79,79,79,14,79,79,43,79,28,79,79,39,79,21,4,79,20,79,79,79,79,79,79,35,79,79,79,79,79,79,24,79,3,23,79,79,9,79,79,6,36,79,49,79,17,79,18,7,22,8
+};
+
diff --git a/src/parser/tables_nit.h b/src/parser/tables_nit.h
new file mode 100644 (file)
index 0000000..9c53c3e
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef TABLE_NIT_H
+#define TABLE_NIT_H
+/* This file is part of NIT ( http://www.nitlanguage.org ).
+ *
+ * This file is free software, which comes along with NIT.  This software is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
+ * PARTICULAR PURPOSE.  You can modify it is you want,  provided this header
+ * is kept unaltered, and a notification of the changes is added.
+ * You  are  allowed  to  redistribute it and sell it, alone or is a part of
+ * another product.
+ */
+
+extern const int* const lexer_goto_table[];
+extern const int lexer_accept_table[];
+
+#define lexer_goto(o,i,j) (lexer_goto_table[(i)][(j)])
+#define lexer_accept(o,i) (lexer_accept_table[(i)])
+
+#endif
index f8e98ea..a8fa706 100644 (file)
@@ -20,6 +20,7 @@ $ template make_lexer()
 # The lexer extract NIT tokens from an input stream.
 # It is better user with the Parser
 class Lexer
+special TablesCapable
        # Last peeked token
        var _token: nullable Token
 
@@ -66,8 +67,6 @@ $ end foreach
                _stream = stream
                _stream_pos = -1
                _stream_buf = new Buffer
-               build_goto_table
-               build_accept_table
        end
 
        # Give the next token (but do not consume it)
@@ -104,8 +103,6 @@ $ end foreach
                var accept_pos = -1
                var accept_line = -1
 
-               var goto_table = _goto_table[_state]
-               var accept = _accept_table[_state]
                var text = _text
                text.clear
 
@@ -142,22 +139,20 @@ $ end foreach
 
                                        dfa_state = -1
 
-                                       var tmp0 = goto_table[old_state]
                                        var low = 0
-                                       var high = tmp0.length - 1
+                                       var high = lexer_goto(old_state, 0) - 1
 
                                        if high >= 0 then
-                                               var tmp1 = tmp0.intern_items
                                                while low <= high do
                                                        var middle = (low + high) / 2
-                                                       var tmp2 = tmp1[middle].intern_items
+                                                       var offset = middle * 3 + 1 # +1 because length is at 0
 
-                                                       if c < tmp2[0] then
+                                                       if c < lexer_goto(old_state, offset) then
                                                                high = middle - 1
-                                                       else if c > tmp2[1] then
+                                                       else if c > lexer_goto(old_state, offset+1) then
                                                                low = middle + 1
                                                        else
-                                                               dfa_state = tmp2[2]
+                                                               dfa_state = lexer_goto(old_state, offset+2)
                                                                break
                                                        end
                                                end
@@ -173,9 +168,10 @@ $ end foreach
                        end
 
                        if dfa_state >= 0 then
-                               if accept[dfa_state] != -1 then
+                               var tok = lexer_accept(dfa_state)
+                               if tok != -1 then
                                        accept_state = dfa_state
-                                       accept_token = accept[dfa_state]
+                                       accept_token = tok
                                        accept_length = text.length
                                        accept_pos = _pos
                                        accept_line = _line
@@ -263,45 +259,40 @@ $ end foreach
                        i = i - 1
                end
        end
+end
 
-       var _goto_table: Array[Array[Array[Array[Int]]]]
-       private fun build_goto_table
-       do
-               _goto_table = once [
+$ end template
+
+
+
+$ template make_lexer_table()
 $ foreach {lexer_data/goto_table/state}
-                       [
 $     foreach {row}
 $         if {count(goto)!=0}
-                               [
+static const int lexer_goto_row${position()}[] = {
+       ${count(goto)},
 $             foreach {goto}
-                                       [@low, @high, @state][-sep ','-]
+       @low, @high, @state[-sep ','-]
 $             end foreach
-                               ][-sep ','-]
+};
+$         end
+$     end foreach
+static const int lexer_goto_row_null[] = {0};
+const int* const lexer_goto_table[] = {
+$     foreach {row}
+$         if {count(goto)!=0}
+       lexer_goto_row${position()}[-sep ','-]
 $         else
-                               nil_array[-sep ','-]
+       lexer_goto_row_null[-sep ','-]
 $         end
 $     end foreach
-                       ][-sep ','-]
+};
 $ end foreach
-               ]
-       end
-
-       private fun nil_array: Array[Array[Int]]
-       do
-               return once new Array[Array[Int]]
-       end
 
-       var _accept_table: Array[Array[Int]]
-       private fun build_accept_table do
-               _accept_table = once [
 $ foreach {lexer_data/accept_table/state}
-                       [
-                               [-foreach {i}-]${.}[-sep ','-][-end foreach-]
-
-                       ][-sep ','-]
+const int lexer_accept_table[] = {
+       [-foreach {i}-]${.}[-sep ','-][-end foreach-]
+};
 $ end foreach
-               ]
-       end
-end
 
 $ end template
index 002a71b..2dc30b0 100644 (file)
@@ -43,6 +43,7 @@ intrude import $usermodule
 $ else
 intrude import parser_abs
 $ end
+private import tables
 $ call make_tokens()
 $ call make_lexer()
 $ end output
@@ -81,3 +82,10 @@ intrude import parser_tables
 $ call make_parser()
 $ end output
 
+$ output 'tables_nit.c'
+/* This file was generated by SableCC (http://www.sablecc.org/). */
+#include <stdlib.h>
+#include "tables_nit.h"
+
+$ call make_lexer_table()
+$ end output