From e64a08e10a43af583b2b54538a01baa6f4aa8eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20So=C5=82tysik?= Date: Thu, 30 Jan 2020 19:26:52 +0100 Subject: [PATCH] Code cleanup --- src/Pyxell.g4 | 2 +- src/antlr/Pyxell.interp | 2 +- src/antlr/PyxellParser.py | 192 ++++++++++++++++++------------------ src/ast.py | 16 +-- src/compiler.py | 46 ++++----- test/bad/modules/attr02.err | 1 + test/bad/modules/attr02.px | 2 + 7 files changed, 132 insertions(+), 129 deletions(-) create mode 100644 test/bad/modules/attr02.err create mode 100644 test/bad/modules/attr02.px diff --git a/src/Pyxell.g4 b/src/Pyxell.g4 index bf2d3042..be046727 100644 --- a/src/Pyxell.g4 +++ b/src/Pyxell.g4 @@ -53,9 +53,9 @@ expr | '[' (expr ',')* expr? ']' # ExprArray | '[' expr 'step' expr ']' # ExprArrayRangeStep | '[' expr comprehension+ ']' # ExprArrayComprehension + | expr safe='?'? '.' ID # ExprAttr | expr safe='?'? '[' tuple_expr ']' # ExprIndex | expr '[' e1=expr? (':' e2=expr? (':' e3=expr?)?) ']' # ExprSlice - | expr safe='?'? '.' ID # ExprAttr | expr '(' (call_arg ',')* call_arg? ')' # ExprCall | expr op='!' # ExprUnaryOp | expr op=('^' | '^^') expr # ExprBinaryOp diff --git a/src/antlr/Pyxell.interp b/src/antlr/Pyxell.interp index 2dac671e..88eafd41 100644 --- a/src/antlr/Pyxell.interp +++ b/src/antlr/Pyxell.interp @@ -188,4 +188,4 @@ typ atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 84, 457, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 3, 2, 7, 2, 36, 10, 2, 12, 2, 14, 2, 39, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 47, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 57, 10, 4, 3, 4, 3, 4, 3, 4, 5, 4, 62, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 68, 10, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 87, 10, 4, 5, 4, 89, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 100, 10, 5, 12, 5, 14, 5, 103, 11, 5, 3, 5, 3, 5, 3, 5, 5, 5, 108, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 126, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 137, 10, 5, 3, 5, 3, 5, 5, 5, 141, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 147, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 155, 10, 5, 3, 5, 3, 5, 3, 5, 6, 5, 160, 10, 5, 13, 5, 14, 5, 161, 3, 5, 3, 5, 5, 5, 166, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 172, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 178, 10, 7, 12, 7, 14, 7, 181, 11, 7, 3, 7, 5, 7, 184, 10, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 192, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 200, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 206, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 214, 10, 8, 5, 8, 216, 10, 8, 3, 9, 3, 9, 6, 9, 220, 10, 9, 13, 9, 14, 9, 221, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 236, 10, 10, 12, 10, 14, 10, 239, 11, 10, 3, 10, 5, 10, 242, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 6, 10, 254, 10, 10, 13, 10, 14, 10, 255, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 267, 10, 10, 12, 10, 14, 10, 270, 11, 10, 3, 10, 5, 10, 273, 10, 10, 3, 10, 3, 10, 5, 10, 277, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 329, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 338, 10, 10, 3, 10, 3, 10, 5, 10, 342, 10, 10, 3, 10, 3, 10, 5, 10, 346, 10, 10, 5, 10, 348, 10, 10, 3, 10, 3, 10, 3, 10, 5, 10, 353, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 362, 10, 10, 12, 10, 14, 10, 365, 11, 10, 3, 10, 5, 10, 368, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 375, 10, 10, 12, 10, 14, 10, 378, 11, 10, 3, 11, 3, 11, 3, 11, 7, 11, 383, 10, 11, 12, 11, 14, 11, 386, 11, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 399, 10, 13, 3, 13, 3, 13, 5, 13, 403, 10, 13, 3, 14, 3, 14, 5, 14, 407, 10, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 5, 15, 419, 10, 15, 3, 16, 3, 16, 7, 16, 423, 10, 16, 12, 16, 14, 16, 426, 11, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 442, 10, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 452, 10, 17, 12, 17, 14, 17, 455, 11, 17, 3, 17, 2, 4, 18, 32, 18, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 2, 14, 3, 2, 11, 24, 3, 2, 25, 26, 4, 2, 17, 18, 56, 56, 3, 2, 11, 12, 3, 2, 13, 16, 3, 2, 17, 18, 3, 2, 19, 20, 3, 2, 57, 58, 3, 2, 60, 61, 4, 2, 38, 39, 62, 65, 3, 2, 75, 78, 3, 2, 70, 71, 2, 538, 2, 37, 3, 2, 2, 2, 4, 46, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 165, 3, 2, 2, 2, 10, 167, 3, 2, 2, 2, 12, 173, 3, 2, 2, 2, 14, 215, 3, 2, 2, 2, 16, 217, 3, 2, 2, 2, 18, 276, 3, 2, 2, 2, 20, 384, 3, 2, 2, 2, 22, 389, 3, 2, 2, 2, 24, 402, 3, 2, 2, 2, 26, 406, 3, 2, 2, 2, 28, 418, 3, 2, 2, 2, 30, 424, 3, 2, 2, 2, 32, 441, 3, 2, 2, 2, 34, 36, 5, 4, 3, 2, 35, 34, 3, 2, 2, 2, 36, 39, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 40, 3, 2, 2, 2, 39, 37, 3, 2, 2, 2, 40, 41, 7, 2, 2, 3, 41, 3, 3, 2, 2, 2, 42, 43, 5, 6, 4, 2, 43, 44, 7, 3, 2, 2, 44, 47, 3, 2, 2, 2, 45, 47, 5, 8, 5, 2, 46, 42, 3, 2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 5, 3, 2, 2, 2, 48, 49, 7, 4, 2, 2, 49, 56, 7, 82, 2, 2, 50, 51, 7, 5, 2, 2, 51, 57, 5, 30, 16, 2, 52, 53, 7, 6, 2, 2, 53, 57, 5, 30, 16, 2, 54, 55, 7, 7, 2, 2, 55, 57, 7, 82, 2, 2, 56, 50, 3, 2, 2, 2, 56, 52, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 89, 3, 2, 2, 2, 58, 89, 7, 8, 2, 2, 59, 61, 7, 9, 2, 2, 60, 62, 5, 20, 11, 2, 61, 60, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 89, 3, 2, 2, 2, 63, 64, 5, 32, 17, 2, 64, 67, 7, 82, 2, 2, 65, 66, 7, 10, 2, 2, 66, 68, 5, 20, 11, 2, 67, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 89, 3, 2, 2, 2, 69, 70, 5, 20, 11, 2, 70, 71, 7, 10, 2, 2, 71, 73, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 77, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 89, 5, 20, 11, 2, 78, 79, 5, 18, 10, 2, 79, 80, 9, 2, 2, 2, 80, 81, 7, 10, 2, 2, 81, 82, 5, 18, 10, 2, 82, 89, 3, 2, 2, 2, 83, 89, 9, 3, 2, 2, 84, 86, 7, 27, 2, 2, 85, 87, 5, 20, 11, 2, 86, 85, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 89, 3, 2, 2, 2, 88, 48, 3, 2, 2, 2, 88, 58, 3, 2, 2, 2, 88, 59, 3, 2, 2, 2, 88, 63, 3, 2, 2, 2, 88, 74, 3, 2, 2, 2, 88, 78, 3, 2, 2, 2, 88, 83, 3, 2, 2, 2, 88, 84, 3, 2, 2, 2, 89, 7, 3, 2, 2, 2, 90, 91, 7, 28, 2, 2, 91, 92, 5, 18, 10, 2, 92, 93, 7, 29, 2, 2, 93, 101, 5, 16, 9, 2, 94, 95, 7, 30, 2, 2, 95, 96, 5, 18, 10, 2, 96, 97, 7, 29, 2, 2, 97, 98, 5, 16, 9, 2, 98, 100, 3, 2, 2, 2, 99, 94, 3, 2, 2, 2, 100, 103, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 101, 102, 3, 2, 2, 2, 102, 107, 3, 2, 2, 2, 103, 101, 3, 2, 2, 2, 104, 105, 7, 31, 2, 2, 105, 106, 7, 29, 2, 2, 106, 108, 5, 16, 9, 2, 107, 104, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 166, 3, 2, 2, 2, 109, 110, 7, 32, 2, 2, 110, 111, 5, 18, 10, 2, 111, 112, 7, 29, 2, 2, 112, 113, 5, 16, 9, 2, 113, 166, 3, 2, 2, 2, 114, 115, 7, 33, 2, 2, 115, 116, 5, 18, 10, 2, 116, 117, 7, 29, 2, 2, 117, 118, 5, 16, 9, 2, 118, 166, 3, 2, 2, 2, 119, 120, 7, 34, 2, 2, 120, 121, 5, 20, 11, 2, 121, 122, 7, 35, 2, 2, 122, 125, 5, 20, 11, 2, 123, 124, 7, 36, 2, 2, 124, 126, 5, 20, 11, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 128, 7, 29, 2, 2, 128, 129, 5, 16, 9, 2, 129, 166, 3, 2, 2, 2, 130, 131, 7, 37, 2, 2, 131, 136, 7, 82, 2, 2, 132, 133, 7, 38, 2, 2, 133, 134, 5, 30, 16, 2, 134, 135, 7, 39, 2, 2, 135, 137, 3, 2, 2, 2, 136, 132, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 140, 5, 12, 7, 2, 139, 141, 5, 32, 17, 2, 140, 139, 3, 2, 2, 2, 140, 141, 3, 2, 2, 2, 141, 146, 3, 2, 2, 2, 142, 143, 7, 40, 2, 2, 143, 147, 5, 16, 9, 2, 144, 145, 7, 41, 2, 2, 145, 147, 7, 3, 2, 2, 146, 142, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 147, 166, 3, 2, 2, 2, 148, 149, 7, 42, 2, 2, 149, 154, 7, 82, 2, 2, 150, 151, 7, 43, 2, 2, 151, 152, 5, 32, 17, 2, 152, 153, 7, 44, 2, 2, 153, 155, 3, 2, 2, 2, 154, 150, 3, 2, 2, 2, 154, 155, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 7, 40, 2, 2, 157, 159, 7, 45, 2, 2, 158, 160, 5, 14, 8, 2, 159, 158, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 46, 2, 2, 164, 166, 3, 2, 2, 2, 165, 90, 3, 2, 2, 2, 165, 109, 3, 2, 2, 2, 165, 114, 3, 2, 2, 2, 165, 119, 3, 2, 2, 2, 165, 130, 3, 2, 2, 2, 165, 148, 3, 2, 2, 2, 166, 9, 3, 2, 2, 2, 167, 168, 5, 32, 17, 2, 168, 171, 7, 82, 2, 2, 169, 170, 7, 47, 2, 2, 170, 172, 5, 18, 10, 2, 171, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 11, 3, 2, 2, 2, 173, 179, 7, 43, 2, 2, 174, 175, 5, 10, 6, 2, 175, 176, 7, 48, 2, 2, 176, 178, 3, 2, 2, 2, 177, 174, 3, 2, 2, 2, 178, 181, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 183, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 182, 184, 5, 10, 6, 2, 183, 182, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 7, 44, 2, 2, 186, 13, 3, 2, 2, 2, 187, 188, 5, 32, 17, 2, 188, 191, 7, 82, 2, 2, 189, 190, 7, 47, 2, 2, 190, 192, 5, 20, 11, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 194, 7, 3, 2, 2, 194, 216, 3, 2, 2, 2, 195, 196, 7, 37, 2, 2, 196, 197, 7, 82, 2, 2, 197, 199, 5, 12, 7, 2, 198, 200, 5, 32, 17, 2, 199, 198, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 205, 3, 2, 2, 2, 201, 202, 7, 40, 2, 2, 202, 206, 5, 16, 9, 2, 203, 204, 7, 49, 2, 2, 204, 206, 7, 3, 2, 2, 205, 201, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 206, 216, 3, 2, 2, 2, 207, 208, 7, 50, 2, 2, 208, 213, 5, 12, 7, 2, 209, 210, 7, 40, 2, 2, 210, 214, 5, 16, 9, 2, 211, 212, 7, 49, 2, 2, 212, 214, 7, 3, 2, 2, 213, 209, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 214, 216, 3, 2, 2, 2, 215, 187, 3, 2, 2, 2, 215, 195, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 216, 15, 3, 2, 2, 2, 217, 219, 7, 45, 2, 2, 218, 220, 5, 4, 3, 2, 219, 218, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 224, 7, 46, 2, 2, 224, 17, 3, 2, 2, 2, 225, 226, 8, 10, 1, 2, 226, 277, 5, 28, 15, 2, 227, 228, 7, 43, 2, 2, 228, 229, 5, 20, 11, 2, 229, 230, 7, 44, 2, 2, 230, 277, 3, 2, 2, 2, 231, 237, 7, 51, 2, 2, 232, 233, 5, 18, 10, 2, 233, 234, 7, 48, 2, 2, 234, 236, 3, 2, 2, 2, 235, 232, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 242, 5, 18, 10, 2, 241, 240, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 277, 7, 52, 2, 2, 244, 245, 7, 51, 2, 2, 245, 246, 5, 18, 10, 2, 246, 247, 7, 36, 2, 2, 247, 248, 5, 18, 10, 2, 248, 249, 7, 52, 2, 2, 249, 277, 3, 2, 2, 2, 250, 251, 7, 51, 2, 2, 251, 253, 5, 18, 10, 2, 252, 254, 5, 24, 13, 2, 253, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 7, 52, 2, 2, 258, 277, 3, 2, 2, 2, 259, 260, 9, 4, 2, 2, 260, 277, 5, 18, 10, 20, 261, 262, 7, 66, 2, 2, 262, 277, 5, 18, 10, 8, 263, 268, 7, 69, 2, 2, 264, 265, 7, 82, 2, 2, 265, 267, 7, 48, 2, 2, 266, 264, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 272, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 271, 273, 7, 82, 2, 2, 272, 271, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 7, 47, 2, 2, 275, 277, 5, 18, 10, 3, 276, 225, 3, 2, 2, 2, 276, 227, 3, 2, 2, 2, 276, 231, 3, 2, 2, 2, 276, 244, 3, 2, 2, 2, 276, 250, 3, 2, 2, 2, 276, 259, 3, 2, 2, 2, 276, 261, 3, 2, 2, 2, 276, 263, 3, 2, 2, 2, 277, 376, 3, 2, 2, 2, 278, 279, 12, 21, 2, 2, 279, 280, 9, 5, 2, 2, 280, 375, 5, 18, 10, 21, 281, 282, 12, 19, 2, 2, 282, 283, 9, 6, 2, 2, 283, 375, 5, 18, 10, 20, 284, 285, 12, 18, 2, 2, 285, 286, 9, 7, 2, 2, 286, 375, 5, 18, 10, 19, 287, 288, 12, 17, 2, 2, 288, 289, 9, 8, 2, 2, 289, 375, 5, 18, 10, 18, 290, 291, 12, 16, 2, 2, 291, 292, 7, 21, 2, 2, 292, 375, 5, 18, 10, 17, 293, 294, 12, 15, 2, 2, 294, 295, 7, 22, 2, 2, 295, 375, 5, 18, 10, 16, 296, 297, 12, 14, 2, 2, 297, 298, 7, 23, 2, 2, 298, 375, 5, 18, 10, 15, 299, 300, 12, 13, 2, 2, 300, 301, 9, 9, 2, 2, 301, 375, 5, 18, 10, 14, 302, 303, 12, 11, 2, 2, 303, 304, 7, 59, 2, 2, 304, 375, 5, 18, 10, 12, 305, 306, 12, 10, 2, 2, 306, 307, 9, 10, 2, 2, 307, 375, 5, 18, 10, 11, 308, 309, 12, 9, 2, 2, 309, 310, 9, 11, 2, 2, 310, 375, 5, 18, 10, 9, 311, 312, 12, 7, 2, 2, 312, 313, 7, 67, 2, 2, 313, 375, 5, 18, 10, 7, 314, 315, 12, 6, 2, 2, 315, 316, 7, 68, 2, 2, 316, 375, 5, 18, 10, 6, 317, 318, 12, 5, 2, 2, 318, 319, 7, 24, 2, 2, 319, 375, 5, 18, 10, 5, 320, 321, 12, 4, 2, 2, 321, 322, 7, 53, 2, 2, 322, 323, 5, 18, 10, 2, 323, 324, 7, 47, 2, 2, 324, 325, 5, 18, 10, 4, 325, 375, 3, 2, 2, 2, 326, 328, 12, 26, 2, 2, 327, 329, 7, 53, 2, 2, 328, 327, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 331, 7, 51, 2, 2, 331, 332, 5, 20, 11, 2, 332, 333, 7, 52, 2, 2, 333, 375, 3, 2, 2, 2, 334, 335, 12, 25, 2, 2, 335, 337, 7, 51, 2, 2, 336, 338, 5, 18, 10, 2, 337, 336, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 341, 7, 47, 2, 2, 340, 342, 5, 18, 10, 2, 341, 340, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 347, 3, 2, 2, 2, 343, 345, 7, 47, 2, 2, 344, 346, 5, 18, 10, 2, 345, 344, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 348, 3, 2, 2, 2, 347, 343, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 375, 7, 52, 2, 2, 350, 352, 12, 24, 2, 2, 351, 353, 7, 53, 2, 2, 352, 351, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 7, 54, 2, 2, 355, 375, 7, 82, 2, 2, 356, 357, 12, 23, 2, 2, 357, 363, 7, 43, 2, 2, 358, 359, 5, 26, 14, 2, 359, 360, 7, 48, 2, 2, 360, 362, 3, 2, 2, 2, 361, 358, 3, 2, 2, 2, 362, 365, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 363, 364, 3, 2, 2, 2, 364, 367, 3, 2, 2, 2, 365, 363, 3, 2, 2, 2, 366, 368, 5, 26, 14, 2, 367, 366, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 369, 3, 2, 2, 2, 369, 375, 7, 44, 2, 2, 370, 371, 12, 22, 2, 2, 371, 375, 7, 55, 2, 2, 372, 373, 12, 12, 2, 2, 373, 375, 7, 58, 2, 2, 374, 278, 3, 2, 2, 2, 374, 281, 3, 2, 2, 2, 374, 284, 3, 2, 2, 2, 374, 287, 3, 2, 2, 2, 374, 290, 3, 2, 2, 2, 374, 293, 3, 2, 2, 2, 374, 296, 3, 2, 2, 2, 374, 299, 3, 2, 2, 2, 374, 302, 3, 2, 2, 2, 374, 305, 3, 2, 2, 2, 374, 308, 3, 2, 2, 2, 374, 311, 3, 2, 2, 2, 374, 314, 3, 2, 2, 2, 374, 317, 3, 2, 2, 2, 374, 320, 3, 2, 2, 2, 374, 326, 3, 2, 2, 2, 374, 334, 3, 2, 2, 2, 374, 350, 3, 2, 2, 2, 374, 356, 3, 2, 2, 2, 374, 370, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, 378, 3, 2, 2, 2, 376, 374, 3, 2, 2, 2, 376, 377, 3, 2, 2, 2, 377, 19, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 379, 380, 5, 18, 10, 2, 380, 381, 7, 48, 2, 2, 381, 383, 3, 2, 2, 2, 382, 379, 3, 2, 2, 2, 383, 386, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 384, 385, 3, 2, 2, 2, 385, 387, 3, 2, 2, 2, 386, 384, 3, 2, 2, 2, 387, 388, 5, 18, 10, 2, 388, 21, 3, 2, 2, 2, 389, 390, 5, 20, 11, 2, 390, 391, 7, 2, 2, 3, 391, 23, 3, 2, 2, 2, 392, 393, 7, 34, 2, 2, 393, 394, 5, 20, 11, 2, 394, 395, 7, 35, 2, 2, 395, 398, 5, 20, 11, 2, 396, 397, 7, 36, 2, 2, 397, 399, 5, 20, 11, 2, 398, 396, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 403, 3, 2, 2, 2, 400, 401, 7, 28, 2, 2, 401, 403, 5, 18, 10, 2, 402, 392, 3, 2, 2, 2, 402, 400, 3, 2, 2, 2, 403, 25, 3, 2, 2, 2, 404, 405, 7, 82, 2, 2, 405, 407, 7, 10, 2, 2, 406, 404, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 408, 3, 2, 2, 2, 408, 409, 5, 18, 10, 2, 409, 27, 3, 2, 2, 2, 410, 419, 9, 12, 2, 2, 411, 419, 7, 79, 2, 2, 412, 419, 9, 13, 2, 2, 413, 419, 7, 80, 2, 2, 414, 419, 7, 81, 2, 2, 415, 419, 7, 72, 2, 2, 416, 419, 7, 73, 2, 2, 417, 419, 7, 82, 2, 2, 418, 410, 3, 2, 2, 2, 418, 411, 3, 2, 2, 2, 418, 412, 3, 2, 2, 2, 418, 413, 3, 2, 2, 2, 418, 414, 3, 2, 2, 2, 418, 415, 3, 2, 2, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 29, 3, 2, 2, 2, 420, 421, 7, 82, 2, 2, 421, 423, 7, 48, 2, 2, 422, 420, 3, 2, 2, 2, 423, 426, 3, 2, 2, 2, 424, 422, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 427, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 427, 428, 7, 82, 2, 2, 428, 31, 3, 2, 2, 2, 429, 430, 8, 17, 1, 2, 430, 442, 7, 82, 2, 2, 431, 432, 7, 43, 2, 2, 432, 433, 5, 32, 17, 2, 433, 434, 7, 44, 2, 2, 434, 442, 3, 2, 2, 2, 435, 436, 7, 51, 2, 2, 436, 437, 5, 32, 17, 2, 437, 438, 7, 52, 2, 2, 438, 442, 3, 2, 2, 2, 439, 440, 7, 74, 2, 2, 440, 442, 5, 32, 17, 3, 441, 429, 3, 2, 2, 2, 441, 431, 3, 2, 2, 2, 441, 435, 3, 2, 2, 2, 441, 439, 3, 2, 2, 2, 442, 453, 3, 2, 2, 2, 443, 444, 12, 5, 2, 2, 444, 445, 7, 13, 2, 2, 445, 452, 5, 32, 17, 5, 446, 447, 12, 4, 2, 2, 447, 448, 7, 74, 2, 2, 448, 452, 5, 32, 17, 4, 449, 450, 12, 6, 2, 2, 450, 452, 7, 53, 2, 2, 451, 443, 3, 2, 2, 2, 451, 446, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 33, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 53, 37, 46, 56, 61, 67, 74, 86, 88, 101, 107, 125, 136, 140, 146, 154, 161, 165, 171, 179, 183, 191, 199, 205, 213, 215, 221, 237, 241, 255, 268, 272, 276, 328, 337, 341, 345, 347, 352, 363, 367, 374, 376, 384, 398, 402, 406, 418, 424, 441, 451, 453] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 84, 457, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 3, 2, 7, 2, 36, 10, 2, 12, 2, 14, 2, 39, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 47, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 57, 10, 4, 3, 4, 3, 4, 3, 4, 5, 4, 62, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 68, 10, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 87, 10, 4, 5, 4, 89, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 100, 10, 5, 12, 5, 14, 5, 103, 11, 5, 3, 5, 3, 5, 3, 5, 5, 5, 108, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 126, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 137, 10, 5, 3, 5, 3, 5, 5, 5, 141, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 147, 10, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 155, 10, 5, 3, 5, 3, 5, 3, 5, 6, 5, 160, 10, 5, 13, 5, 14, 5, 161, 3, 5, 3, 5, 5, 5, 166, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 172, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 178, 10, 7, 12, 7, 14, 7, 181, 11, 7, 3, 7, 5, 7, 184, 10, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 192, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 200, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 206, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 214, 10, 8, 5, 8, 216, 10, 8, 3, 9, 3, 9, 6, 9, 220, 10, 9, 13, 9, 14, 9, 221, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 236, 10, 10, 12, 10, 14, 10, 239, 11, 10, 3, 10, 5, 10, 242, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 6, 10, 254, 10, 10, 13, 10, 14, 10, 255, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 267, 10, 10, 12, 10, 14, 10, 270, 11, 10, 3, 10, 5, 10, 273, 10, 10, 3, 10, 3, 10, 5, 10, 277, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 329, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 335, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 344, 10, 10, 3, 10, 3, 10, 5, 10, 348, 10, 10, 3, 10, 3, 10, 5, 10, 352, 10, 10, 5, 10, 354, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 362, 10, 10, 12, 10, 14, 10, 365, 11, 10, 3, 10, 5, 10, 368, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 375, 10, 10, 12, 10, 14, 10, 378, 11, 10, 3, 11, 3, 11, 3, 11, 7, 11, 383, 10, 11, 12, 11, 14, 11, 386, 11, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 399, 10, 13, 3, 13, 3, 13, 5, 13, 403, 10, 13, 3, 14, 3, 14, 5, 14, 407, 10, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 5, 15, 419, 10, 15, 3, 16, 3, 16, 7, 16, 423, 10, 16, 12, 16, 14, 16, 426, 11, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 442, 10, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 452, 10, 17, 12, 17, 14, 17, 455, 11, 17, 3, 17, 2, 4, 18, 32, 18, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 2, 14, 3, 2, 11, 24, 3, 2, 25, 26, 4, 2, 17, 18, 56, 56, 3, 2, 11, 12, 3, 2, 13, 16, 3, 2, 17, 18, 3, 2, 19, 20, 3, 2, 57, 58, 3, 2, 60, 61, 4, 2, 38, 39, 62, 65, 3, 2, 75, 78, 3, 2, 70, 71, 2, 538, 2, 37, 3, 2, 2, 2, 4, 46, 3, 2, 2, 2, 6, 88, 3, 2, 2, 2, 8, 165, 3, 2, 2, 2, 10, 167, 3, 2, 2, 2, 12, 173, 3, 2, 2, 2, 14, 215, 3, 2, 2, 2, 16, 217, 3, 2, 2, 2, 18, 276, 3, 2, 2, 2, 20, 384, 3, 2, 2, 2, 22, 389, 3, 2, 2, 2, 24, 402, 3, 2, 2, 2, 26, 406, 3, 2, 2, 2, 28, 418, 3, 2, 2, 2, 30, 424, 3, 2, 2, 2, 32, 441, 3, 2, 2, 2, 34, 36, 5, 4, 3, 2, 35, 34, 3, 2, 2, 2, 36, 39, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 40, 3, 2, 2, 2, 39, 37, 3, 2, 2, 2, 40, 41, 7, 2, 2, 3, 41, 3, 3, 2, 2, 2, 42, 43, 5, 6, 4, 2, 43, 44, 7, 3, 2, 2, 44, 47, 3, 2, 2, 2, 45, 47, 5, 8, 5, 2, 46, 42, 3, 2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 5, 3, 2, 2, 2, 48, 49, 7, 4, 2, 2, 49, 56, 7, 82, 2, 2, 50, 51, 7, 5, 2, 2, 51, 57, 5, 30, 16, 2, 52, 53, 7, 6, 2, 2, 53, 57, 5, 30, 16, 2, 54, 55, 7, 7, 2, 2, 55, 57, 7, 82, 2, 2, 56, 50, 3, 2, 2, 2, 56, 52, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 89, 3, 2, 2, 2, 58, 89, 7, 8, 2, 2, 59, 61, 7, 9, 2, 2, 60, 62, 5, 20, 11, 2, 61, 60, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 89, 3, 2, 2, 2, 63, 64, 5, 32, 17, 2, 64, 67, 7, 82, 2, 2, 65, 66, 7, 10, 2, 2, 66, 68, 5, 20, 11, 2, 67, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 89, 3, 2, 2, 2, 69, 70, 5, 20, 11, 2, 70, 71, 7, 10, 2, 2, 71, 73, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 77, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 89, 5, 20, 11, 2, 78, 79, 5, 18, 10, 2, 79, 80, 9, 2, 2, 2, 80, 81, 7, 10, 2, 2, 81, 82, 5, 18, 10, 2, 82, 89, 3, 2, 2, 2, 83, 89, 9, 3, 2, 2, 84, 86, 7, 27, 2, 2, 85, 87, 5, 20, 11, 2, 86, 85, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 89, 3, 2, 2, 2, 88, 48, 3, 2, 2, 2, 88, 58, 3, 2, 2, 2, 88, 59, 3, 2, 2, 2, 88, 63, 3, 2, 2, 2, 88, 74, 3, 2, 2, 2, 88, 78, 3, 2, 2, 2, 88, 83, 3, 2, 2, 2, 88, 84, 3, 2, 2, 2, 89, 7, 3, 2, 2, 2, 90, 91, 7, 28, 2, 2, 91, 92, 5, 18, 10, 2, 92, 93, 7, 29, 2, 2, 93, 101, 5, 16, 9, 2, 94, 95, 7, 30, 2, 2, 95, 96, 5, 18, 10, 2, 96, 97, 7, 29, 2, 2, 97, 98, 5, 16, 9, 2, 98, 100, 3, 2, 2, 2, 99, 94, 3, 2, 2, 2, 100, 103, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 101, 102, 3, 2, 2, 2, 102, 107, 3, 2, 2, 2, 103, 101, 3, 2, 2, 2, 104, 105, 7, 31, 2, 2, 105, 106, 7, 29, 2, 2, 106, 108, 5, 16, 9, 2, 107, 104, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 166, 3, 2, 2, 2, 109, 110, 7, 32, 2, 2, 110, 111, 5, 18, 10, 2, 111, 112, 7, 29, 2, 2, 112, 113, 5, 16, 9, 2, 113, 166, 3, 2, 2, 2, 114, 115, 7, 33, 2, 2, 115, 116, 5, 18, 10, 2, 116, 117, 7, 29, 2, 2, 117, 118, 5, 16, 9, 2, 118, 166, 3, 2, 2, 2, 119, 120, 7, 34, 2, 2, 120, 121, 5, 20, 11, 2, 121, 122, 7, 35, 2, 2, 122, 125, 5, 20, 11, 2, 123, 124, 7, 36, 2, 2, 124, 126, 5, 20, 11, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 128, 7, 29, 2, 2, 128, 129, 5, 16, 9, 2, 129, 166, 3, 2, 2, 2, 130, 131, 7, 37, 2, 2, 131, 136, 7, 82, 2, 2, 132, 133, 7, 38, 2, 2, 133, 134, 5, 30, 16, 2, 134, 135, 7, 39, 2, 2, 135, 137, 3, 2, 2, 2, 136, 132, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 140, 5, 12, 7, 2, 139, 141, 5, 32, 17, 2, 140, 139, 3, 2, 2, 2, 140, 141, 3, 2, 2, 2, 141, 146, 3, 2, 2, 2, 142, 143, 7, 40, 2, 2, 143, 147, 5, 16, 9, 2, 144, 145, 7, 41, 2, 2, 145, 147, 7, 3, 2, 2, 146, 142, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 147, 166, 3, 2, 2, 2, 148, 149, 7, 42, 2, 2, 149, 154, 7, 82, 2, 2, 150, 151, 7, 43, 2, 2, 151, 152, 5, 32, 17, 2, 152, 153, 7, 44, 2, 2, 153, 155, 3, 2, 2, 2, 154, 150, 3, 2, 2, 2, 154, 155, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 7, 40, 2, 2, 157, 159, 7, 45, 2, 2, 158, 160, 5, 14, 8, 2, 159, 158, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 164, 7, 46, 2, 2, 164, 166, 3, 2, 2, 2, 165, 90, 3, 2, 2, 2, 165, 109, 3, 2, 2, 2, 165, 114, 3, 2, 2, 2, 165, 119, 3, 2, 2, 2, 165, 130, 3, 2, 2, 2, 165, 148, 3, 2, 2, 2, 166, 9, 3, 2, 2, 2, 167, 168, 5, 32, 17, 2, 168, 171, 7, 82, 2, 2, 169, 170, 7, 47, 2, 2, 170, 172, 5, 18, 10, 2, 171, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 11, 3, 2, 2, 2, 173, 179, 7, 43, 2, 2, 174, 175, 5, 10, 6, 2, 175, 176, 7, 48, 2, 2, 176, 178, 3, 2, 2, 2, 177, 174, 3, 2, 2, 2, 178, 181, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 183, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 182, 184, 5, 10, 6, 2, 183, 182, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 7, 44, 2, 2, 186, 13, 3, 2, 2, 2, 187, 188, 5, 32, 17, 2, 188, 191, 7, 82, 2, 2, 189, 190, 7, 47, 2, 2, 190, 192, 5, 20, 11, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 194, 7, 3, 2, 2, 194, 216, 3, 2, 2, 2, 195, 196, 7, 37, 2, 2, 196, 197, 7, 82, 2, 2, 197, 199, 5, 12, 7, 2, 198, 200, 5, 32, 17, 2, 199, 198, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 205, 3, 2, 2, 2, 201, 202, 7, 40, 2, 2, 202, 206, 5, 16, 9, 2, 203, 204, 7, 49, 2, 2, 204, 206, 7, 3, 2, 2, 205, 201, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 206, 216, 3, 2, 2, 2, 207, 208, 7, 50, 2, 2, 208, 213, 5, 12, 7, 2, 209, 210, 7, 40, 2, 2, 210, 214, 5, 16, 9, 2, 211, 212, 7, 49, 2, 2, 212, 214, 7, 3, 2, 2, 213, 209, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 214, 216, 3, 2, 2, 2, 215, 187, 3, 2, 2, 2, 215, 195, 3, 2, 2, 2, 215, 207, 3, 2, 2, 2, 216, 15, 3, 2, 2, 2, 217, 219, 7, 45, 2, 2, 218, 220, 5, 4, 3, 2, 219, 218, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 224, 7, 46, 2, 2, 224, 17, 3, 2, 2, 2, 225, 226, 8, 10, 1, 2, 226, 277, 5, 28, 15, 2, 227, 228, 7, 43, 2, 2, 228, 229, 5, 20, 11, 2, 229, 230, 7, 44, 2, 2, 230, 277, 3, 2, 2, 2, 231, 237, 7, 51, 2, 2, 232, 233, 5, 18, 10, 2, 233, 234, 7, 48, 2, 2, 234, 236, 3, 2, 2, 2, 235, 232, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 242, 5, 18, 10, 2, 241, 240, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 277, 7, 52, 2, 2, 244, 245, 7, 51, 2, 2, 245, 246, 5, 18, 10, 2, 246, 247, 7, 36, 2, 2, 247, 248, 5, 18, 10, 2, 248, 249, 7, 52, 2, 2, 249, 277, 3, 2, 2, 2, 250, 251, 7, 51, 2, 2, 251, 253, 5, 18, 10, 2, 252, 254, 5, 24, 13, 2, 253, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 7, 52, 2, 2, 258, 277, 3, 2, 2, 2, 259, 260, 9, 4, 2, 2, 260, 277, 5, 18, 10, 20, 261, 262, 7, 66, 2, 2, 262, 277, 5, 18, 10, 8, 263, 268, 7, 69, 2, 2, 264, 265, 7, 82, 2, 2, 265, 267, 7, 48, 2, 2, 266, 264, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 268, 269, 3, 2, 2, 2, 269, 272, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 271, 273, 7, 82, 2, 2, 272, 271, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 7, 47, 2, 2, 275, 277, 5, 18, 10, 3, 276, 225, 3, 2, 2, 2, 276, 227, 3, 2, 2, 2, 276, 231, 3, 2, 2, 2, 276, 244, 3, 2, 2, 2, 276, 250, 3, 2, 2, 2, 276, 259, 3, 2, 2, 2, 276, 261, 3, 2, 2, 2, 276, 263, 3, 2, 2, 2, 277, 376, 3, 2, 2, 2, 278, 279, 12, 21, 2, 2, 279, 280, 9, 5, 2, 2, 280, 375, 5, 18, 10, 21, 281, 282, 12, 19, 2, 2, 282, 283, 9, 6, 2, 2, 283, 375, 5, 18, 10, 20, 284, 285, 12, 18, 2, 2, 285, 286, 9, 7, 2, 2, 286, 375, 5, 18, 10, 19, 287, 288, 12, 17, 2, 2, 288, 289, 9, 8, 2, 2, 289, 375, 5, 18, 10, 18, 290, 291, 12, 16, 2, 2, 291, 292, 7, 21, 2, 2, 292, 375, 5, 18, 10, 17, 293, 294, 12, 15, 2, 2, 294, 295, 7, 22, 2, 2, 295, 375, 5, 18, 10, 16, 296, 297, 12, 14, 2, 2, 297, 298, 7, 23, 2, 2, 298, 375, 5, 18, 10, 15, 299, 300, 12, 13, 2, 2, 300, 301, 9, 9, 2, 2, 301, 375, 5, 18, 10, 14, 302, 303, 12, 11, 2, 2, 303, 304, 7, 59, 2, 2, 304, 375, 5, 18, 10, 12, 305, 306, 12, 10, 2, 2, 306, 307, 9, 10, 2, 2, 307, 375, 5, 18, 10, 11, 308, 309, 12, 9, 2, 2, 309, 310, 9, 11, 2, 2, 310, 375, 5, 18, 10, 9, 311, 312, 12, 7, 2, 2, 312, 313, 7, 67, 2, 2, 313, 375, 5, 18, 10, 7, 314, 315, 12, 6, 2, 2, 315, 316, 7, 68, 2, 2, 316, 375, 5, 18, 10, 6, 317, 318, 12, 5, 2, 2, 318, 319, 7, 24, 2, 2, 319, 375, 5, 18, 10, 5, 320, 321, 12, 4, 2, 2, 321, 322, 7, 53, 2, 2, 322, 323, 5, 18, 10, 2, 323, 324, 7, 47, 2, 2, 324, 325, 5, 18, 10, 4, 325, 375, 3, 2, 2, 2, 326, 328, 12, 26, 2, 2, 327, 329, 7, 53, 2, 2, 328, 327, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 331, 7, 54, 2, 2, 331, 375, 7, 82, 2, 2, 332, 334, 12, 25, 2, 2, 333, 335, 7, 53, 2, 2, 334, 333, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 337, 7, 51, 2, 2, 337, 338, 5, 20, 11, 2, 338, 339, 7, 52, 2, 2, 339, 375, 3, 2, 2, 2, 340, 341, 12, 24, 2, 2, 341, 343, 7, 51, 2, 2, 342, 344, 5, 18, 10, 2, 343, 342, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 347, 7, 47, 2, 2, 346, 348, 5, 18, 10, 2, 347, 346, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 353, 3, 2, 2, 2, 349, 351, 7, 47, 2, 2, 350, 352, 5, 18, 10, 2, 351, 350, 3, 2, 2, 2, 351, 352, 3, 2, 2, 2, 352, 354, 3, 2, 2, 2, 353, 349, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 375, 7, 52, 2, 2, 356, 357, 12, 23, 2, 2, 357, 363, 7, 43, 2, 2, 358, 359, 5, 26, 14, 2, 359, 360, 7, 48, 2, 2, 360, 362, 3, 2, 2, 2, 361, 358, 3, 2, 2, 2, 362, 365, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 363, 364, 3, 2, 2, 2, 364, 367, 3, 2, 2, 2, 365, 363, 3, 2, 2, 2, 366, 368, 5, 26, 14, 2, 367, 366, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 369, 3, 2, 2, 2, 369, 375, 7, 44, 2, 2, 370, 371, 12, 22, 2, 2, 371, 375, 7, 55, 2, 2, 372, 373, 12, 12, 2, 2, 373, 375, 7, 58, 2, 2, 374, 278, 3, 2, 2, 2, 374, 281, 3, 2, 2, 2, 374, 284, 3, 2, 2, 2, 374, 287, 3, 2, 2, 2, 374, 290, 3, 2, 2, 2, 374, 293, 3, 2, 2, 2, 374, 296, 3, 2, 2, 2, 374, 299, 3, 2, 2, 2, 374, 302, 3, 2, 2, 2, 374, 305, 3, 2, 2, 2, 374, 308, 3, 2, 2, 2, 374, 311, 3, 2, 2, 2, 374, 314, 3, 2, 2, 2, 374, 317, 3, 2, 2, 2, 374, 320, 3, 2, 2, 2, 374, 326, 3, 2, 2, 2, 374, 332, 3, 2, 2, 2, 374, 340, 3, 2, 2, 2, 374, 356, 3, 2, 2, 2, 374, 370, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, 378, 3, 2, 2, 2, 376, 374, 3, 2, 2, 2, 376, 377, 3, 2, 2, 2, 377, 19, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 379, 380, 5, 18, 10, 2, 380, 381, 7, 48, 2, 2, 381, 383, 3, 2, 2, 2, 382, 379, 3, 2, 2, 2, 383, 386, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 384, 385, 3, 2, 2, 2, 385, 387, 3, 2, 2, 2, 386, 384, 3, 2, 2, 2, 387, 388, 5, 18, 10, 2, 388, 21, 3, 2, 2, 2, 389, 390, 5, 20, 11, 2, 390, 391, 7, 2, 2, 3, 391, 23, 3, 2, 2, 2, 392, 393, 7, 34, 2, 2, 393, 394, 5, 20, 11, 2, 394, 395, 7, 35, 2, 2, 395, 398, 5, 20, 11, 2, 396, 397, 7, 36, 2, 2, 397, 399, 5, 20, 11, 2, 398, 396, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 403, 3, 2, 2, 2, 400, 401, 7, 28, 2, 2, 401, 403, 5, 18, 10, 2, 402, 392, 3, 2, 2, 2, 402, 400, 3, 2, 2, 2, 403, 25, 3, 2, 2, 2, 404, 405, 7, 82, 2, 2, 405, 407, 7, 10, 2, 2, 406, 404, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 408, 3, 2, 2, 2, 408, 409, 5, 18, 10, 2, 409, 27, 3, 2, 2, 2, 410, 419, 9, 12, 2, 2, 411, 419, 7, 79, 2, 2, 412, 419, 9, 13, 2, 2, 413, 419, 7, 80, 2, 2, 414, 419, 7, 81, 2, 2, 415, 419, 7, 72, 2, 2, 416, 419, 7, 73, 2, 2, 417, 419, 7, 82, 2, 2, 418, 410, 3, 2, 2, 2, 418, 411, 3, 2, 2, 2, 418, 412, 3, 2, 2, 2, 418, 413, 3, 2, 2, 2, 418, 414, 3, 2, 2, 2, 418, 415, 3, 2, 2, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 29, 3, 2, 2, 2, 420, 421, 7, 82, 2, 2, 421, 423, 7, 48, 2, 2, 422, 420, 3, 2, 2, 2, 423, 426, 3, 2, 2, 2, 424, 422, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 427, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 427, 428, 7, 82, 2, 2, 428, 31, 3, 2, 2, 2, 429, 430, 8, 17, 1, 2, 430, 442, 7, 82, 2, 2, 431, 432, 7, 43, 2, 2, 432, 433, 5, 32, 17, 2, 433, 434, 7, 44, 2, 2, 434, 442, 3, 2, 2, 2, 435, 436, 7, 51, 2, 2, 436, 437, 5, 32, 17, 2, 437, 438, 7, 52, 2, 2, 438, 442, 3, 2, 2, 2, 439, 440, 7, 74, 2, 2, 440, 442, 5, 32, 17, 3, 441, 429, 3, 2, 2, 2, 441, 431, 3, 2, 2, 2, 441, 435, 3, 2, 2, 2, 441, 439, 3, 2, 2, 2, 442, 453, 3, 2, 2, 2, 443, 444, 12, 5, 2, 2, 444, 445, 7, 13, 2, 2, 445, 452, 5, 32, 17, 5, 446, 447, 12, 4, 2, 2, 447, 448, 7, 74, 2, 2, 448, 452, 5, 32, 17, 4, 449, 450, 12, 6, 2, 2, 450, 452, 7, 53, 2, 2, 451, 443, 3, 2, 2, 2, 451, 446, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 33, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 53, 37, 46, 56, 61, 67, 74, 86, 88, 101, 107, 125, 136, 140, 146, 154, 161, 165, 171, 179, 183, 191, 199, 205, 213, 215, 221, 237, 241, 255, 268, 272, 276, 328, 334, 343, 347, 351, 353, 363, 367, 374, 376, 384, 398, 402, 406, 418, 424, 441, 451, 453] \ No newline at end of file diff --git a/src/antlr/PyxellParser.py b/src/antlr/PyxellParser.py index 77234bc3..558fa0f8 100644 --- a/src/antlr/PyxellParser.py +++ b/src/antlr/PyxellParser.py @@ -37,14 +37,14 @@ def serializedATN(): buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3") buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n") buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3") - buf.write("\n\5\n\u0149\n\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u0152") - buf.write("\n\n\3\n\3\n\5\n\u0156\n\n\3\n\3\n\5\n\u015a\n\n\5\n\u015c") - buf.write("\n\n\3\n\3\n\3\n\5\n\u0161\n\n\3\n\3\n\3\n\3\n\3\n\3\n") - buf.write("\3\n\7\n\u016a\n\n\f\n\16\n\u016d\13\n\3\n\5\n\u0170\n") - buf.write("\n\3\n\3\n\3\n\3\n\3\n\7\n\u0177\n\n\f\n\16\n\u017a\13") - buf.write("\n\3\13\3\13\3\13\7\13\u017f\n\13\f\13\16\13\u0182\13") - buf.write("\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\5\r") - buf.write("\u018f\n\r\3\r\3\r\5\r\u0193\n\r\3\16\3\16\5\16\u0197") + buf.write("\n\5\n\u0149\n\n\3\n\3\n\3\n\3\n\5\n\u014f\n\n\3\n\3\n") + buf.write("\3\n\3\n\3\n\3\n\3\n\5\n\u0158\n\n\3\n\3\n\5\n\u015c\n") + buf.write("\n\3\n\3\n\5\n\u0160\n\n\5\n\u0162\n\n\3\n\3\n\3\n\3\n") + buf.write("\3\n\3\n\7\n\u016a\n\n\f\n\16\n\u016d\13\n\3\n\5\n\u0170") + buf.write("\n\n\3\n\3\n\3\n\3\n\3\n\7\n\u0177\n\n\f\n\16\n\u017a") + buf.write("\13\n\3\13\3\13\3\13\7\13\u017f\n\13\f\13\16\13\u0182") + buf.write("\13\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\5") + buf.write("\r\u018f\n\r\3\r\3\r\5\r\u0193\n\r\3\16\3\16\5\16\u0197") buf.write("\n\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17") buf.write("\5\17\u01a3\n\17\3\20\3\20\7\20\u01a7\n\20\f\20\16\20") buf.write("\u01aa\13\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3") @@ -167,54 +167,54 @@ def serializedATN(): buf.write("\u0143\5\22\n\2\u0143\u0144\7/\2\2\u0144\u0145\5\22\n") buf.write("\4\u0145\u0177\3\2\2\2\u0146\u0148\f\32\2\2\u0147\u0149") buf.write("\7\65\2\2\u0148\u0147\3\2\2\2\u0148\u0149\3\2\2\2\u0149") - buf.write("\u014a\3\2\2\2\u014a\u014b\7\63\2\2\u014b\u014c\5\24\13") - buf.write("\2\u014c\u014d\7\64\2\2\u014d\u0177\3\2\2\2\u014e\u014f") - buf.write("\f\31\2\2\u014f\u0151\7\63\2\2\u0150\u0152\5\22\n\2\u0151") - buf.write("\u0150\3\2\2\2\u0151\u0152\3\2\2\2\u0152\u0153\3\2\2\2") - buf.write("\u0153\u0155\7/\2\2\u0154\u0156\5\22\n\2\u0155\u0154\3") - buf.write("\2\2\2\u0155\u0156\3\2\2\2\u0156\u015b\3\2\2\2\u0157\u0159") - buf.write("\7/\2\2\u0158\u015a\5\22\n\2\u0159\u0158\3\2\2\2\u0159") - buf.write("\u015a\3\2\2\2\u015a\u015c\3\2\2\2\u015b\u0157\3\2\2\2") - buf.write("\u015b\u015c\3\2\2\2\u015c\u015d\3\2\2\2\u015d\u0177\7") - buf.write("\64\2\2\u015e\u0160\f\30\2\2\u015f\u0161\7\65\2\2\u0160") - buf.write("\u015f\3\2\2\2\u0160\u0161\3\2\2\2\u0161\u0162\3\2\2\2") - buf.write("\u0162\u0163\7\66\2\2\u0163\u0177\7R\2\2\u0164\u0165\f") - buf.write("\27\2\2\u0165\u016b\7+\2\2\u0166\u0167\5\32\16\2\u0167") - buf.write("\u0168\7\60\2\2\u0168\u016a\3\2\2\2\u0169\u0166\3\2\2") - buf.write("\2\u016a\u016d\3\2\2\2\u016b\u0169\3\2\2\2\u016b\u016c") - buf.write("\3\2\2\2\u016c\u016f\3\2\2\2\u016d\u016b\3\2\2\2\u016e") - buf.write("\u0170\5\32\16\2\u016f\u016e\3\2\2\2\u016f\u0170\3\2\2") - buf.write("\2\u0170\u0171\3\2\2\2\u0171\u0177\7,\2\2\u0172\u0173") - buf.write("\f\26\2\2\u0173\u0177\7\67\2\2\u0174\u0175\f\f\2\2\u0175") - buf.write("\u0177\7:\2\2\u0176\u0116\3\2\2\2\u0176\u0119\3\2\2\2") - buf.write("\u0176\u011c\3\2\2\2\u0176\u011f\3\2\2\2\u0176\u0122\3") - buf.write("\2\2\2\u0176\u0125\3\2\2\2\u0176\u0128\3\2\2\2\u0176\u012b") - buf.write("\3\2\2\2\u0176\u012e\3\2\2\2\u0176\u0131\3\2\2\2\u0176") - buf.write("\u0134\3\2\2\2\u0176\u0137\3\2\2\2\u0176\u013a\3\2\2\2") - buf.write("\u0176\u013d\3\2\2\2\u0176\u0140\3\2\2\2\u0176\u0146\3") - buf.write("\2\2\2\u0176\u014e\3\2\2\2\u0176\u015e\3\2\2\2\u0176\u0164") - buf.write("\3\2\2\2\u0176\u0172\3\2\2\2\u0176\u0174\3\2\2\2\u0177") - buf.write("\u017a\3\2\2\2\u0178\u0176\3\2\2\2\u0178\u0179\3\2\2\2") - buf.write("\u0179\23\3\2\2\2\u017a\u0178\3\2\2\2\u017b\u017c\5\22") - buf.write("\n\2\u017c\u017d\7\60\2\2\u017d\u017f\3\2\2\2\u017e\u017b") - buf.write("\3\2\2\2\u017f\u0182\3\2\2\2\u0180\u017e\3\2\2\2\u0180") - buf.write("\u0181\3\2\2\2\u0181\u0183\3\2\2\2\u0182\u0180\3\2\2\2") - buf.write("\u0183\u0184\5\22\n\2\u0184\25\3\2\2\2\u0185\u0186\5\24") - buf.write("\13\2\u0186\u0187\7\2\2\3\u0187\27\3\2\2\2\u0188\u0189") - buf.write("\7\"\2\2\u0189\u018a\5\24\13\2\u018a\u018b\7#\2\2\u018b") - buf.write("\u018e\5\24\13\2\u018c\u018d\7$\2\2\u018d\u018f\5\24\13") - buf.write("\2\u018e\u018c\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0193") - buf.write("\3\2\2\2\u0190\u0191\7\34\2\2\u0191\u0193\5\22\n\2\u0192") - buf.write("\u0188\3\2\2\2\u0192\u0190\3\2\2\2\u0193\31\3\2\2\2\u0194") - buf.write("\u0195\7R\2\2\u0195\u0197\7\n\2\2\u0196\u0194\3\2\2\2") - buf.write("\u0196\u0197\3\2\2\2\u0197\u0198\3\2\2\2\u0198\u0199\5") - buf.write("\22\n\2\u0199\33\3\2\2\2\u019a\u01a3\t\f\2\2\u019b\u01a3") - buf.write("\7O\2\2\u019c\u01a3\t\r\2\2\u019d\u01a3\7P\2\2\u019e\u01a3") - buf.write("\7Q\2\2\u019f\u01a3\7H\2\2\u01a0\u01a3\7I\2\2\u01a1\u01a3") - buf.write("\7R\2\2\u01a2\u019a\3\2\2\2\u01a2\u019b\3\2\2\2\u01a2") - buf.write("\u019c\3\2\2\2\u01a2\u019d\3\2\2\2\u01a2\u019e\3\2\2\2") - buf.write("\u01a2\u019f\3\2\2\2\u01a2\u01a0\3\2\2\2\u01a2\u01a1\3") - buf.write("\2\2\2\u01a3\35\3\2\2\2\u01a4\u01a5\7R\2\2\u01a5\u01a7") + buf.write("\u014a\3\2\2\2\u014a\u014b\7\66\2\2\u014b\u0177\7R\2\2") + buf.write("\u014c\u014e\f\31\2\2\u014d\u014f\7\65\2\2\u014e\u014d") + buf.write("\3\2\2\2\u014e\u014f\3\2\2\2\u014f\u0150\3\2\2\2\u0150") + buf.write("\u0151\7\63\2\2\u0151\u0152\5\24\13\2\u0152\u0153\7\64") + buf.write("\2\2\u0153\u0177\3\2\2\2\u0154\u0155\f\30\2\2\u0155\u0157") + buf.write("\7\63\2\2\u0156\u0158\5\22\n\2\u0157\u0156\3\2\2\2\u0157") + buf.write("\u0158\3\2\2\2\u0158\u0159\3\2\2\2\u0159\u015b\7/\2\2") + buf.write("\u015a\u015c\5\22\n\2\u015b\u015a\3\2\2\2\u015b\u015c") + buf.write("\3\2\2\2\u015c\u0161\3\2\2\2\u015d\u015f\7/\2\2\u015e") + buf.write("\u0160\5\22\n\2\u015f\u015e\3\2\2\2\u015f\u0160\3\2\2") + buf.write("\2\u0160\u0162\3\2\2\2\u0161\u015d\3\2\2\2\u0161\u0162") + buf.write("\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0177\7\64\2\2\u0164") + buf.write("\u0165\f\27\2\2\u0165\u016b\7+\2\2\u0166\u0167\5\32\16") + buf.write("\2\u0167\u0168\7\60\2\2\u0168\u016a\3\2\2\2\u0169\u0166") + buf.write("\3\2\2\2\u016a\u016d\3\2\2\2\u016b\u0169\3\2\2\2\u016b") + buf.write("\u016c\3\2\2\2\u016c\u016f\3\2\2\2\u016d\u016b\3\2\2\2") + buf.write("\u016e\u0170\5\32\16\2\u016f\u016e\3\2\2\2\u016f\u0170") + buf.write("\3\2\2\2\u0170\u0171\3\2\2\2\u0171\u0177\7,\2\2\u0172") + buf.write("\u0173\f\26\2\2\u0173\u0177\7\67\2\2\u0174\u0175\f\f\2") + buf.write("\2\u0175\u0177\7:\2\2\u0176\u0116\3\2\2\2\u0176\u0119") + buf.write("\3\2\2\2\u0176\u011c\3\2\2\2\u0176\u011f\3\2\2\2\u0176") + buf.write("\u0122\3\2\2\2\u0176\u0125\3\2\2\2\u0176\u0128\3\2\2\2") + buf.write("\u0176\u012b\3\2\2\2\u0176\u012e\3\2\2\2\u0176\u0131\3") + buf.write("\2\2\2\u0176\u0134\3\2\2\2\u0176\u0137\3\2\2\2\u0176\u013a") + buf.write("\3\2\2\2\u0176\u013d\3\2\2\2\u0176\u0140\3\2\2\2\u0176") + buf.write("\u0146\3\2\2\2\u0176\u014c\3\2\2\2\u0176\u0154\3\2\2\2") + buf.write("\u0176\u0164\3\2\2\2\u0176\u0172\3\2\2\2\u0176\u0174\3") + buf.write("\2\2\2\u0177\u017a\3\2\2\2\u0178\u0176\3\2\2\2\u0178\u0179") + buf.write("\3\2\2\2\u0179\23\3\2\2\2\u017a\u0178\3\2\2\2\u017b\u017c") + buf.write("\5\22\n\2\u017c\u017d\7\60\2\2\u017d\u017f\3\2\2\2\u017e") + buf.write("\u017b\3\2\2\2\u017f\u0182\3\2\2\2\u0180\u017e\3\2\2\2") + buf.write("\u0180\u0181\3\2\2\2\u0181\u0183\3\2\2\2\u0182\u0180\3") + buf.write("\2\2\2\u0183\u0184\5\22\n\2\u0184\25\3\2\2\2\u0185\u0186") + buf.write("\5\24\13\2\u0186\u0187\7\2\2\3\u0187\27\3\2\2\2\u0188") + buf.write("\u0189\7\"\2\2\u0189\u018a\5\24\13\2\u018a\u018b\7#\2") + buf.write("\2\u018b\u018e\5\24\13\2\u018c\u018d\7$\2\2\u018d\u018f") + buf.write("\5\24\13\2\u018e\u018c\3\2\2\2\u018e\u018f\3\2\2\2\u018f") + buf.write("\u0193\3\2\2\2\u0190\u0191\7\34\2\2\u0191\u0193\5\22\n") + buf.write("\2\u0192\u0188\3\2\2\2\u0192\u0190\3\2\2\2\u0193\31\3") + buf.write("\2\2\2\u0194\u0195\7R\2\2\u0195\u0197\7\n\2\2\u0196\u0194") + buf.write("\3\2\2\2\u0196\u0197\3\2\2\2\u0197\u0198\3\2\2\2\u0198") + buf.write("\u0199\5\22\n\2\u0199\33\3\2\2\2\u019a\u01a3\t\f\2\2\u019b") + buf.write("\u01a3\7O\2\2\u019c\u01a3\t\r\2\2\u019d\u01a3\7P\2\2\u019e") + buf.write("\u01a3\7Q\2\2\u019f\u01a3\7H\2\2\u01a0\u01a3\7I\2\2\u01a1") + buf.write("\u01a3\7R\2\2\u01a2\u019a\3\2\2\2\u01a2\u019b\3\2\2\2") + buf.write("\u01a2\u019c\3\2\2\2\u01a2\u019d\3\2\2\2\u01a2\u019e\3") + buf.write("\2\2\2\u01a2\u019f\3\2\2\2\u01a2\u01a0\3\2\2\2\u01a2\u01a1") + buf.write("\3\2\2\2\u01a3\35\3\2\2\2\u01a4\u01a5\7R\2\2\u01a5\u01a7") buf.write("\7\60\2\2\u01a6\u01a4\3\2\2\2\u01a7\u01aa\3\2\2\2\u01a8") buf.write("\u01a6\3\2\2\2\u01a8\u01a9\3\2\2\2\u01a9\u01ab\3\2\2\2") buf.write("\u01aa\u01a8\3\2\2\2\u01ab\u01ac\7R\2\2\u01ac\37\3\2\2") @@ -232,8 +232,8 @@ def serializedATN(): buf.write("\u01c5\u01c6\3\2\2\2\u01c6!\3\2\2\2\u01c7\u01c5\3\2\2") buf.write("\2\65%.8=CJVXek}\u0088\u008c\u0092\u009a\u00a1\u00a5\u00ab") buf.write("\u00b3\u00b7\u00bf\u00c7\u00cd\u00d5\u00d7\u00dd\u00ed") - buf.write("\u00f1\u00ff\u010c\u0110\u0114\u0148\u0151\u0155\u0159") - buf.write("\u015b\u0160\u016b\u016f\u0176\u0178\u0180\u018e\u0192") + buf.write("\u00f1\u00ff\u010c\u0110\u0114\u0148\u014e\u0157\u015b") + buf.write("\u015f\u0161\u016b\u016f\u0176\u0178\u0180\u018e\u0192") buf.write("\u0196\u01a2\u01a8\u01b9\u01c3\u01c5") return buf.getvalue() @@ -2367,7 +2367,7 @@ def expr(self, _p:int=0): pass elif la_ == 16: - localctx = PyxellParser.ExprIndexContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) + localctx = PyxellParser.ExprAttrContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expr) self.state = 324 if not self.precpred(self._ctx, 24): @@ -2382,79 +2382,79 @@ def expr(self, _p:int=0): self.state = 328 - self.match(PyxellParser.T__48) + self.match(PyxellParser.T__51) self.state = 329 - self.tuple_expr() - self.state = 330 - self.match(PyxellParser.T__49) + self.match(PyxellParser.ID) pass elif la_ == 17: - localctx = PyxellParser.ExprSliceContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) + localctx = PyxellParser.ExprIndexContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) self.pushNewRecursionContext(localctx, _startState, self.RULE_expr) - self.state = 332 + self.state = 330 if not self.precpred(self._ctx, 23): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 23)") - self.state = 333 + self.state = 332 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==PyxellParser.T__50: + self.state = 331 + localctx.safe = self.match(PyxellParser.T__50) + + + self.state = 334 self.match(PyxellParser.T__48) self.state = 335 + self.tuple_expr() + self.state = 336 + self.match(PyxellParser.T__49) + pass + + elif la_ == 18: + localctx = PyxellParser.ExprSliceContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) + self.pushNewRecursionContext(localctx, _startState, self.RULE_expr) + self.state = 338 + if not self.precpred(self._ctx, 22): + from antlr4.error.Errors import FailedPredicateException + raise FailedPredicateException(self, "self.precpred(self._ctx, 22)") + self.state = 339 + self.match(PyxellParser.T__48) + self.state = 341 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PyxellParser.T__14) | (1 << PyxellParser.T__15) | (1 << PyxellParser.T__40) | (1 << PyxellParser.T__48) | (1 << PyxellParser.T__53))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (PyxellParser.T__63 - 64)) | (1 << (PyxellParser.T__66 - 64)) | (1 << (PyxellParser.T__67 - 64)) | (1 << (PyxellParser.T__68 - 64)) | (1 << (PyxellParser.T__69 - 64)) | (1 << (PyxellParser.T__70 - 64)) | (1 << (PyxellParser.INT_DEC - 64)) | (1 << (PyxellParser.INT_BIN - 64)) | (1 << (PyxellParser.INT_OCT - 64)) | (1 << (PyxellParser.INT_HEX - 64)) | (1 << (PyxellParser.FLOAT - 64)) | (1 << (PyxellParser.CHAR - 64)) | (1 << (PyxellParser.STRING - 64)) | (1 << (PyxellParser.ID - 64)))) != 0): - self.state = 334 + self.state = 340 localctx.e1 = self.expr(0) - self.state = 337 + self.state = 343 self.match(PyxellParser.T__44) - self.state = 339 + self.state = 345 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PyxellParser.T__14) | (1 << PyxellParser.T__15) | (1 << PyxellParser.T__40) | (1 << PyxellParser.T__48) | (1 << PyxellParser.T__53))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (PyxellParser.T__63 - 64)) | (1 << (PyxellParser.T__66 - 64)) | (1 << (PyxellParser.T__67 - 64)) | (1 << (PyxellParser.T__68 - 64)) | (1 << (PyxellParser.T__69 - 64)) | (1 << (PyxellParser.T__70 - 64)) | (1 << (PyxellParser.INT_DEC - 64)) | (1 << (PyxellParser.INT_BIN - 64)) | (1 << (PyxellParser.INT_OCT - 64)) | (1 << (PyxellParser.INT_HEX - 64)) | (1 << (PyxellParser.FLOAT - 64)) | (1 << (PyxellParser.CHAR - 64)) | (1 << (PyxellParser.STRING - 64)) | (1 << (PyxellParser.ID - 64)))) != 0): - self.state = 338 + self.state = 344 localctx.e2 = self.expr(0) - self.state = 345 + self.state = 351 self._errHandler.sync(self) _la = self._input.LA(1) if _la==PyxellParser.T__44: - self.state = 341 + self.state = 347 self.match(PyxellParser.T__44) - self.state = 343 + self.state = 349 self._errHandler.sync(self) _la = self._input.LA(1) if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PyxellParser.T__14) | (1 << PyxellParser.T__15) | (1 << PyxellParser.T__40) | (1 << PyxellParser.T__48) | (1 << PyxellParser.T__53))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (PyxellParser.T__63 - 64)) | (1 << (PyxellParser.T__66 - 64)) | (1 << (PyxellParser.T__67 - 64)) | (1 << (PyxellParser.T__68 - 64)) | (1 << (PyxellParser.T__69 - 64)) | (1 << (PyxellParser.T__70 - 64)) | (1 << (PyxellParser.INT_DEC - 64)) | (1 << (PyxellParser.INT_BIN - 64)) | (1 << (PyxellParser.INT_OCT - 64)) | (1 << (PyxellParser.INT_HEX - 64)) | (1 << (PyxellParser.FLOAT - 64)) | (1 << (PyxellParser.CHAR - 64)) | (1 << (PyxellParser.STRING - 64)) | (1 << (PyxellParser.ID - 64)))) != 0): - self.state = 342 + self.state = 348 localctx.e3 = self.expr(0) - self.state = 347 - self.match(PyxellParser.T__49) - pass - - elif la_ == 18: - localctx = PyxellParser.ExprAttrContext(self, PyxellParser.ExprContext(self, _parentctx, _parentState)) - self.pushNewRecursionContext(localctx, _startState, self.RULE_expr) - self.state = 348 - if not self.precpred(self._ctx, 22): - from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, "self.precpred(self._ctx, 22)") - self.state = 350 - self._errHandler.sync(self) - _la = self._input.LA(1) - if _la==PyxellParser.T__50: - self.state = 349 - localctx.safe = self.match(PyxellParser.T__50) - - - self.state = 352 - self.match(PyxellParser.T__51) self.state = 353 - self.match(PyxellParser.ID) + self.match(PyxellParser.T__49) pass elif la_ == 19: diff --git a/src/ast.py b/src/ast.py index 6c29b8a2..1c0dfac8 100644 --- a/src/ast.py +++ b/src/ast.py @@ -229,6 +229,14 @@ def visitComprehensionFilter(self, ctx): 'expr': self.visit(ctx.expr()), } + def visitExprAttr(self, ctx): + return { + **_node(ctx, 'ExprAttr'), + 'expr': self.visit(ctx.expr()), + 'attr': self.visit(ctx.ID()), + 'safe': bool(ctx.safe), + } + def visitExprIndex(self, ctx): return { **_node(ctx, 'ExprIndex'), @@ -243,14 +251,6 @@ def visitExprSlice(self, ctx): 'slice': self.visit([ctx.e1, ctx.e2, ctx.e3]), } - def visitExprAttr(self, ctx): - return { - **_node(ctx, 'ExprAttr'), - 'expr': self.visit(ctx.expr()), - 'attr': self.visit(ctx.ID()), - 'safe': bool(ctx.safe), - } - def visitExprCall(self, ctx): return { **_node(ctx, 'ExprCall'), diff --git a/src/compiler.py b/src/compiler.py index 8b8138b4..dfb7b112 100644 --- a/src/compiler.py +++ b/src/compiler.py @@ -405,12 +405,12 @@ def lvalue(self, node, expr, declare=None, override=False, initialize=False): return self.env[id] - elif expr['node'] == 'ExprIndex' and not expr.get('safe'): - return self.index(node, *map(self.compile, expr['exprs']), lvalue=True) - elif expr['node'] == 'ExprAttr' and not expr.get('safe'): return self.member(node, self.compile(expr['expr']), expr['attr'], lvalue=True) + elif expr['node'] == 'ExprIndex' and not expr.get('safe'): + return self.index(node, *map(self.compile, expr['exprs']), lvalue=True) + self.throw(node, err.NotLvalue()) def assign(self, node, expr, value): @@ -963,12 +963,6 @@ def convert_expr(expr): **expr, 'exprs': lmap(convert_expr, expr['exprs']), } - if node == 'ExprSlice': - return { - **expr, - 'expr': convert_expr(expr['expr']), - 'slice': lmap(convert_expr, expr['slice']), - } if node == 'ExprArrayComprehension': return { **expr, @@ -981,16 +975,22 @@ def convert_expr(expr): 'iterables': lmap(convert_expr, expr['iterables']), 'steps': lmap(convert_expr, expr['steps']), } - if node == 'ExprCall': + if node in {'ComprehensionFilter', 'ExprAttr', 'CallArg', 'ExprUnaryOp'}: return { **expr, 'expr': convert_expr(expr['expr']), - 'args': lmap(convert_expr, expr['args']), } - if node in {'ComprehensionFilter', 'ExprAttr', 'CallArg', 'ExprUnaryOp'}: + if node == 'ExprSlice': + return { + **expr, + 'expr': convert_expr(expr['expr']), + 'slice': lmap(convert_expr, expr['slice']), + } + if node == 'ExprCall': return { **expr, 'expr': convert_expr(expr['expr']), + 'args': lmap(convert_expr, expr['args']), } if node == 'AtomString': expr = self.convert_string(expr, expr['string']) @@ -1614,6 +1614,17 @@ def compileExprArrayComprehension(self, node): return result + def compileExprAttr(self, node): + expr = node['expr'] + attr = node['attr'] + + if node.get('safe'): + obj = self.compile(expr) + return self.safe(node, obj, lambda: self.nullable(self.attr(node, self.extract(obj), attr)), vNull) + + obj, value = self.attribute(node, expr, attr) + return value + def compileExprIndex(self, node): exprs = node['exprs'] @@ -1668,17 +1679,6 @@ def compileExprSlice(self, node): # `CharArray_asString` is used directly, because `.join` would copy the array redundantly. return self.builder.call(self.get(node, 'CharArray_asString'), [result]) if type == tString else result - def compileExprAttr(self, node): - expr = node['expr'] - attr = node['attr'] - - if node.get('safe'): - obj = self.compile(expr) - return self.safe(node, obj, lambda: self.nullable(self.attr(node, self.extract(obj), attr)), vNull) - - obj, value = self.attribute(node, expr, attr) - return value - def compileExprCall(self, node): expr = node['expr'] diff --git a/test/bad/modules/attr02.err b/test/bad/modules/attr02.err new file mode 100644 index 00000000..9d01b302 --- /dev/null +++ b/test/bad/modules/attr02.err @@ -0,0 +1 @@ +Undeclared identifier `package`. \ No newline at end of file diff --git a/test/bad/modules/attr02.px b/test/bad/modules/attr02.px new file mode 100644 index 00000000..016bbb8e --- /dev/null +++ b/test/bad/modules/attr02.px @@ -0,0 +1,2 @@ + +print package.something