From 7af7fb26a7329ba73054e6778639fe3049f96933 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 10 Dec 2020 19:15:53 +0100 Subject: [PATCH] regen lexer --- src/main/java/lexer/StupsLexer.interp | 5 +- src/main/java/lexer/StupsLexer.java | 444 +++++++++++++------------- src/main/java/lexer/StupsLexer.tokens | 130 ++++---- 3 files changed, 289 insertions(+), 290 deletions(-) diff --git a/src/main/java/lexer/StupsLexer.interp b/src/main/java/lexer/StupsLexer.interp index 59a7f5e..79625a4 100644 --- a/src/main/java/lexer/StupsLexer.interp +++ b/src/main/java/lexer/StupsLexer.interp @@ -8,6 +8,7 @@ null 'static' 'void' 'boolean' +'int' 'String' 'if' 'else' @@ -53,6 +54,7 @@ PUBLIC STATIC VOID_TYPE BOOLEAN_TYPE +INTEGER_TYPE STRING_TYPE IF ELSE @@ -107,6 +109,7 @@ PUBLIC STATIC VOID_TYPE BOOLEAN_TYPE +INTEGER_TYPE STRING_TYPE IF ELSE @@ -150,4 +153,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 44, 330, 8, 1, 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, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 5, 6, 118, 10, 6, 3, 7, 3, 7, 5, 7, 122, 10, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 6, 12, 133, 10, 12, 13, 12, 14, 12, 134, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 143, 10, 13, 12, 13, 14, 13, 146, 11, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 157, 10, 14, 12, 14, 14, 14, 160, 11, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 5, 49, 292, 10, 49, 3, 49, 6, 49, 295, 10, 49, 13, 49, 14, 49, 296, 3, 50, 3, 50, 7, 50, 301, 10, 50, 12, 50, 14, 50, 304, 11, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 317, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 7, 53, 326, 10, 53, 12, 53, 14, 53, 329, 11, 53, 2, 2, 54, 3, 2, 5, 2, 7, 2, 9, 2, 11, 2, 13, 2, 15, 2, 17, 2, 19, 2, 21, 2, 23, 3, 25, 4, 27, 5, 29, 6, 31, 7, 33, 8, 35, 9, 37, 10, 39, 11, 41, 12, 43, 13, 45, 14, 47, 15, 49, 16, 51, 17, 53, 18, 55, 19, 57, 20, 59, 21, 61, 22, 63, 23, 65, 24, 67, 25, 69, 26, 71, 27, 73, 28, 75, 29, 77, 30, 79, 31, 81, 32, 83, 33, 85, 34, 87, 35, 89, 36, 91, 37, 93, 38, 95, 39, 97, 40, 99, 41, 101, 42, 103, 43, 105, 44, 3, 2, 9, 3, 2, 51, 59, 3, 2, 50, 59, 3, 2, 99, 124, 3, 2, 67, 92, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 2, 129, 4, 2, 12, 12, 15, 15, 2, 329, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 3, 107, 3, 2, 2, 2, 5, 109, 3, 2, 2, 2, 7, 111, 3, 2, 2, 2, 9, 113, 3, 2, 2, 2, 11, 117, 3, 2, 2, 2, 13, 121, 3, 2, 2, 2, 15, 123, 3, 2, 2, 2, 17, 125, 3, 2, 2, 2, 19, 127, 3, 2, 2, 2, 21, 129, 3, 2, 2, 2, 23, 132, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 152, 3, 2, 2, 2, 29, 163, 3, 2, 2, 2, 31, 169, 3, 2, 2, 2, 33, 176, 3, 2, 2, 2, 35, 183, 3, 2, 2, 2, 37, 188, 3, 2, 2, 2, 39, 196, 3, 2, 2, 2, 41, 203, 3, 2, 2, 2, 43, 206, 3, 2, 2, 2, 45, 211, 3, 2, 2, 2, 47, 217, 3, 2, 2, 2, 49, 236, 3, 2, 2, 2, 51, 238, 3, 2, 2, 2, 53, 240, 3, 2, 2, 2, 55, 242, 3, 2, 2, 2, 57, 244, 3, 2, 2, 2, 59, 246, 3, 2, 2, 2, 61, 248, 3, 2, 2, 2, 63, 251, 3, 2, 2, 2, 65, 254, 3, 2, 2, 2, 67, 257, 3, 2, 2, 2, 69, 260, 3, 2, 2, 2, 71, 262, 3, 2, 2, 2, 73, 265, 3, 2, 2, 2, 75, 267, 3, 2, 2, 2, 77, 270, 3, 2, 2, 2, 79, 272, 3, 2, 2, 2, 81, 274, 3, 2, 2, 2, 83, 276, 3, 2, 2, 2, 85, 278, 3, 2, 2, 2, 87, 280, 3, 2, 2, 2, 89, 282, 3, 2, 2, 2, 91, 284, 3, 2, 2, 2, 93, 286, 3, 2, 2, 2, 95, 288, 3, 2, 2, 2, 97, 291, 3, 2, 2, 2, 99, 298, 3, 2, 2, 2, 101, 316, 3, 2, 2, 2, 103, 318, 3, 2, 2, 2, 105, 323, 3, 2, 2, 2, 107, 108, 9, 2, 2, 2, 108, 4, 3, 2, 2, 2, 109, 110, 9, 3, 2, 2, 110, 6, 3, 2, 2, 2, 111, 112, 9, 4, 2, 2, 112, 8, 3, 2, 2, 2, 113, 114, 9, 5, 2, 2, 114, 10, 3, 2, 2, 2, 115, 118, 5, 7, 4, 2, 116, 118, 5, 9, 5, 2, 117, 115, 3, 2, 2, 2, 117, 116, 3, 2, 2, 2, 118, 12, 3, 2, 2, 2, 119, 122, 5, 11, 6, 2, 120, 122, 5, 5, 3, 2, 121, 119, 3, 2, 2, 2, 121, 120, 3, 2, 2, 2, 122, 14, 3, 2, 2, 2, 123, 124, 9, 6, 2, 2, 124, 16, 3, 2, 2, 2, 125, 126, 9, 7, 2, 2, 126, 18, 3, 2, 2, 2, 127, 128, 10, 8, 2, 2, 128, 20, 3, 2, 2, 2, 129, 130, 10, 6, 2, 2, 130, 22, 3, 2, 2, 2, 131, 133, 5, 15, 8, 2, 132, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 132, 3, 2, 2, 2, 134, 135, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 137, 8, 12, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 49, 2, 2, 139, 140, 7, 44, 2, 2, 140, 144, 3, 2, 2, 2, 141, 143, 5, 17, 9, 2, 142, 141, 3, 2, 2, 2, 143, 146, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 147, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 147, 148, 7, 44, 2, 2, 148, 149, 7, 49, 2, 2, 149, 150, 3, 2, 2, 2, 150, 151, 8, 13, 2, 2, 151, 26, 3, 2, 2, 2, 152, 153, 7, 49, 2, 2, 153, 154, 7, 49, 2, 2, 154, 158, 3, 2, 2, 2, 155, 157, 5, 19, 10, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 161, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 162, 8, 14, 2, 2, 162, 28, 3, 2, 2, 2, 163, 164, 7, 101, 2, 2, 164, 165, 7, 110, 2, 2, 165, 166, 7, 99, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 117, 2, 2, 168, 30, 3, 2, 2, 2, 169, 170, 7, 114, 2, 2, 170, 171, 7, 119, 2, 2, 171, 172, 7, 100, 2, 2, 172, 173, 7, 110, 2, 2, 173, 174, 7, 107, 2, 2, 174, 175, 7, 101, 2, 2, 175, 32, 3, 2, 2, 2, 176, 177, 7, 117, 2, 2, 177, 178, 7, 118, 2, 2, 178, 179, 7, 99, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 107, 2, 2, 181, 182, 7, 101, 2, 2, 182, 34, 3, 2, 2, 2, 183, 184, 7, 120, 2, 2, 184, 185, 7, 113, 2, 2, 185, 186, 7, 107, 2, 2, 186, 187, 7, 102, 2, 2, 187, 36, 3, 2, 2, 2, 188, 189, 7, 100, 2, 2, 189, 190, 7, 113, 2, 2, 190, 191, 7, 113, 2, 2, 191, 192, 7, 110, 2, 2, 192, 193, 7, 103, 2, 2, 193, 194, 7, 99, 2, 2, 194, 195, 7, 112, 2, 2, 195, 38, 3, 2, 2, 2, 196, 197, 7, 85, 2, 2, 197, 198, 7, 118, 2, 2, 198, 199, 7, 116, 2, 2, 199, 200, 7, 107, 2, 2, 200, 201, 7, 112, 2, 2, 201, 202, 7, 105, 2, 2, 202, 40, 3, 2, 2, 2, 203, 204, 7, 107, 2, 2, 204, 205, 7, 104, 2, 2, 205, 42, 3, 2, 2, 2, 206, 207, 7, 103, 2, 2, 207, 208, 7, 110, 2, 2, 208, 209, 7, 117, 2, 2, 209, 210, 7, 103, 2, 2, 210, 44, 3, 2, 2, 2, 211, 212, 7, 121, 2, 2, 212, 213, 7, 106, 2, 2, 213, 214, 7, 107, 2, 2, 214, 215, 7, 110, 2, 2, 215, 216, 7, 103, 2, 2, 216, 46, 3, 2, 2, 2, 217, 218, 7, 85, 2, 2, 218, 219, 7, 123, 2, 2, 219, 220, 7, 117, 2, 2, 220, 221, 7, 118, 2, 2, 221, 222, 7, 103, 2, 2, 222, 223, 7, 111, 2, 2, 223, 224, 7, 48, 2, 2, 224, 225, 7, 113, 2, 2, 225, 226, 7, 119, 2, 2, 226, 227, 7, 118, 2, 2, 227, 228, 7, 48, 2, 2, 228, 229, 7, 114, 2, 2, 229, 230, 7, 116, 2, 2, 230, 231, 7, 107, 2, 2, 231, 232, 7, 112, 2, 2, 232, 233, 7, 118, 2, 2, 233, 234, 7, 110, 2, 2, 234, 235, 7, 112, 2, 2, 235, 48, 3, 2, 2, 2, 236, 237, 7, 45, 2, 2, 237, 50, 3, 2, 2, 2, 238, 239, 7, 47, 2, 2, 239, 52, 3, 2, 2, 2, 240, 241, 7, 44, 2, 2, 241, 54, 3, 2, 2, 2, 242, 243, 7, 49, 2, 2, 243, 56, 3, 2, 2, 2, 244, 245, 7, 39, 2, 2, 245, 58, 3, 2, 2, 2, 246, 247, 7, 35, 2, 2, 247, 60, 3, 2, 2, 2, 248, 249, 7, 40, 2, 2, 249, 250, 7, 40, 2, 2, 250, 62, 3, 2, 2, 2, 251, 252, 7, 126, 2, 2, 252, 253, 7, 126, 2, 2, 253, 64, 3, 2, 2, 2, 254, 255, 7, 63, 2, 2, 255, 256, 7, 63, 2, 2, 256, 66, 3, 2, 2, 2, 257, 258, 7, 35, 2, 2, 258, 259, 7, 63, 2, 2, 259, 68, 3, 2, 2, 2, 260, 261, 7, 62, 2, 2, 261, 70, 3, 2, 2, 2, 262, 263, 7, 62, 2, 2, 263, 264, 7, 63, 2, 2, 264, 72, 3, 2, 2, 2, 265, 266, 7, 64, 2, 2, 266, 74, 3, 2, 2, 2, 267, 268, 7, 64, 2, 2, 268, 269, 7, 63, 2, 2, 269, 76, 3, 2, 2, 2, 270, 271, 7, 63, 2, 2, 271, 78, 3, 2, 2, 2, 272, 273, 7, 42, 2, 2, 273, 80, 3, 2, 2, 2, 274, 275, 7, 43, 2, 2, 275, 82, 3, 2, 2, 2, 276, 277, 7, 125, 2, 2, 277, 84, 3, 2, 2, 2, 278, 279, 7, 127, 2, 2, 279, 86, 3, 2, 2, 2, 280, 281, 7, 93, 2, 2, 281, 88, 3, 2, 2, 2, 282, 283, 7, 95, 2, 2, 283, 90, 3, 2, 2, 2, 284, 285, 7, 61, 2, 2, 285, 92, 3, 2, 2, 2, 286, 287, 7, 46, 2, 2, 287, 94, 3, 2, 2, 2, 288, 289, 7, 48, 2, 2, 289, 96, 3, 2, 2, 2, 290, 292, 7, 47, 2, 2, 291, 290, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 294, 3, 2, 2, 2, 293, 295, 5, 5, 3, 2, 294, 293, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 98, 3, 2, 2, 2, 298, 302, 7, 36, 2, 2, 299, 301, 5, 19, 10, 2, 300, 299, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 306, 7, 36, 2, 2, 306, 100, 3, 2, 2, 2, 307, 308, 7, 118, 2, 2, 308, 309, 7, 116, 2, 2, 309, 310, 7, 119, 2, 2, 310, 317, 7, 103, 2, 2, 311, 312, 7, 104, 2, 2, 312, 313, 7, 99, 2, 2, 313, 314, 7, 110, 2, 2, 314, 315, 7, 117, 2, 2, 315, 317, 7, 103, 2, 2, 316, 307, 3, 2, 2, 2, 316, 311, 3, 2, 2, 2, 317, 102, 3, 2, 2, 2, 318, 319, 7, 111, 2, 2, 319, 320, 7, 99, 2, 2, 320, 321, 7, 107, 2, 2, 321, 322, 7, 112, 2, 2, 322, 104, 3, 2, 2, 2, 323, 327, 5, 11, 6, 2, 324, 326, 5, 13, 7, 2, 325, 324, 3, 2, 2, 2, 326, 329, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 106, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 13, 2, 117, 121, 134, 144, 158, 291, 296, 302, 316, 327, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 45, 333, 8, 1, 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, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 5, 6, 120, 10, 6, 3, 7, 3, 7, 5, 7, 124, 10, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 6, 12, 135, 10, 12, 13, 12, 14, 12, 136, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 145, 10, 13, 12, 13, 14, 13, 148, 11, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 159, 10, 14, 12, 14, 14, 14, 162, 11, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 6, 50, 298, 10, 50, 13, 50, 14, 50, 299, 3, 51, 3, 51, 7, 51, 304, 10, 51, 12, 51, 14, 51, 307, 11, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, 320, 10, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 7, 54, 329, 10, 54, 12, 54, 14, 54, 332, 11, 54, 2, 2, 55, 3, 2, 5, 2, 7, 2, 9, 2, 11, 2, 13, 2, 15, 2, 17, 2, 19, 2, 21, 2, 23, 3, 25, 4, 27, 5, 29, 6, 31, 7, 33, 8, 35, 9, 37, 10, 39, 11, 41, 12, 43, 13, 45, 14, 47, 15, 49, 16, 51, 17, 53, 18, 55, 19, 57, 20, 59, 21, 61, 22, 63, 23, 65, 24, 67, 25, 69, 26, 71, 27, 73, 28, 75, 29, 77, 30, 79, 31, 81, 32, 83, 33, 85, 34, 87, 35, 89, 36, 91, 37, 93, 38, 95, 39, 97, 40, 99, 41, 101, 42, 103, 43, 105, 44, 107, 45, 3, 2, 9, 3, 2, 51, 59, 3, 2, 50, 59, 3, 2, 99, 124, 3, 2, 67, 92, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 2, 129, 4, 2, 12, 12, 15, 15, 2, 331, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 3, 109, 3, 2, 2, 2, 5, 111, 3, 2, 2, 2, 7, 113, 3, 2, 2, 2, 9, 115, 3, 2, 2, 2, 11, 119, 3, 2, 2, 2, 13, 123, 3, 2, 2, 2, 15, 125, 3, 2, 2, 2, 17, 127, 3, 2, 2, 2, 19, 129, 3, 2, 2, 2, 21, 131, 3, 2, 2, 2, 23, 134, 3, 2, 2, 2, 25, 140, 3, 2, 2, 2, 27, 154, 3, 2, 2, 2, 29, 165, 3, 2, 2, 2, 31, 171, 3, 2, 2, 2, 33, 178, 3, 2, 2, 2, 35, 185, 3, 2, 2, 2, 37, 190, 3, 2, 2, 2, 39, 198, 3, 2, 2, 2, 41, 202, 3, 2, 2, 2, 43, 209, 3, 2, 2, 2, 45, 212, 3, 2, 2, 2, 47, 217, 3, 2, 2, 2, 49, 223, 3, 2, 2, 2, 51, 242, 3, 2, 2, 2, 53, 244, 3, 2, 2, 2, 55, 246, 3, 2, 2, 2, 57, 248, 3, 2, 2, 2, 59, 250, 3, 2, 2, 2, 61, 252, 3, 2, 2, 2, 63, 254, 3, 2, 2, 2, 65, 257, 3, 2, 2, 2, 67, 260, 3, 2, 2, 2, 69, 263, 3, 2, 2, 2, 71, 266, 3, 2, 2, 2, 73, 268, 3, 2, 2, 2, 75, 271, 3, 2, 2, 2, 77, 273, 3, 2, 2, 2, 79, 276, 3, 2, 2, 2, 81, 278, 3, 2, 2, 2, 83, 280, 3, 2, 2, 2, 85, 282, 3, 2, 2, 2, 87, 284, 3, 2, 2, 2, 89, 286, 3, 2, 2, 2, 91, 288, 3, 2, 2, 2, 93, 290, 3, 2, 2, 2, 95, 292, 3, 2, 2, 2, 97, 294, 3, 2, 2, 2, 99, 297, 3, 2, 2, 2, 101, 301, 3, 2, 2, 2, 103, 319, 3, 2, 2, 2, 105, 321, 3, 2, 2, 2, 107, 326, 3, 2, 2, 2, 109, 110, 9, 2, 2, 2, 110, 4, 3, 2, 2, 2, 111, 112, 9, 3, 2, 2, 112, 6, 3, 2, 2, 2, 113, 114, 9, 4, 2, 2, 114, 8, 3, 2, 2, 2, 115, 116, 9, 5, 2, 2, 116, 10, 3, 2, 2, 2, 117, 120, 5, 7, 4, 2, 118, 120, 5, 9, 5, 2, 119, 117, 3, 2, 2, 2, 119, 118, 3, 2, 2, 2, 120, 12, 3, 2, 2, 2, 121, 124, 5, 11, 6, 2, 122, 124, 5, 5, 3, 2, 123, 121, 3, 2, 2, 2, 123, 122, 3, 2, 2, 2, 124, 14, 3, 2, 2, 2, 125, 126, 9, 6, 2, 2, 126, 16, 3, 2, 2, 2, 127, 128, 9, 7, 2, 2, 128, 18, 3, 2, 2, 2, 129, 130, 10, 8, 2, 2, 130, 20, 3, 2, 2, 2, 131, 132, 10, 6, 2, 2, 132, 22, 3, 2, 2, 2, 133, 135, 5, 15, 8, 2, 134, 133, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 8, 12, 2, 2, 139, 24, 3, 2, 2, 2, 140, 141, 7, 49, 2, 2, 141, 142, 7, 44, 2, 2, 142, 146, 3, 2, 2, 2, 143, 145, 5, 17, 9, 2, 144, 143, 3, 2, 2, 2, 145, 148, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 146, 147, 3, 2, 2, 2, 147, 149, 3, 2, 2, 2, 148, 146, 3, 2, 2, 2, 149, 150, 7, 44, 2, 2, 150, 151, 7, 49, 2, 2, 151, 152, 3, 2, 2, 2, 152, 153, 8, 13, 2, 2, 153, 26, 3, 2, 2, 2, 154, 155, 7, 49, 2, 2, 155, 156, 7, 49, 2, 2, 156, 160, 3, 2, 2, 2, 157, 159, 5, 19, 10, 2, 158, 157, 3, 2, 2, 2, 159, 162, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 163, 3, 2, 2, 2, 162, 160, 3, 2, 2, 2, 163, 164, 8, 14, 2, 2, 164, 28, 3, 2, 2, 2, 165, 166, 7, 101, 2, 2, 166, 167, 7, 110, 2, 2, 167, 168, 7, 99, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 117, 2, 2, 170, 30, 3, 2, 2, 2, 171, 172, 7, 114, 2, 2, 172, 173, 7, 119, 2, 2, 173, 174, 7, 100, 2, 2, 174, 175, 7, 110, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 101, 2, 2, 177, 32, 3, 2, 2, 2, 178, 179, 7, 117, 2, 2, 179, 180, 7, 118, 2, 2, 180, 181, 7, 99, 2, 2, 181, 182, 7, 118, 2, 2, 182, 183, 7, 107, 2, 2, 183, 184, 7, 101, 2, 2, 184, 34, 3, 2, 2, 2, 185, 186, 7, 120, 2, 2, 186, 187, 7, 113, 2, 2, 187, 188, 7, 107, 2, 2, 188, 189, 7, 102, 2, 2, 189, 36, 3, 2, 2, 2, 190, 191, 7, 100, 2, 2, 191, 192, 7, 113, 2, 2, 192, 193, 7, 113, 2, 2, 193, 194, 7, 110, 2, 2, 194, 195, 7, 103, 2, 2, 195, 196, 7, 99, 2, 2, 196, 197, 7, 112, 2, 2, 197, 38, 3, 2, 2, 2, 198, 199, 7, 107, 2, 2, 199, 200, 7, 112, 2, 2, 200, 201, 7, 118, 2, 2, 201, 40, 3, 2, 2, 2, 202, 203, 7, 85, 2, 2, 203, 204, 7, 118, 2, 2, 204, 205, 7, 116, 2, 2, 205, 206, 7, 107, 2, 2, 206, 207, 7, 112, 2, 2, 207, 208, 7, 105, 2, 2, 208, 42, 3, 2, 2, 2, 209, 210, 7, 107, 2, 2, 210, 211, 7, 104, 2, 2, 211, 44, 3, 2, 2, 2, 212, 213, 7, 103, 2, 2, 213, 214, 7, 110, 2, 2, 214, 215, 7, 117, 2, 2, 215, 216, 7, 103, 2, 2, 216, 46, 3, 2, 2, 2, 217, 218, 7, 121, 2, 2, 218, 219, 7, 106, 2, 2, 219, 220, 7, 107, 2, 2, 220, 221, 7, 110, 2, 2, 221, 222, 7, 103, 2, 2, 222, 48, 3, 2, 2, 2, 223, 224, 7, 85, 2, 2, 224, 225, 7, 123, 2, 2, 225, 226, 7, 117, 2, 2, 226, 227, 7, 118, 2, 2, 227, 228, 7, 103, 2, 2, 228, 229, 7, 111, 2, 2, 229, 230, 7, 48, 2, 2, 230, 231, 7, 113, 2, 2, 231, 232, 7, 119, 2, 2, 232, 233, 7, 118, 2, 2, 233, 234, 7, 48, 2, 2, 234, 235, 7, 114, 2, 2, 235, 236, 7, 116, 2, 2, 236, 237, 7, 107, 2, 2, 237, 238, 7, 112, 2, 2, 238, 239, 7, 118, 2, 2, 239, 240, 7, 110, 2, 2, 240, 241, 7, 112, 2, 2, 241, 50, 3, 2, 2, 2, 242, 243, 7, 45, 2, 2, 243, 52, 3, 2, 2, 2, 244, 245, 7, 47, 2, 2, 245, 54, 3, 2, 2, 2, 246, 247, 7, 44, 2, 2, 247, 56, 3, 2, 2, 2, 248, 249, 7, 49, 2, 2, 249, 58, 3, 2, 2, 2, 250, 251, 7, 39, 2, 2, 251, 60, 3, 2, 2, 2, 252, 253, 7, 35, 2, 2, 253, 62, 3, 2, 2, 2, 254, 255, 7, 40, 2, 2, 255, 256, 7, 40, 2, 2, 256, 64, 3, 2, 2, 2, 257, 258, 7, 126, 2, 2, 258, 259, 7, 126, 2, 2, 259, 66, 3, 2, 2, 2, 260, 261, 7, 63, 2, 2, 261, 262, 7, 63, 2, 2, 262, 68, 3, 2, 2, 2, 263, 264, 7, 35, 2, 2, 264, 265, 7, 63, 2, 2, 265, 70, 3, 2, 2, 2, 266, 267, 7, 62, 2, 2, 267, 72, 3, 2, 2, 2, 268, 269, 7, 62, 2, 2, 269, 270, 7, 63, 2, 2, 270, 74, 3, 2, 2, 2, 271, 272, 7, 64, 2, 2, 272, 76, 3, 2, 2, 2, 273, 274, 7, 64, 2, 2, 274, 275, 7, 63, 2, 2, 275, 78, 3, 2, 2, 2, 276, 277, 7, 63, 2, 2, 277, 80, 3, 2, 2, 2, 278, 279, 7, 42, 2, 2, 279, 82, 3, 2, 2, 2, 280, 281, 7, 43, 2, 2, 281, 84, 3, 2, 2, 2, 282, 283, 7, 125, 2, 2, 283, 86, 3, 2, 2, 2, 284, 285, 7, 127, 2, 2, 285, 88, 3, 2, 2, 2, 286, 287, 7, 93, 2, 2, 287, 90, 3, 2, 2, 2, 288, 289, 7, 95, 2, 2, 289, 92, 3, 2, 2, 2, 290, 291, 7, 61, 2, 2, 291, 94, 3, 2, 2, 2, 292, 293, 7, 46, 2, 2, 293, 96, 3, 2, 2, 2, 294, 295, 7, 48, 2, 2, 295, 98, 3, 2, 2, 2, 296, 298, 5, 5, 3, 2, 297, 296, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 100, 3, 2, 2, 2, 301, 305, 7, 36, 2, 2, 302, 304, 5, 19, 10, 2, 303, 302, 3, 2, 2, 2, 304, 307, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 308, 309, 7, 36, 2, 2, 309, 102, 3, 2, 2, 2, 310, 311, 7, 118, 2, 2, 311, 312, 7, 116, 2, 2, 312, 313, 7, 119, 2, 2, 313, 320, 7, 103, 2, 2, 314, 315, 7, 104, 2, 2, 315, 316, 7, 99, 2, 2, 316, 317, 7, 110, 2, 2, 317, 318, 7, 117, 2, 2, 318, 320, 7, 103, 2, 2, 319, 310, 3, 2, 2, 2, 319, 314, 3, 2, 2, 2, 320, 104, 3, 2, 2, 2, 321, 322, 7, 111, 2, 2, 322, 323, 7, 99, 2, 2, 323, 324, 7, 107, 2, 2, 324, 325, 7, 112, 2, 2, 325, 106, 3, 2, 2, 2, 326, 330, 5, 11, 6, 2, 327, 329, 5, 13, 7, 2, 328, 327, 3, 2, 2, 2, 329, 332, 3, 2, 2, 2, 330, 328, 3, 2, 2, 2, 330, 331, 3, 2, 2, 2, 331, 108, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 12, 2, 119, 123, 136, 146, 160, 299, 305, 319, 330, 3, 8, 2, 2] \ No newline at end of file diff --git a/src/main/java/lexer/StupsLexer.java b/src/main/java/lexer/StupsLexer.java index 6283dab..1af1e6a 100644 --- a/src/main/java/lexer/StupsLexer.java +++ b/src/main/java/lexer/StupsLexer.java @@ -2,251 +2,245 @@ package lexer; -import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.RuntimeMetaData; -import org.antlr.v4.runtime.Vocabulary; -import org.antlr.v4.runtime.VocabularyImpl; -import org.antlr.v4.runtime.atn.ATN; -import org.antlr.v4.runtime.atn.ATNDeserializer; -import org.antlr.v4.runtime.atn.LexerATNSimulator; -import org.antlr.v4.runtime.atn.PredictionContextCache; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class StupsLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); } - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - public static final int - WHITESPACE = 1, MULTILINE_COMMENT = 2, LINE_COMMENT = 3, CLASS = 4, PUBLIC = 5, - STATIC = 6, VOID_TYPE = 7, BOOLEAN_TYPE = 8, STRING_TYPE = 9, IF = 10, ELSE = 11, - WHILE = 12, PRINTLN = 13, ADD = 14, SUB = 15, MUL = 16, DIV = 17, MOD = 18, NOT = 19, - AND = 20, OR = 21, EQUAL = 22, NOT_EQUAL = 23, LESS = 24, LESS_EQUAL = 25, GREATER = 26, - GREATER_EQUAL = 27, ASSIGN = 28, L_PAREN = 29, R_PAREN = 30, L_BRACE = 31, R_BRACE = 32, - L_BRACKET = 33, R_BRACKET = 34, SEMICOLON = 35, COMMA = 36, DOT = 37, INTEGER_LIT = 38, - STRING_LIT = 39, BOOLEAN_LIT = 40, IDENTIFIER_MAIN = 41, IDENTIFIER = 42; - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + WHITESPACE=1, MULTILINE_COMMENT=2, LINE_COMMENT=3, CLASS=4, PUBLIC=5, + STATIC=6, VOID_TYPE=7, BOOLEAN_TYPE=8, INTEGER_TYPE=9, STRING_TYPE=10, + IF=11, ELSE=12, WHILE=13, PRINTLN=14, ADD=15, SUB=16, MUL=17, DIV=18, + MOD=19, NOT=20, AND=21, OR=22, EQUAL=23, NOT_EQUAL=24, LESS=25, LESS_EQUAL=26, + GREATER=27, GREATER_EQUAL=28, ASSIGN=29, L_PAREN=30, R_PAREN=31, L_BRACE=32, + R_BRACE=33, L_BRACKET=34, R_BRACKET=35, SEMICOLON=36, COMMA=37, DOT=38, + INTEGER_LIT=39, STRING_LIT=40, BOOLEAN_LIT=41, IDENTIFIER_MAIN=42, IDENTIFIER=43; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; - public static final String[] ruleNames = makeRuleNames(); - public static String[] modeNames = { - "DEFAULT_MODE" - }; + public static String[] modeNames = { + "DEFAULT_MODE" + }; - static { - RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); - } + private static String[] makeRuleNames() { + return new String[] { + "FIRST_DIGIT", "DIGIT", "LOWERCASE", "UPPERCASE", "LETTER", "LETTER_DIGIT", + "WHITE", "ANY", "ANY_NOBREAK", "ANY_NOWHITE", "WHITESPACE", "MULTILINE_COMMENT", + "LINE_COMMENT", "CLASS", "PUBLIC", "STATIC", "VOID_TYPE", "BOOLEAN_TYPE", + "INTEGER_TYPE", "STRING_TYPE", "IF", "ELSE", "WHILE", "PRINTLN", "ADD", + "SUB", "MUL", "DIV", "MOD", "NOT", "AND", "OR", "EQUAL", "NOT_EQUAL", + "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "ASSIGN", "L_PAREN", + "R_PAREN", "L_BRACE", "R_BRACE", "L_BRACKET", "R_BRACKET", "SEMICOLON", + "COMMA", "DOT", "INTEGER_LIT", "STRING_LIT", "BOOLEAN_LIT", "IDENTIFIER_MAIN", + "IDENTIFIER" + }; + } + public static final String[] ruleNames = makeRuleNames(); - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, null, "'class'", "'public'", "'static'", "'void'", + "'boolean'", "'int'", "'String'", "'if'", "'else'", "'while'", "'System.out.println'", + "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'&&'", "'||'", "'=='", "'!='", + "'<'", "'<='", "'>'", "'>='", "'='", "'('", "')'", "'{'", "'}'", "'['", + "']'", "';'", "','", "'.'", null, null, null, "'main'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "WHITESPACE", "MULTILINE_COMMENT", "LINE_COMMENT", "CLASS", "PUBLIC", + "STATIC", "VOID_TYPE", "BOOLEAN_TYPE", "INTEGER_TYPE", "STRING_TYPE", + "IF", "ELSE", "WHILE", "PRINTLN", "ADD", "SUB", "MUL", "DIV", "MOD", + "NOT", "AND", "OR", "EQUAL", "NOT_EQUAL", "LESS", "LESS_EQUAL", "GREATER", + "GREATER_EQUAL", "ASSIGN", "L_PAREN", "R_PAREN", "L_BRACE", "R_BRACE", + "L_BRACKET", "R_BRACKET", "SEMICOLON", "COMMA", "DOT", "INTEGER_LIT", + "STRING_LIT", "BOOLEAN_LIT", "IDENTIFIER_MAIN", "IDENTIFIER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } - public StupsLexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); - } + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } - private static String[] makeRuleNames() { - return new String[]{ - "FIRST_DIGIT", "DIGIT", "LOWERCASE", "UPPERCASE", "LETTER", "LETTER_DIGIT", - "WHITE", "ANY", "ANY_NOBREAK", "ANY_NOWHITE", "WHITESPACE", "MULTILINE_COMMENT", - "LINE_COMMENT", "CLASS", "PUBLIC", "STATIC", "VOID_TYPE", "BOOLEAN_TYPE", - "STRING_TYPE", "IF", "ELSE", "WHILE", "PRINTLN", "ADD", "SUB", "MUL", - "DIV", "MOD", "NOT", "AND", "OR", "EQUAL", "NOT_EQUAL", "LESS", "LESS_EQUAL", - "GREATER", "GREATER_EQUAL", "ASSIGN", "L_PAREN", "R_PAREN", "L_BRACE", - "R_BRACE", "L_BRACKET", "R_BRACKET", "SEMICOLON", "COMMA", "DOT", "INTEGER_LIT", - "STRING_LIT", "BOOLEAN_LIT", "IDENTIFIER_MAIN", "IDENTIFIER" - }; - } + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; + @Override - private static String[] makeLiteralNames() { - return new String[]{ - null, null, null, null, "'class'", "'public'", "'static'", "'void'", - "'boolean'", "'String'", "'if'", "'else'", "'while'", "'System.out.println'", - "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'&&'", "'||'", "'=='", "'!='", - "'<'", "'<='", "'>'", "'>='", "'='", "'('", "')'", "'{'", "'}'", "'['", - "']'", "';'", "','", "'.'", null, null, null, "'main'" - }; - } + public Vocabulary getVocabulary() { + return VOCABULARY; + } - private static String[] makeSymbolicNames() { - return new String[]{ - null, "WHITESPACE", "MULTILINE_COMMENT", "LINE_COMMENT", "CLASS", "PUBLIC", - "STATIC", "VOID_TYPE", "BOOLEAN_TYPE", "STRING_TYPE", "IF", "ELSE", "WHILE", - "PRINTLN", "ADD", "SUB", "MUL", "DIV", "MOD", "NOT", "AND", "OR", "EQUAL", - "NOT_EQUAL", "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "ASSIGN", - "L_PAREN", "R_PAREN", "L_BRACE", "R_BRACE", "L_BRACKET", "R_BRACKET", - "SEMICOLON", "COMMA", "DOT", "INTEGER_LIT", "STRING_LIT", "BOOLEAN_LIT", - "IDENTIFIER_MAIN", "IDENTIFIER" - }; - } - @Override - public String[] getRuleNames() { return ruleNames; } + public StupsLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } - @Override + @Override + public String getGrammarFileName() { return "StupsLexer.g4"; } - public Vocabulary getVocabulary() { - return VOCABULARY; - } + @Override + public String[] getRuleNames() { return ruleNames; } - @Override - public String getSerializedATN() { return _serializedATN; } + @Override + public String getSerializedATN() { return _serializedATN; } - @Override - public String getGrammarFileName() { return "StupsLexer.g4"; } + @Override + public String[] getChannelNames() { return channelNames; } - @Override - public ATN getATN() { return _ATN; } + @Override + public String[] getModeNames() { return modeNames; } - @Override - public String[] getChannelNames() { return channelNames; } + @Override + public ATN getATN() { return _ATN; } - @Override - public String[] getModeNames() { return modeNames; } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2,\u014a\b\1\4\2\t" + - "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13" + - "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22" + - "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31" + - "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!" + - "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4" + - ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t" + - "\64\4\65\t\65\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\5\6v\n\6\3\7\3\7" + - "\5\7z\n\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13\3\13\3\f\6\f\u0085\n\f\r\f\16\f" + - "\u0086\3\f\3\f\3\r\3\r\3\r\3\r\7\r\u008f\n\r\f\r\16\r\u0092\13\r\3\r\3" + - "\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\7\16\u009d\n\16\f\16\16\16\u00a0\13" + - "\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3" + - "\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3" + - "\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3" + - "\24\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3" + - "\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3" + - "\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3" + - "\35\3\35\3\36\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3\"\3\"\3\"\3#\3#" + - "\3$\3$\3$\3%\3%\3&\3&\3&\3\'\3\'\3(\3(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3" + - ".\3.\3/\3/\3\60\3\60\3\61\5\61\u0124\n\61\3\61\6\61\u0127\n\61\r\61\16" + - "\61\u0128\3\62\3\62\7\62\u012d\n\62\f\62\16\62\u0130\13\62\3\62\3\62\3" + - "\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\5\63\u013d\n\63\3\64\3\64" + - "\3\64\3\64\3\64\3\65\3\65\7\65\u0146\n\65\f\65\16\65\u0149\13\65\2\2\66" + - "\3\2\5\2\7\2\t\2\13\2\r\2\17\2\21\2\23\2\25\2\27\3\31\4\33\5\35\6\37\7" + - "!\b#\t%\n\'\13)\f+\r-\16/\17\61\20\63\21\65\22\67\239\24;\25=\26?\27A" + - "\30C\31E\32G\33I\34K\35M\36O\37Q S!U\"W#Y$[%]&_\'a(c)e*g+i,\3\2\t\3\2" + - "\63;\3\2\62;\3\2c|\3\2C\\\5\2\13\f\17\17\"\"\3\2\2\u0081\4\2\f\f\17\17" + - "\2\u0149\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2" + - "\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2" + - "\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3" + - "\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2" + - "\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2" + - "Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3" + - "\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2" + - "\2\3k\3\2\2\2\5m\3\2\2\2\7o\3\2\2\2\tq\3\2\2\2\13u\3\2\2\2\ry\3\2\2\2" + - "\17{\3\2\2\2\21}\3\2\2\2\23\177\3\2\2\2\25\u0081\3\2\2\2\27\u0084\3\2" + - "\2\2\31\u008a\3\2\2\2\33\u0098\3\2\2\2\35\u00a3\3\2\2\2\37\u00a9\3\2\2" + - "\2!\u00b0\3\2\2\2#\u00b7\3\2\2\2%\u00bc\3\2\2\2\'\u00c4\3\2\2\2)\u00cb" + - "\3\2\2\2+\u00ce\3\2\2\2-\u00d3\3\2\2\2/\u00d9\3\2\2\2\61\u00ec\3\2\2\2" + - "\63\u00ee\3\2\2\2\65\u00f0\3\2\2\2\67\u00f2\3\2\2\29\u00f4\3\2\2\2;\u00f6" + - "\3\2\2\2=\u00f8\3\2\2\2?\u00fb\3\2\2\2A\u00fe\3\2\2\2C\u0101\3\2\2\2E" + - "\u0104\3\2\2\2G\u0106\3\2\2\2I\u0109\3\2\2\2K\u010b\3\2\2\2M\u010e\3\2" + - "\2\2O\u0110\3\2\2\2Q\u0112\3\2\2\2S\u0114\3\2\2\2U\u0116\3\2\2\2W\u0118" + - "\3\2\2\2Y\u011a\3\2\2\2[\u011c\3\2\2\2]\u011e\3\2\2\2_\u0120\3\2\2\2a" + - "\u0123\3\2\2\2c\u012a\3\2\2\2e\u013c\3\2\2\2g\u013e\3\2\2\2i\u0143\3\2" + - "\2\2kl\t\2\2\2l\4\3\2\2\2mn\t\3\2\2n\6\3\2\2\2op\t\4\2\2p\b\3\2\2\2qr" + - "\t\5\2\2r\n\3\2\2\2sv\5\7\4\2tv\5\t\5\2us\3\2\2\2ut\3\2\2\2v\f\3\2\2\2" + - "wz\5\13\6\2xz\5\5\3\2yw\3\2\2\2yx\3\2\2\2z\16\3\2\2\2{|\t\6\2\2|\20\3" + - "\2\2\2}~\t\7\2\2~\22\3\2\2\2\177\u0080\n\b\2\2\u0080\24\3\2\2\2\u0081" + - "\u0082\n\6\2\2\u0082\26\3\2\2\2\u0083\u0085\5\17\b\2\u0084\u0083\3\2\2" + - "\2\u0085\u0086\3\2\2\2\u0086\u0084\3\2\2\2\u0086\u0087\3\2\2\2\u0087\u0088" + - "\3\2\2\2\u0088\u0089\b\f\2\2\u0089\30\3\2\2\2\u008a\u008b\7\61\2\2\u008b" + - "\u008c\7,\2\2\u008c\u0090\3\2\2\2\u008d\u008f\5\21\t\2\u008e\u008d\3\2" + - "\2\2\u008f\u0092\3\2\2\2\u0090\u008e\3\2\2\2\u0090\u0091\3\2\2\2\u0091" + - "\u0093\3\2\2\2\u0092\u0090\3\2\2\2\u0093\u0094\7,\2\2\u0094\u0095\7\61" + - "\2\2\u0095\u0096\3\2\2\2\u0096\u0097\b\r\2\2\u0097\32\3\2\2\2\u0098\u0099" + - "\7\61\2\2\u0099\u009a\7\61\2\2\u009a\u009e\3\2\2\2\u009b\u009d\5\23\n" + - "\2\u009c\u009b\3\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3\2\2\2\u009e\u009f" + - "\3\2\2\2\u009f\u00a1\3\2\2\2\u00a0\u009e\3\2\2\2\u00a1\u00a2\b\16\2\2" + - "\u00a2\34\3\2\2\2\u00a3\u00a4\7e\2\2\u00a4\u00a5\7n\2\2\u00a5\u00a6\7" + - "c\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8\7u\2\2\u00a8\36\3\2\2\2\u00a9\u00aa" + - "\7r\2\2\u00aa\u00ab\7w\2\2\u00ab\u00ac\7d\2\2\u00ac\u00ad\7n\2\2\u00ad" + - "\u00ae\7k\2\2\u00ae\u00af\7e\2\2\u00af \3\2\2\2\u00b0\u00b1\7u\2\2\u00b1" + - "\u00b2\7v\2\2\u00b2\u00b3\7c\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5\7k\2\2" + - "\u00b5\u00b6\7e\2\2\u00b6\"\3\2\2\2\u00b7\u00b8\7x\2\2\u00b8\u00b9\7q" + - "\2\2\u00b9\u00ba\7k\2\2\u00ba\u00bb\7f\2\2\u00bb$\3\2\2\2\u00bc\u00bd" + - "\7d\2\2\u00bd\u00be\7q\2\2\u00be\u00bf\7q\2\2\u00bf\u00c0\7n\2\2\u00c0" + - "\u00c1\7g\2\2\u00c1\u00c2\7c\2\2\u00c2\u00c3\7p\2\2\u00c3&\3\2\2\2\u00c4" + - "\u00c5\7U\2\2\u00c5\u00c6\7v\2\2\u00c6\u00c7\7t\2\2\u00c7\u00c8\7k\2\2" + - "\u00c8\u00c9\7p\2\2\u00c9\u00ca\7i\2\2\u00ca(\3\2\2\2\u00cb\u00cc\7k\2" + - "\2\u00cc\u00cd\7h\2\2\u00cd*\3\2\2\2\u00ce\u00cf\7g\2\2\u00cf\u00d0\7" + - "n\2\2\u00d0\u00d1\7u\2\2\u00d1\u00d2\7g\2\2\u00d2,\3\2\2\2\u00d3\u00d4" + - "\7y\2\2\u00d4\u00d5\7j\2\2\u00d5\u00d6\7k\2\2\u00d6\u00d7\7n\2\2\u00d7" + - "\u00d8\7g\2\2\u00d8.\3\2\2\2\u00d9\u00da\7U\2\2\u00da\u00db\7{\2\2\u00db" + - "\u00dc\7u\2\2\u00dc\u00dd\7v\2\2\u00dd\u00de\7g\2\2\u00de\u00df\7o\2\2" + - "\u00df\u00e0\7\60\2\2\u00e0\u00e1\7q\2\2\u00e1\u00e2\7w\2\2\u00e2\u00e3" + - "\7v\2\2\u00e3\u00e4\7\60\2\2\u00e4\u00e5\7r\2\2\u00e5\u00e6\7t\2\2\u00e6" + - "\u00e7\7k\2\2\u00e7\u00e8\7p\2\2\u00e8\u00e9\7v\2\2\u00e9\u00ea\7n\2\2" + - "\u00ea\u00eb\7p\2\2\u00eb\60\3\2\2\2\u00ec\u00ed\7-\2\2\u00ed\62\3\2\2" + - "\2\u00ee\u00ef\7/\2\2\u00ef\64\3\2\2\2\u00f0\u00f1\7,\2\2\u00f1\66\3\2" + - "\2\2\u00f2\u00f3\7\61\2\2\u00f38\3\2\2\2\u00f4\u00f5\7\'\2\2\u00f5:\3" + - "\2\2\2\u00f6\u00f7\7#\2\2\u00f7<\3\2\2\2\u00f8\u00f9\7(\2\2\u00f9\u00fa" + - "\7(\2\2\u00fa>\3\2\2\2\u00fb\u00fc\7~\2\2\u00fc\u00fd\7~\2\2\u00fd@\3" + - "\2\2\2\u00fe\u00ff\7?\2\2\u00ff\u0100\7?\2\2\u0100B\3\2\2\2\u0101\u0102" + - "\7#\2\2\u0102\u0103\7?\2\2\u0103D\3\2\2\2\u0104\u0105\7>\2\2\u0105F\3" + - "\2\2\2\u0106\u0107\7>\2\2\u0107\u0108\7?\2\2\u0108H\3\2\2\2\u0109\u010a" + - "\7@\2\2\u010aJ\3\2\2\2\u010b\u010c\7@\2\2\u010c\u010d\7?\2\2\u010dL\3" + - "\2\2\2\u010e\u010f\7?\2\2\u010fN\3\2\2\2\u0110\u0111\7*\2\2\u0111P\3\2" + - "\2\2\u0112\u0113\7+\2\2\u0113R\3\2\2\2\u0114\u0115\7}\2\2\u0115T\3\2\2" + - "\2\u0116\u0117\7\177\2\2\u0117V\3\2\2\2\u0118\u0119\7]\2\2\u0119X\3\2" + - "\2\2\u011a\u011b\7_\2\2\u011bZ\3\2\2\2\u011c\u011d\7=\2\2\u011d\\\3\2" + - "\2\2\u011e\u011f\7.\2\2\u011f^\3\2\2\2\u0120\u0121\7\60\2\2\u0121`\3\2" + - "\2\2\u0122\u0124\7/\2\2\u0123\u0122\3\2\2\2\u0123\u0124\3\2\2\2\u0124" + - "\u0126\3\2\2\2\u0125\u0127\5\5\3\2\u0126\u0125\3\2\2\2\u0127\u0128\3\2" + - "\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129b\3\2\2\2\u012a\u012e" + - "\7$\2\2\u012b\u012d\5\23\n\2\u012c\u012b\3\2\2\2\u012d\u0130\3\2\2\2\u012e" + - "\u012c\3\2\2\2\u012e\u012f\3\2\2\2\u012f\u0131\3\2\2\2\u0130\u012e\3\2" + - "\2\2\u0131\u0132\7$\2\2\u0132d\3\2\2\2\u0133\u0134\7v\2\2\u0134\u0135" + - "\7t\2\2\u0135\u0136\7w\2\2\u0136\u013d\7g\2\2\u0137\u0138\7h\2\2\u0138" + - "\u0139\7c\2\2\u0139\u013a\7n\2\2\u013a\u013b\7u\2\2\u013b\u013d\7g\2\2" + - "\u013c\u0133\3\2\2\2\u013c\u0137\3\2\2\2\u013df\3\2\2\2\u013e\u013f\7" + - "o\2\2\u013f\u0140\7c\2\2\u0140\u0141\7k\2\2\u0141\u0142\7p\2\2\u0142h" + - "\3\2\2\2\u0143\u0147\5\13\6\2\u0144\u0146\5\r\7\2\u0145\u0144\3\2\2\2" + - "\u0146\u0149\3\2\2\2\u0147\u0145\3\2\2\2\u0147\u0148\3\2\2\2\u0148j\3" + - "\2\2\2\u0149\u0147\3\2\2\2\r\2uy\u0086\u0090\u009e\u0123\u0128\u012e\u013c" + - "\u0147\3\b\2\2"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2-\u014d\b\1\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ + "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\5\6x\n"+ + "\6\3\7\3\7\5\7|\n\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13\3\13\3\f\6\f\u0087\n"+ + "\f\r\f\16\f\u0088\3\f\3\f\3\r\3\r\3\r\3\r\7\r\u0091\n\r\f\r\16\r\u0094"+ + "\13\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\7\16\u009f\n\16\f\16\16"+ + "\16\u00a2\13\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20"+ + "\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22"+ + "\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24"+ + "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\27\3\27\3\27\3\27"+ + "\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31"+ + "\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32"+ + "\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3!\3!\3!\3"+ + "\"\3\"\3\"\3#\3#\3#\3$\3$\3%\3%\3%\3&\3&\3\'\3\'\3\'\3(\3(\3)\3)\3*\3"+ + "*\3+\3+\3,\3,\3-\3-\3.\3.\3/\3/\3\60\3\60\3\61\3\61\3\62\6\62\u012a\n"+ + "\62\r\62\16\62\u012b\3\63\3\63\7\63\u0130\n\63\f\63\16\63\u0133\13\63"+ + "\3\63\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\5\64\u0140\n\64"+ + "\3\65\3\65\3\65\3\65\3\65\3\66\3\66\7\66\u0149\n\66\f\66\16\66\u014c\13"+ + "\66\2\2\67\3\2\5\2\7\2\t\2\13\2\r\2\17\2\21\2\23\2\25\2\27\3\31\4\33\5"+ + "\35\6\37\7!\b#\t%\n\'\13)\f+\r-\16/\17\61\20\63\21\65\22\67\239\24;\25"+ + "=\26?\27A\30C\31E\32G\33I\34K\35M\36O\37Q S!U\"W#Y$[%]&_\'a(c)e*g+i,k"+ + "-\3\2\t\3\2\63;\3\2\62;\3\2c|\3\2C\\\5\2\13\f\17\17\"\"\3\2\2\u0081\4"+ + "\2\f\f\17\17\2\u014b\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2"+ + "\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2"+ + "\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2"+ + "\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2"+ + "\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2"+ + "O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3"+ + "\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2"+ + "\2\2i\3\2\2\2\2k\3\2\2\2\3m\3\2\2\2\5o\3\2\2\2\7q\3\2\2\2\ts\3\2\2\2\13"+ + "w\3\2\2\2\r{\3\2\2\2\17}\3\2\2\2\21\177\3\2\2\2\23\u0081\3\2\2\2\25\u0083"+ + "\3\2\2\2\27\u0086\3\2\2\2\31\u008c\3\2\2\2\33\u009a\3\2\2\2\35\u00a5\3"+ + "\2\2\2\37\u00ab\3\2\2\2!\u00b2\3\2\2\2#\u00b9\3\2\2\2%\u00be\3\2\2\2\'"+ + "\u00c6\3\2\2\2)\u00ca\3\2\2\2+\u00d1\3\2\2\2-\u00d4\3\2\2\2/\u00d9\3\2"+ + "\2\2\61\u00df\3\2\2\2\63\u00f2\3\2\2\2\65\u00f4\3\2\2\2\67\u00f6\3\2\2"+ + "\29\u00f8\3\2\2\2;\u00fa\3\2\2\2=\u00fc\3\2\2\2?\u00fe\3\2\2\2A\u0101"+ + "\3\2\2\2C\u0104\3\2\2\2E\u0107\3\2\2\2G\u010a\3\2\2\2I\u010c\3\2\2\2K"+ + "\u010f\3\2\2\2M\u0111\3\2\2\2O\u0114\3\2\2\2Q\u0116\3\2\2\2S\u0118\3\2"+ + "\2\2U\u011a\3\2\2\2W\u011c\3\2\2\2Y\u011e\3\2\2\2[\u0120\3\2\2\2]\u0122"+ + "\3\2\2\2_\u0124\3\2\2\2a\u0126\3\2\2\2c\u0129\3\2\2\2e\u012d\3\2\2\2g"+ + "\u013f\3\2\2\2i\u0141\3\2\2\2k\u0146\3\2\2\2mn\t\2\2\2n\4\3\2\2\2op\t"+ + "\3\2\2p\6\3\2\2\2qr\t\4\2\2r\b\3\2\2\2st\t\5\2\2t\n\3\2\2\2ux\5\7\4\2"+ + "vx\5\t\5\2wu\3\2\2\2wv\3\2\2\2x\f\3\2\2\2y|\5\13\6\2z|\5\5\3\2{y\3\2\2"+ + "\2{z\3\2\2\2|\16\3\2\2\2}~\t\6\2\2~\20\3\2\2\2\177\u0080\t\7\2\2\u0080"+ + "\22\3\2\2\2\u0081\u0082\n\b\2\2\u0082\24\3\2\2\2\u0083\u0084\n\6\2\2\u0084"+ + "\26\3\2\2\2\u0085\u0087\5\17\b\2\u0086\u0085\3\2\2\2\u0087\u0088\3\2\2"+ + "\2\u0088\u0086\3\2\2\2\u0088\u0089\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008b"+ + "\b\f\2\2\u008b\30\3\2\2\2\u008c\u008d\7\61\2\2\u008d\u008e\7,\2\2\u008e"+ + "\u0092\3\2\2\2\u008f\u0091\5\21\t\2\u0090\u008f\3\2\2\2\u0091\u0094\3"+ + "\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3\2\2\2\u0093\u0095\3\2\2\2\u0094"+ + "\u0092\3\2\2\2\u0095\u0096\7,\2\2\u0096\u0097\7\61\2\2\u0097\u0098\3\2"+ + "\2\2\u0098\u0099\b\r\2\2\u0099\32\3\2\2\2\u009a\u009b\7\61\2\2\u009b\u009c"+ + "\7\61\2\2\u009c\u00a0\3\2\2\2\u009d\u009f\5\23\n\2\u009e\u009d\3\2\2\2"+ + "\u009f\u00a2\3\2\2\2\u00a0\u009e\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a3"+ + "\3\2\2\2\u00a2\u00a0\3\2\2\2\u00a3\u00a4\b\16\2\2\u00a4\34\3\2\2\2\u00a5"+ + "\u00a6\7e\2\2\u00a6\u00a7\7n\2\2\u00a7\u00a8\7c\2\2\u00a8\u00a9\7u\2\2"+ + "\u00a9\u00aa\7u\2\2\u00aa\36\3\2\2\2\u00ab\u00ac\7r\2\2\u00ac\u00ad\7"+ + "w\2\2\u00ad\u00ae\7d\2\2\u00ae\u00af\7n\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1"+ + "\7e\2\2\u00b1 \3\2\2\2\u00b2\u00b3\7u\2\2\u00b3\u00b4\7v\2\2\u00b4\u00b5"+ + "\7c\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7\7k\2\2\u00b7\u00b8\7e\2\2\u00b8"+ + "\"\3\2\2\2\u00b9\u00ba\7x\2\2\u00ba\u00bb\7q\2\2\u00bb\u00bc\7k\2\2\u00bc"+ + "\u00bd\7f\2\2\u00bd$\3\2\2\2\u00be\u00bf\7d\2\2\u00bf\u00c0\7q\2\2\u00c0"+ + "\u00c1\7q\2\2\u00c1\u00c2\7n\2\2\u00c2\u00c3\7g\2\2\u00c3\u00c4\7c\2\2"+ + "\u00c4\u00c5\7p\2\2\u00c5&\3\2\2\2\u00c6\u00c7\7k\2\2\u00c7\u00c8\7p\2"+ + "\2\u00c8\u00c9\7v\2\2\u00c9(\3\2\2\2\u00ca\u00cb\7U\2\2\u00cb\u00cc\7"+ + "v\2\2\u00cc\u00cd\7t\2\2\u00cd\u00ce\7k\2\2\u00ce\u00cf\7p\2\2\u00cf\u00d0"+ + "\7i\2\2\u00d0*\3\2\2\2\u00d1\u00d2\7k\2\2\u00d2\u00d3\7h\2\2\u00d3,\3"+ + "\2\2\2\u00d4\u00d5\7g\2\2\u00d5\u00d6\7n\2\2\u00d6\u00d7\7u\2\2\u00d7"+ + "\u00d8\7g\2\2\u00d8.\3\2\2\2\u00d9\u00da\7y\2\2\u00da\u00db\7j\2\2\u00db"+ + "\u00dc\7k\2\2\u00dc\u00dd\7n\2\2\u00dd\u00de\7g\2\2\u00de\60\3\2\2\2\u00df"+ + "\u00e0\7U\2\2\u00e0\u00e1\7{\2\2\u00e1\u00e2\7u\2\2\u00e2\u00e3\7v\2\2"+ + "\u00e3\u00e4\7g\2\2\u00e4\u00e5\7o\2\2\u00e5\u00e6\7\60\2\2\u00e6\u00e7"+ + "\7q\2\2\u00e7\u00e8\7w\2\2\u00e8\u00e9\7v\2\2\u00e9\u00ea\7\60\2\2\u00ea"+ + "\u00eb\7r\2\2\u00eb\u00ec\7t\2\2\u00ec\u00ed\7k\2\2\u00ed\u00ee\7p\2\2"+ + "\u00ee\u00ef\7v\2\2\u00ef\u00f0\7n\2\2\u00f0\u00f1\7p\2\2\u00f1\62\3\2"+ + "\2\2\u00f2\u00f3\7-\2\2\u00f3\64\3\2\2\2\u00f4\u00f5\7/\2\2\u00f5\66\3"+ + "\2\2\2\u00f6\u00f7\7,\2\2\u00f78\3\2\2\2\u00f8\u00f9\7\61\2\2\u00f9:\3"+ + "\2\2\2\u00fa\u00fb\7\'\2\2\u00fb<\3\2\2\2\u00fc\u00fd\7#\2\2\u00fd>\3"+ + "\2\2\2\u00fe\u00ff\7(\2\2\u00ff\u0100\7(\2\2\u0100@\3\2\2\2\u0101\u0102"+ + "\7~\2\2\u0102\u0103\7~\2\2\u0103B\3\2\2\2\u0104\u0105\7?\2\2\u0105\u0106"+ + "\7?\2\2\u0106D\3\2\2\2\u0107\u0108\7#\2\2\u0108\u0109\7?\2\2\u0109F\3"+ + "\2\2\2\u010a\u010b\7>\2\2\u010bH\3\2\2\2\u010c\u010d\7>\2\2\u010d\u010e"+ + "\7?\2\2\u010eJ\3\2\2\2\u010f\u0110\7@\2\2\u0110L\3\2\2\2\u0111\u0112\7"+ + "@\2\2\u0112\u0113\7?\2\2\u0113N\3\2\2\2\u0114\u0115\7?\2\2\u0115P\3\2"+ + "\2\2\u0116\u0117\7*\2\2\u0117R\3\2\2\2\u0118\u0119\7+\2\2\u0119T\3\2\2"+ + "\2\u011a\u011b\7}\2\2\u011bV\3\2\2\2\u011c\u011d\7\177\2\2\u011dX\3\2"+ + "\2\2\u011e\u011f\7]\2\2\u011fZ\3\2\2\2\u0120\u0121\7_\2\2\u0121\\\3\2"+ + "\2\2\u0122\u0123\7=\2\2\u0123^\3\2\2\2\u0124\u0125\7.\2\2\u0125`\3\2\2"+ + "\2\u0126\u0127\7\60\2\2\u0127b\3\2\2\2\u0128\u012a\5\5\3\2\u0129\u0128"+ + "\3\2\2\2\u012a\u012b\3\2\2\2\u012b\u0129\3\2\2\2\u012b\u012c\3\2\2\2\u012c"+ + "d\3\2\2\2\u012d\u0131\7$\2\2\u012e\u0130\5\23\n\2\u012f\u012e\3\2\2\2"+ + "\u0130\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0134"+ + "\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0135\7$\2\2\u0135f\3\2\2\2\u0136\u0137"+ + "\7v\2\2\u0137\u0138\7t\2\2\u0138\u0139\7w\2\2\u0139\u0140\7g\2\2\u013a"+ + "\u013b\7h\2\2\u013b\u013c\7c\2\2\u013c\u013d\7n\2\2\u013d\u013e\7u\2\2"+ + "\u013e\u0140\7g\2\2\u013f\u0136\3\2\2\2\u013f\u013a\3\2\2\2\u0140h\3\2"+ + "\2\2\u0141\u0142\7o\2\2\u0142\u0143\7c\2\2\u0143\u0144\7k\2\2\u0144\u0145"+ + "\7p\2\2\u0145j\3\2\2\2\u0146\u014a\5\13\6\2\u0147\u0149\5\r\7\2\u0148"+ + "\u0147\3\2\2\2\u0149\u014c\3\2\2\2\u014a\u0148\3\2\2\2\u014a\u014b\3\2"+ + "\2\2\u014bl\3\2\2\2\u014c\u014a\3\2\2\2\f\2w{\u0088\u0092\u00a0\u012b"+ + "\u0131\u013f\u014a\3\b\2\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/lexer/StupsLexer.tokens b/src/main/java/lexer/StupsLexer.tokens index e7d125f..73f51b7 100644 --- a/src/main/java/lexer/StupsLexer.tokens +++ b/src/main/java/lexer/StupsLexer.tokens @@ -6,72 +6,74 @@ PUBLIC=5 STATIC=6 VOID_TYPE=7 BOOLEAN_TYPE=8 -STRING_TYPE=9 -IF=10 -ELSE=11 -WHILE=12 -PRINTLN=13 -ADD=14 -SUB=15 -MUL=16 -DIV=17 -MOD=18 -NOT=19 -AND=20 -OR=21 -EQUAL=22 -NOT_EQUAL=23 -LESS=24 -LESS_EQUAL=25 -GREATER=26 -GREATER_EQUAL=27 -ASSIGN=28 -L_PAREN=29 -R_PAREN=30 -L_BRACE=31 -R_BRACE=32 -L_BRACKET=33 -R_BRACKET=34 -SEMICOLON=35 -COMMA=36 -DOT=37 -INTEGER_LIT=38 -STRING_LIT=39 -BOOLEAN_LIT=40 -IDENTIFIER_MAIN=41 -IDENTIFIER=42 +INTEGER_TYPE=9 +STRING_TYPE=10 +IF=11 +ELSE=12 +WHILE=13 +PRINTLN=14 +ADD=15 +SUB=16 +MUL=17 +DIV=18 +MOD=19 +NOT=20 +AND=21 +OR=22 +EQUAL=23 +NOT_EQUAL=24 +LESS=25 +LESS_EQUAL=26 +GREATER=27 +GREATER_EQUAL=28 +ASSIGN=29 +L_PAREN=30 +R_PAREN=31 +L_BRACE=32 +R_BRACE=33 +L_BRACKET=34 +R_BRACKET=35 +SEMICOLON=36 +COMMA=37 +DOT=38 +INTEGER_LIT=39 +STRING_LIT=40 +BOOLEAN_LIT=41 +IDENTIFIER_MAIN=42 +IDENTIFIER=43 'class'=4 'public'=5 'static'=6 'void'=7 'boolean'=8 -'String'=9 -'if'=10 -'else'=11 -'while'=12 -'System.out.println'=13 -'+'=14 -'-'=15 -'*'=16 -'/'=17 -'%'=18 -'!'=19 -'&&'=20 -'||'=21 -'=='=22 -'!='=23 -'<'=24 -'<='=25 -'>'=26 -'>='=27 -'='=28 -'('=29 -')'=30 -'{'=31 -'}'=32 -'['=33 -']'=34 -';'=35 -','=36 -'.'=37 -'main'=41 +'int'=9 +'String'=10 +'if'=11 +'else'=12 +'while'=13 +'System.out.println'=14 +'+'=15 +'-'=16 +'*'=17 +'/'=18 +'%'=19 +'!'=20 +'&&'=21 +'||'=22 +'=='=23 +'!='=24 +'<'=25 +'<='=26 +'>'=27 +'>='=28 +'='=29 +'('=30 +')'=31 +'{'=32 +'}'=33 +'['=34 +']'=35 +';'=36 +','=37 +'.'=38 +'main'=42