diff --git a/lib/lrama/parser.rb b/lib/lrama/parser.rb index f1e17768..9dbec95e 100644 --- a/lib/lrama/parser.rb +++ b/lib/lrama/parser.rb @@ -654,7 +654,7 @@ def token_to_str(t) module Lrama class Parser < Racc::Parser -module_eval(<<'...end parser.y/module_eval...', 'parser.y', 551) +module_eval(<<'...end parser.y/module_eval...', 'parser.y', 552) include Lrama::Report::Duration @@ -728,74 +728,74 @@ def raise_parse_error(error_message, location) ##### State transition tables begin ### racc_action_table = [ - 100, 160, 101, 52, 161, 215, 52, 80, 227, 52, - 80, 215, 52, 80, 51, 52, 80, 215, 52, 80, - 51, 52, 80, 51, 3, 52, 71, 184, 52, 80, - 184, 52, 80, 167, 8, 80, 89, 52, 52, 167, - 51, 80, 185, 83, 52, 185, 51, 188, 169, 83, - 161, 102, 220, 221, 169, 220, 221, 234, 220, 221, - 235, 220, 221, 46, 220, 221, 40, 220, 221, 186, - 187, -128, 186, 187, 90, 170, 193, 194, 195, 254, - 47, 170, 235, 22, 24, 25, 26, 27, 28, 29, + 100, 160, 101, 52, 161, 217, 52, 80, 230, 52, + 80, 217, 52, 80, 51, 52, 80, 217, 52, 80, + 51, 52, 80, 51, 3, 52, 71, 186, 52, 80, + 186, 52, 80, 167, 8, 80, 89, 52, 52, 167, + 51, 80, 187, 83, 52, 187, 51, 190, 169, 83, + 161, 102, 222, 223, 169, 222, 223, 237, 222, 223, + 238, 222, 223, 46, 222, 223, 40, 222, 223, 188, + 189, -130, 188, 189, 90, 170, 195, 196, 197, 257, + 47, 170, 238, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 46, 6, 52, 7, 51, 94, 80, 76, 52, 52, 51, 51, 49, 83, 83, 52, 52, 51, 51, 80, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 9, 257, 46, 124, 235, 14, 15, + 35, 36, 37, 9, 260, 46, 124, 238, 14, 15, 16, 17, 18, 19, 55, 55, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 193, 194, 195, 55, 52, 98, - 51, 58, 80, 203, 52, 52, 51, 51, 80, 203, - 52, 52, 51, 51, 80, 203, 193, 194, 195, 59, - 52, 98, 51, 60, 80, 203, 52, 52, 51, 51, - 80, 203, 52, 52, 51, 51, 80, 203, 52, 52, + 35, 36, 37, 38, 195, 196, 197, 55, 52, 98, + 51, 58, 80, 205, 52, 52, 51, 51, 80, 205, + 52, 52, 51, 51, 80, 205, 195, 196, 197, 59, + 52, 98, 51, 60, 80, 205, 52, 52, 51, 51, + 80, 205, 52, 52, 51, 51, 80, 205, 52, 52, 51, 51, 80, 80, 52, 52, 51, 51, 80, 80, 52, 52, 51, 51, 80, 80, 52, 52, 51, 51, - 52, 52, 51, 51, 52, 52, 51, 51, 193, 194, - 195, 61, 62, 63, 64, 65, 66, 67, 68, 91, + 52, 52, 51, 51, 52, 52, 51, 51, 195, 196, + 197, 61, 62, 63, 64, 65, 66, 67, 68, 91, 47, 96, 98, 103, 103, 103, 105, 111, 114, 116, 119, 119, 119, 119, 122, 127, 128, 130, 132, 133, 134, 135, 136, 80, 143, 144, 145, 146, 147, 150, 151, 152, 154, 164, 143, 166, 172, 174, 175, 176, - 177, 178, 179, 181, 182, 150, 190, 198, 199, 206, - 164, 210, 213, 214, 98, 223, 164, 230, 231, 164, - 233, 179, 182, 239, 240, 242, 244, 182, 98, 249, - 179, -126, 253, 179, 98, -128, 98, 179, -127 ] + 177, 178, 179, 181, 182, 150, 192, 200, 201, 208, + 164, 212, 215, 216, 98, 225, 164, 233, 234, 164, + 236, 179, 182, 242, 243, 245, 247, 182, 98, 252, + 179, -128, 256, 179, 98, -130, 98, 179, -129 ] racc_action_check = [ - 50, 142, 50, 190, 142, 190, 210, 190, 210, 233, - 210, 233, 235, 233, 235, 240, 235, 240, 242, 240, - 242, 32, 242, 32, 1, 163, 32, 163, 207, 163, - 207, 149, 207, 149, 3, 149, 38, 189, 34, 189, - 34, 189, 163, 34, 35, 207, 35, 165, 149, 35, - 165, 50, 190, 190, 189, 210, 210, 216, 233, 233, - 216, 235, 235, 9, 240, 240, 7, 242, 242, 163, - 163, 228, 207, 207, 38, 149, 228, 228, 228, 245, - 10, 189, 245, 9, 9, 9, 9, 9, 9, 9, + 50, 142, 50, 192, 142, 192, 212, 192, 212, 236, + 212, 236, 238, 236, 238, 243, 238, 243, 245, 243, + 245, 32, 245, 32, 1, 163, 32, 163, 209, 163, + 209, 149, 209, 149, 3, 149, 38, 191, 34, 191, + 34, 191, 163, 34, 35, 209, 35, 165, 149, 35, + 165, 50, 192, 192, 191, 212, 212, 218, 236, 236, + 218, 238, 238, 9, 243, 243, 7, 245, 245, 163, + 163, 231, 209, 209, 38, 149, 231, 231, 231, 248, + 10, 191, 248, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 41, 2, 33, 2, 33, 41, 33, 33, 36, 37, 36, 37, 14, 36, 37, 75, 15, 75, 15, 75, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 4, 251, 90, 90, 251, 4, 4, + 41, 41, 41, 4, 254, 90, 90, 254, 4, 4, 4, 4, 4, 4, 16, 17, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 168, 168, 168, 18, 176, 168, 176, 19, 176, 176, 177, 70, 177, 70, 177, 177, - 178, 71, 178, 71, 178, 178, 183, 183, 183, 20, - 200, 183, 200, 22, 200, 200, 204, 82, 204, 82, - 204, 204, 205, 83, 205, 83, 205, 205, 76, 116, + 178, 71, 178, 71, 178, 178, 185, 185, 185, 20, + 202, 185, 202, 22, 202, 202, 206, 82, 206, 82, + 206, 206, 207, 83, 207, 83, 207, 207, 76, 116, 76, 116, 76, 116, 118, 140, 118, 140, 118, 140, - 170, 186, 170, 186, 170, 186, 111, 113, 111, 113, - 119, 121, 119, 121, 137, 141, 137, 141, 218, 218, - 218, 24, 25, 26, 27, 28, 29, 30, 31, 39, + 170, 188, 170, 188, 170, 188, 111, 113, 111, 113, + 119, 121, 119, 121, 137, 141, 137, 141, 220, 220, + 220, 24, 25, 26, 27, 28, 29, 30, 31, 39, 43, 44, 45, 54, 56, 57, 58, 69, 73, 74, 81, 86, 87, 88, 89, 97, 98, 104, 106, 107, 108, 109, 110, 115, 122, 123, 124, 125, 126, 127, 128, 129, 131, 144, 145, 148, 153, 155, 156, 157, 158, 159, 160, 161, 162, 166, 167, 171, 173, 180, - 182, 184, 187, 188, 192, 196, 206, 211, 213, 214, - 215, 222, 225, 226, 227, 229, 231, 232, 234, 238, - 239, 241, 243, 246, 249, 252, 253, 256, 257 ] + 182, 186, 189, 190, 194, 198, 208, 213, 215, 216, + 217, 224, 227, 229, 230, 232, 234, 235, 237, 241, + 242, 244, 246, 249, 252, 255, 256, 259, 260 ] racc_action_pointer = [ nil, 24, 89, 34, 124, nil, nil, 59, nil, 59, @@ -816,108 +816,112 @@ def raise_parse_error(error_message, location) nil, nil, nil, 265, nil, 266, 267, 268, 269, 270, 284, 288, 249, 22, nil, 6, 249, 256, 115, nil, 217, 276, nil, 277, nil, nil, 165, 171, 177, nil, - 257, nil, 254, 137, 261, nil, 218, 262, 261, 34, - 0, nil, 250, nil, nil, nil, 303, nil, nil, nil, - 187, nil, nil, nil, 193, 199, 260, 25, nil, nil, - 3, 305, nil, 303, 263, 270, 16, nil, 189, nil, - nil, nil, 303, nil, nil, 267, 272, 274, 27, 271, - nil, 275, 272, 6, 264, 9, nil, nil, 298, 312, - 12, 277, 15, 301, nil, 38, 315, nil, nil, 270, - nil, 93, 281, 272, nil, nil, 319, 284, nil, nil ] + 257, nil, 254, nil, nil, 137, 261, nil, 218, 262, + 261, 34, 0, nil, 250, nil, nil, nil, 303, nil, + nil, nil, 187, nil, nil, nil, 193, 199, 260, 25, + nil, nil, 3, 305, nil, 303, 263, 270, 16, nil, + 189, nil, nil, nil, 303, nil, nil, 267, nil, 272, + 274, 27, 271, nil, 275, 272, 6, 264, 9, nil, + nil, 298, 312, 12, 277, 15, 301, nil, 38, 315, + nil, nil, 270, nil, 93, 281, 272, nil, nil, 319, + 284, nil, nil ] racc_action_default = [ - -2, -148, -10, -148, -148, -3, -4, -148, 260, -148, - -8, -12, -13, -14, -148, -148, -148, -148, -148, -148, - -148, -26, -148, -30, -148, -148, -148, -148, -148, -148, - -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, - -7, -135, -101, -8, -148, -132, -134, -9, -11, -15, - -139, -99, -100, -138, -17, -90, -18, -19, -148, -23, + -2, -150, -10, -150, -150, -3, -4, -150, 263, -150, + -8, -12, -13, -14, -150, -150, -150, -150, -150, -150, + -150, -26, -150, -30, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -7, -137, -103, -8, -150, -134, -136, -9, -11, -15, + -141, -101, -102, -140, -17, -92, -18, -19, -150, -23, -27, -31, -34, -37, -40, -41, -42, -43, -44, -45, - -51, -148, -54, -56, -46, -80, -148, -83, -85, -86, - -147, -47, -93, -148, -96, -98, -48, -49, -50, -148, - -148, -5, -1, -102, -136, -103, -104, -148, -148, -16, - -140, -141, -142, -87, -148, -20, -148, -148, -148, -148, - -148, -148, -55, -52, -57, -78, -148, -84, -81, -148, - -97, -94, -148, -148, -148, -148, -148, -108, -148, -148, - -91, -148, -24, -28, -32, -35, -38, -53, -58, -79, - -82, -95, -148, -64, -68, -148, -6, -137, -105, -106, - -109, -133, -88, -148, -21, -148, -148, -148, -148, -148, - -59, -148, -62, -66, -69, -148, -108, -99, -132, -113, - -148, -148, -92, -148, -25, -29, -148, -148, -148, -60, - -148, -65, -68, -132, -99, -73, -148, -148, -148, -107, - -148, -110, -132, -117, -118, -119, -148, -116, -89, -22, - -33, -143, -145, -146, -36, -39, -68, -67, -70, -71, - -148, -148, -76, -148, -68, -99, -148, -124, -128, -129, - -130, -131, -59, -114, -144, -61, -148, -99, -120, -148, - -74, -148, -63, -148, -132, -148, -126, -111, -148, -59, - -148, -122, -148, -148, -77, -148, -59, -125, -128, -132, - -72, -148, -121, -132, -127, -112, -59, -123, -75, -115 ] + -51, -150, -54, -56, -46, -82, -150, -85, -87, -88, + -149, -47, -95, -150, -98, -100, -48, -49, -50, -150, + -150, -5, -1, -104, -138, -105, -106, -150, -150, -16, + -142, -143, -144, -89, -150, -20, -150, -150, -150, -150, + -150, -150, -55, -52, -57, -80, -150, -86, -83, -150, + -99, -96, -150, -150, -150, -150, -150, -110, -150, -150, + -93, -150, -24, -28, -32, -35, -38, -53, -58, -81, + -84, -97, -150, -64, -70, -150, -6, -139, -107, -108, + -111, -135, -90, -150, -21, -150, -150, -150, -150, -150, + -59, -150, -62, -66, -71, -150, -110, -101, -134, -115, + -150, -150, -94, -150, -25, -29, -150, -150, -150, -60, + -150, -65, -70, -67, -68, -134, -101, -75, -150, -150, + -150, -109, -150, -112, -134, -119, -120, -121, -150, -118, + -91, -22, -33, -145, -147, -148, -36, -39, -70, -66, + -72, -73, -150, -150, -78, -150, -70, -101, -150, -126, + -130, -131, -132, -133, -59, -116, -146, -61, -69, -150, + -101, -122, -150, -76, -150, -63, -150, -134, -150, -128, + -113, -150, -59, -150, -124, -150, -150, -79, -150, -59, + -127, -130, -134, -74, -150, -123, -134, -129, -114, -59, + -125, -77, -117 ] racc_goto_table = [ - 77, 180, 97, 75, 162, 53, 120, 48, 112, 70, - 149, 121, 42, 142, 216, 224, 247, 192, 1, 224, - 224, 2, 73, 247, 85, 85, 85, 85, 81, 86, - 87, 88, 209, 4, 229, 41, 165, 54, 56, 57, - 95, 92, 117, 77, 93, 120, 118, 141, 113, 189, - 5, 112, 200, 204, 205, 39, 125, 245, 10, 11, - 73, 73, 12, 237, 251, 120, 225, 236, 13, 50, - 99, 131, 85, 85, 232, 112, 173, 241, 106, 155, - 250, 107, 156, 77, 108, 117, 140, 255, 137, 157, - 109, 158, 110, 159, 69, 74, 138, 259, 115, 123, - 207, 73, 226, 73, 211, 243, 139, 117, 129, 85, - 171, 85, 104, 153, 148, 196, 168, 238, 126, nil, - nil, nil, nil, nil, nil, 191, nil, 73, nil, nil, - 183, 85, nil, nil, nil, nil, nil, 197, nil, nil, - 208, nil, nil, nil, nil, nil, nil, nil, nil, 222, - nil, nil, nil, 212, nil, nil, 168, 218, nil, nil, + 77, 75, 97, 162, 112, 53, 180, 70, 184, 120, + 149, 194, 48, 218, 121, 142, 250, 1, 2, 42, + 4, 41, 73, 250, 85, 85, 85, 85, 211, 92, + 226, 5, 39, 232, 226, 226, 125, 10, 165, 54, + 56, 57, 117, 77, 118, 95, 113, 112, 120, 191, + 141, 93, 11, 12, 228, 13, 50, 248, 99, 131, + 73, 73, 173, 239, 254, 106, 155, 227, 120, 107, + 240, 112, 85, 85, 244, 235, 81, 86, 87, 88, + 202, 206, 207, 77, 140, 117, 137, 156, 253, 108, + 157, 109, 158, 110, 159, 258, 69, 74, 138, 115, + 123, 73, 209, 73, 229, 262, 213, 117, 246, 85, + 139, 85, 129, 171, 104, 153, 168, 148, 198, 241, + 126, nil, nil, nil, nil, 193, nil, 73, nil, nil, + 185, 85, nil, nil, nil, nil, nil, 199, nil, nil, + nil, nil, 210, nil, nil, nil, nil, nil, nil, nil, + nil, 224, nil, nil, nil, 214, nil, nil, 168, 220, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 183, nil, nil, 228, nil, nil, + nil, nil, nil, nil, nil, nil, 185, nil, nil, 231, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 246, nil, nil, nil, nil, nil, nil, nil, nil, - 218, nil, 248, nil, nil, nil, 256, 218, nil, 252, - 258 ] + nil, nil, nil, nil, 249, nil, nil, nil, nil, nil, + nil, nil, nil, 220, nil, 251, nil, nil, nil, 259, + 220, nil, 255, 261 ] racc_goto_check = [ - 44, 41, 45, 51, 40, 36, 57, 10, 35, 34, - 61, 56, 58, 39, 62, 68, 65, 46, 1, 68, - 68, 2, 36, 65, 36, 36, 36, 36, 33, 33, - 33, 33, 46, 3, 62, 4, 39, 16, 16, 16, - 10, 5, 44, 44, 58, 57, 51, 56, 34, 61, - 6, 35, 22, 22, 22, 7, 8, 62, 9, 11, - 36, 36, 12, 41, 62, 57, 40, 46, 13, 14, - 15, 17, 36, 36, 40, 35, 18, 46, 19, 20, - 41, 23, 24, 44, 25, 44, 51, 41, 34, 26, - 27, 28, 29, 30, 31, 32, 37, 41, 38, 42, - 43, 36, 47, 36, 48, 49, 50, 44, 52, 36, - 53, 36, 54, 55, 60, 63, 44, 64, 67, nil, - nil, nil, nil, nil, nil, 45, nil, 36, nil, nil, - 44, 36, nil, nil, nil, nil, nil, 44, nil, nil, - 45, nil, nil, nil, nil, nil, nil, nil, nil, 45, - nil, nil, nil, 44, nil, nil, 44, 44, nil, nil, + 46, 53, 47, 40, 35, 36, 41, 34, 45, 59, + 63, 48, 10, 64, 58, 39, 67, 1, 2, 60, + 3, 4, 36, 67, 36, 36, 36, 36, 48, 5, + 70, 6, 7, 64, 70, 70, 8, 9, 39, 16, + 16, 16, 46, 46, 53, 10, 34, 35, 59, 63, + 58, 60, 11, 12, 45, 13, 14, 64, 15, 17, + 36, 36, 18, 48, 64, 19, 20, 40, 59, 23, + 41, 35, 36, 36, 48, 40, 33, 33, 33, 33, + 22, 22, 22, 46, 53, 46, 34, 24, 41, 25, + 26, 27, 28, 29, 30, 41, 31, 32, 37, 38, + 42, 36, 43, 36, 49, 41, 50, 46, 51, 36, + 52, 36, 54, 55, 56, 57, 46, 62, 65, 66, + 69, nil, nil, nil, nil, 47, nil, 36, nil, nil, + 46, 36, nil, nil, nil, nil, nil, 46, nil, nil, + nil, nil, 47, nil, nil, nil, nil, nil, nil, nil, + nil, 47, nil, nil, nil, 46, nil, nil, 46, 46, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 44, nil, nil, 44, nil, nil, + nil, nil, nil, nil, nil, nil, 46, nil, nil, 46, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 45, nil, nil, nil, nil, nil, nil, nil, nil, - 44, nil, 44, nil, nil, nil, 45, 44, nil, 44, - 45 ] + nil, nil, nil, nil, 47, nil, nil, nil, nil, nil, + nil, nil, nil, 46, nil, 46, nil, nil, nil, 47, + 46, nil, 46, 47 ] racc_goto_pointer = [ - nil, 18, 21, 31, 26, 0, 48, 49, -35, 54, - -3, 55, 58, 64, 54, 20, 21, -34, -78, 19, - -53, nil, -124, 21, -51, 23, -45, 28, -44, 29, - -43, 62, 62, -6, -23, -62, -10, -19, 25, -109, - -140, -159, 9, -82, -33, -43, -151, -108, -81, -125, - -9, -30, 5, -42, 57, -17, -72, -76, 3, nil, - -13, -117, -176, -54, -106, -219, nil, 24, -185 ] + nil, 17, 18, 18, 12, -12, 29, 26, -55, 33, + 2, 48, 49, 51, 41, 8, 23, -46, -92, 6, + -66, nil, -96, 9, -46, 28, -44, 29, -43, 30, + -42, 64, 64, 42, -25, -66, -10, -17, 26, -107, + -141, -154, 10, -80, nil, -155, -33, -43, -157, -108, + -81, -125, -5, -32, 9, -39, 59, -15, -69, -73, + 10, nil, -10, -117, -179, -51, -106, -222, nil, 26, + -172 ] racc_goto_default = [ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 72, 78, nil, nil, nil, - nil, nil, 45, 163, 202, nil, nil, nil, nil, nil, - 79, nil, nil, nil, nil, nil, 82, 84, nil, 43, - nil, nil, nil, nil, nil, 217, 219, nil, 201 ] + nil, nil, 45, 163, 183, nil, 204, nil, nil, nil, + nil, nil, 79, nil, nil, nil, nil, nil, 82, 84, + nil, 43, nil, nil, nil, nil, nil, 219, 221, nil, + 203 ] racc_reduce_table = [ 0, 0, :racc_error, @@ -986,92 +990,94 @@ def raise_parse_error(error_message, location) 8, 70, :_reduce_63, 1, 96, :_reduce_64, 3, 96, :_reduce_65, - 1, 97, :_reduce_66, - 3, 97, :_reduce_67, - 0, 100, :_reduce_68, - 1, 100, :_reduce_69, - 3, 100, :_reduce_70, - 3, 100, :_reduce_71, - 6, 100, :_reduce_72, - 0, 105, :_reduce_73, - 0, 106, :_reduce_74, - 7, 100, :_reduce_75, - 3, 100, :_reduce_76, - 5, 100, :_reduce_77, + 0, 102, :_reduce_none, + 1, 102, :_reduce_none, + 2, 97, :_reduce_68, + 4, 97, :_reduce_69, + 0, 100, :_reduce_70, + 1, 100, :_reduce_71, + 3, 100, :_reduce_72, + 3, 100, :_reduce_73, + 6, 100, :_reduce_74, + 0, 107, :_reduce_75, + 0, 108, :_reduce_76, + 7, 100, :_reduce_77, + 3, 100, :_reduce_78, + 4, 101, :_reduce_79, 0, 94, :_reduce_none, - 1, 94, :_reduce_79, - 1, 89, :_reduce_80, - 2, 89, :_reduce_81, - 3, 89, :_reduce_82, - 1, 108, :_reduce_83, - 2, 108, :_reduce_84, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 0, 109, :_reduce_87, - 0, 110, :_reduce_88, - 6, 73, :_reduce_89, - 0, 111, :_reduce_90, - 0, 112, :_reduce_91, - 5, 73, :_reduce_92, - 1, 90, :_reduce_93, - 2, 90, :_reduce_94, - 3, 90, :_reduce_95, - 1, 113, :_reduce_96, - 2, 113, :_reduce_97, - 1, 114, :_reduce_none, - 1, 93, :_reduce_99, - 1, 93, :_reduce_100, + 1, 94, :_reduce_81, + 1, 89, :_reduce_82, + 2, 89, :_reduce_83, + 3, 89, :_reduce_84, + 1, 110, :_reduce_85, + 2, 110, :_reduce_86, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 0, 111, :_reduce_89, + 0, 112, :_reduce_90, + 6, 73, :_reduce_91, + 0, 113, :_reduce_92, + 0, 114, :_reduce_93, + 5, 73, :_reduce_94, + 1, 90, :_reduce_95, + 2, 90, :_reduce_96, + 3, 90, :_reduce_97, + 1, 115, :_reduce_98, + 2, 115, :_reduce_99, + 1, 116, :_reduce_none, + 1, 93, :_reduce_101, + 1, 93, :_reduce_102, 1, 61, :_reduce_none, 2, 61, :_reduce_none, - 2, 115, :_reduce_none, - 2, 115, :_reduce_none, - 4, 116, :_reduce_105, - 1, 117, :_reduce_106, - 3, 117, :_reduce_107, - 0, 118, :_reduce_108, - 1, 118, :_reduce_109, - 3, 118, :_reduce_110, - 5, 118, :_reduce_111, - 7, 118, :_reduce_112, - 0, 120, :_reduce_113, - 0, 121, :_reduce_114, - 8, 118, :_reduce_115, - 3, 118, :_reduce_116, - 1, 103, :_reduce_117, - 1, 103, :_reduce_118, - 1, 103, :_reduce_119, - 1, 104, :_reduce_120, - 3, 104, :_reduce_121, - 2, 104, :_reduce_122, - 4, 104, :_reduce_123, - 1, 119, :_reduce_124, - 3, 119, :_reduce_125, - 2, 119, :_reduce_126, - 4, 119, :_reduce_127, - 1, 122, :_reduce_none, - 1, 122, :_reduce_none, - 1, 123, :_reduce_130, - 1, 123, :_reduce_131, - 0, 102, :_reduce_none, - 3, 102, :_reduce_133, + 2, 117, :_reduce_none, + 2, 117, :_reduce_none, + 4, 118, :_reduce_107, + 1, 119, :_reduce_108, + 3, 119, :_reduce_109, + 0, 120, :_reduce_110, + 1, 120, :_reduce_111, + 3, 120, :_reduce_112, + 5, 120, :_reduce_113, + 7, 120, :_reduce_114, + 0, 122, :_reduce_115, + 0, 123, :_reduce_116, + 8, 120, :_reduce_117, + 3, 120, :_reduce_118, + 1, 105, :_reduce_119, + 1, 105, :_reduce_120, + 1, 105, :_reduce_121, + 1, 106, :_reduce_122, + 3, 106, :_reduce_123, + 2, 106, :_reduce_124, + 4, 106, :_reduce_125, + 1, 121, :_reduce_126, + 3, 121, :_reduce_127, + 2, 121, :_reduce_128, + 4, 121, :_reduce_129, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 125, :_reduce_132, + 1, 125, :_reduce_133, + 0, 104, :_reduce_none, + 3, 104, :_reduce_135, 1, 99, :_reduce_none, 0, 62, :_reduce_none, - 0, 124, :_reduce_136, - 3, 62, :_reduce_137, + 0, 126, :_reduce_138, + 3, 62, :_reduce_139, 1, 71, :_reduce_none, 0, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, - 1, 79, :_reduce_143, - 2, 79, :_reduce_144, - 1, 125, :_reduce_none, - 1, 125, :_reduce_none, - 1, 107, :_reduce_147 ] + 1, 79, :_reduce_145, + 2, 79, :_reduce_146, + 1, 127, :_reduce_none, + 1, 127, :_reduce_none, + 1, 109, :_reduce_149 ] -racc_reduce_n = 148 +racc_reduce_n = 150 -racc_shift_n = 260 +racc_shift_n = 263 racc_token_table = { false => 0, @@ -1255,6 +1261,8 @@ def raise_parse_error(error_message, location) "\"-option@TAG\"", "id_colon", "rule_rhs", + "if_clause", + "\"-option@if_clause\"", "symbol", "named_ref_opt", "parameterizing_suffix", @@ -1749,26 +1757,32 @@ def _reduce_65(val, _values, result) end .,., +# reduce 66 omitted + +# reduce 67 omitted + module_eval(<<'.,.,', 'parser.y', 256) - def _reduce_66(val, _values, result) + def _reduce_68(val, _values, result) builder = val[0] + builder.symbols << val[1] if val[1] result = [builder] result end .,., -module_eval(<<'.,.,', 'parser.y', 261) - def _reduce_67(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 262) + def _reduce_69(val, _values, result) builder = val[2] + builder.symbols << val[3] if val[3] result = val[0].append(builder) result end .,., -module_eval(<<'.,.,', 'parser.y', 267) - def _reduce_68(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 269) + def _reduce_70(val, _values, result) reset_precs result = Grammar::ParameterizingRule::Rhs.new @@ -1776,8 +1790,8 @@ def _reduce_68(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 272) - def _reduce_69(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 274) + def _reduce_71(val, _values, result) reset_precs result = Grammar::ParameterizingRule::Rhs.new @@ -1785,8 +1799,8 @@ def _reduce_69(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 277) - def _reduce_70(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 279) + def _reduce_72(val, _values, result) token = val[1] token.alias_name = val[2] builder = val[0] @@ -1797,8 +1811,8 @@ def _reduce_70(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 285) - def _reduce_71(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 287) + def _reduce_73(val, _values, result) builder = val[0] builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]]) result = builder @@ -1807,8 +1821,8 @@ def _reduce_71(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 291) - def _reduce_72(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 293) + def _reduce_74(val, _values, result) builder = val[0] builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3], lhs_tag: val[5]) result = builder @@ -1817,8 +1831,8 @@ def _reduce_72(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 297) - def _reduce_73(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 299) + def _reduce_75(val, _values, result) if @prec_seen on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec @code_after_prec = true @@ -1829,16 +1843,16 @@ def _reduce_73(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 305) - def _reduce_74(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 307) + def _reduce_76(val, _values, result) end_c_declaration result end .,., -module_eval(<<'.,.,', 'parser.y', 309) - def _reduce_75(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 311) + def _reduce_77(val, _values, result) user_code = val[3] user_code.alias_name = val[6] builder = val[0] @@ -1849,8 +1863,8 @@ def _reduce_75(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 317) - def _reduce_76(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 319) + def _reduce_78(val, _values, result) sym = @grammar.find_symbol_by_id!(val[2]) @prec_seen = true builder = val[0] @@ -1861,179 +1875,177 @@ def _reduce_76(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 325) - def _reduce_77(val, _values, result) - builder = val[0] - builder.symbols << Lrama::Lexer::Token::ControlSyntax.new(s_value: val[1], location: @lexer.location, condition: val[3]) - result = builder +module_eval(<<'.,.,', 'parser.y', 328) + def _reduce_79(val, _values, result) + result = Lrama::Lexer::Token::ControlSyntax.new(s_value: val[0], location: @lexer.location, condition: val[2]) result end .,., -# reduce 78 omitted +# reduce 80 omitted -module_eval(<<'.,.,', 'parser.y', 331) - def _reduce_79(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 332) + def _reduce_81(val, _values, result) result = val[0].s_value result end .,., -module_eval(<<'.,.,', 'parser.y', 335) - def _reduce_80(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 336) + def _reduce_82(val, _values, result) result = [{tag: nil, tokens: val[0]}] result end .,., -module_eval(<<'.,.,', 'parser.y', 339) - def _reduce_81(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 340) + def _reduce_83(val, _values, result) result = [{tag: val[0], tokens: val[1]}] result end .,., -module_eval(<<'.,.,', 'parser.y', 343) - def _reduce_82(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 344) + def _reduce_84(val, _values, result) result = val[0].append({tag: val[1], tokens: val[2]}) result end .,., -module_eval(<<'.,.,', 'parser.y', 346) - def _reduce_83(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 347) + def _reduce_85(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 347) - def _reduce_84(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 348) + def _reduce_86(val, _values, result) result = val[0].append(val[1]) result end .,., -# reduce 85 omitted +# reduce 87 omitted -# reduce 86 omitted +# reduce 88 omitted -module_eval(<<'.,.,', 'parser.y', 354) - def _reduce_87(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 355) + def _reduce_89(val, _values, result) begin_c_declaration("}") result end .,., -module_eval(<<'.,.,', 'parser.y', 358) - def _reduce_88(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 359) + def _reduce_90(val, _values, result) end_c_declaration result end .,., -module_eval(<<'.,.,', 'parser.y', 362) - def _reduce_89(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 363) + def _reduce_91(val, _values, result) result = val[0].append(val[3]) result end .,., -module_eval(<<'.,.,', 'parser.y', 366) - def _reduce_90(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 367) + def _reduce_92(val, _values, result) begin_c_declaration("}") result end .,., -module_eval(<<'.,.,', 'parser.y', 370) - def _reduce_91(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 371) + def _reduce_93(val, _values, result) end_c_declaration result end .,., -module_eval(<<'.,.,', 'parser.y', 374) - def _reduce_92(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 375) + def _reduce_94(val, _values, result) result = [val[2]] result end .,., -module_eval(<<'.,.,', 'parser.y', 379) - def _reduce_93(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 380) + def _reduce_95(val, _values, result) result = [{tag: nil, tokens: val[0]}] result end .,., -module_eval(<<'.,.,', 'parser.y', 383) - def _reduce_94(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 384) + def _reduce_96(val, _values, result) result = [{tag: val[0], tokens: val[1]}] result end .,., -module_eval(<<'.,.,', 'parser.y', 387) - def _reduce_95(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 388) + def _reduce_97(val, _values, result) result = val[0].append({tag: val[1], tokens: val[2]}) result end .,., -module_eval(<<'.,.,', 'parser.y', 390) - def _reduce_96(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 391) + def _reduce_98(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 391) - def _reduce_97(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 392) + def _reduce_99(val, _values, result) result = val[0].append(val[1]) result end .,., -# reduce 98 omitted +# reduce 100 omitted -module_eval(<<'.,.,', 'parser.y', 395) - def _reduce_99(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 396) + def _reduce_101(val, _values, result) on_action_error("ident after %prec", val[0]) if @prec_seen result end .,., -module_eval(<<'.,.,', 'parser.y', 396) - def _reduce_100(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 397) + def _reduce_102(val, _values, result) on_action_error("char after %prec", val[0]) if @prec_seen result end .,., -# reduce 101 omitted - -# reduce 102 omitted - # reduce 103 omitted # reduce 104 omitted -module_eval(<<'.,.,', 'parser.y', 406) - def _reduce_105(val, _values, result) +# reduce 105 omitted + +# reduce 106 omitted + +module_eval(<<'.,.,', 'parser.y', 407) + def _reduce_107(val, _values, result) lhs = val[0] lhs.alias_name = val[1] val[3].each do |builder| @@ -2046,8 +2058,8 @@ def _reduce_105(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 417) - def _reduce_106(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 418) + def _reduce_108(val, _values, result) builder = val[0] if !builder.line builder.line = @lexer.line - 1 @@ -2058,8 +2070,8 @@ def _reduce_106(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 425) - def _reduce_107(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 426) + def _reduce_109(val, _values, result) builder = val[2] if !builder.line builder.line = @lexer.line - 1 @@ -2070,8 +2082,8 @@ def _reduce_107(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 434) - def _reduce_108(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 435) + def _reduce_110(val, _values, result) reset_precs result = @grammar.create_rule_builder(@rule_counter, @midrule_action_counter) @@ -2079,8 +2091,8 @@ def _reduce_108(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 439) - def _reduce_109(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 440) + def _reduce_111(val, _values, result) reset_precs result = @grammar.create_rule_builder(@rule_counter, @midrule_action_counter) @@ -2088,8 +2100,8 @@ def _reduce_109(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 444) - def _reduce_110(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 445) + def _reduce_112(val, _values, result) token = val[1] token.alias_name = val[2] builder = val[0] @@ -2100,8 +2112,8 @@ def _reduce_110(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 452) - def _reduce_111(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 453) + def _reduce_113(val, _values, result) token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], alias_name: val[3], location: @lexer.location, args: [val[1]], lhs_tag: val[4]) builder = val[0] builder.add_rhs(token) @@ -2112,8 +2124,8 @@ def _reduce_111(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 460) - def _reduce_112(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 461) + def _reduce_114(val, _values, result) token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, alias_name: val[5], location: @lexer.location, args: val[3], lhs_tag: val[6]) builder = val[0] builder.add_rhs(token) @@ -2124,8 +2136,8 @@ def _reduce_112(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 468) - def _reduce_113(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 469) + def _reduce_115(val, _values, result) if @prec_seen on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec @code_after_prec = true @@ -2136,16 +2148,16 @@ def _reduce_113(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 476) - def _reduce_114(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 477) + def _reduce_116(val, _values, result) end_c_declaration result end .,., -module_eval(<<'.,.,', 'parser.y', 480) - def _reduce_115(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 481) + def _reduce_117(val, _values, result) user_code = val[3] user_code.alias_name = val[6] user_code.tag = val[7] @@ -2157,8 +2169,8 @@ def _reduce_115(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 489) - def _reduce_116(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 490) + def _reduce_118(val, _values, result) sym = @grammar.find_symbol_by_id!(val[2]) @prec_seen = true builder = val[0] @@ -2169,116 +2181,116 @@ def _reduce_116(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 496) - def _reduce_117(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 497) + def _reduce_119(val, _values, result) result = "option" result end .,., -module_eval(<<'.,.,', 'parser.y', 497) - def _reduce_118(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 498) + def _reduce_120(val, _values, result) result = "nonempty_list" result end .,., -module_eval(<<'.,.,', 'parser.y', 498) - def _reduce_119(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 499) + def _reduce_121(val, _values, result) result = "list" result end .,., -module_eval(<<'.,.,', 'parser.y', 500) - def _reduce_120(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 501) + def _reduce_122(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 501) - def _reduce_121(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 502) + def _reduce_123(val, _values, result) result = val[0].append(val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 502) - def _reduce_122(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 503) + def _reduce_124(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 503) - def _reduce_123(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 504) + def _reduce_125(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[0].s_value, location: @lexer.location, args: val[2])] result end .,., -module_eval(<<'.,.,', 'parser.y', 505) - def _reduce_124(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 506) + def _reduce_126(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 506) - def _reduce_125(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 507) + def _reduce_127(val, _values, result) result = val[0].append(val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 507) - def _reduce_126(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 508) + def _reduce_128(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 508) - def _reduce_127(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 509) + def _reduce_129(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[0].s_value, location: @lexer.location, args: val[2])] result end .,., -# reduce 128 omitted +# reduce 130 omitted -# reduce 129 omitted +# reduce 131 omitted -module_eval(<<'.,.,', 'parser.y', 513) - def _reduce_130(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 514) + def _reduce_132(val, _values, result) result = Lrama::Lexer::Token::Ident.new(s_value: true) result end .,., -module_eval(<<'.,.,', 'parser.y', 514) - def _reduce_131(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 515) + def _reduce_133(val, _values, result) result = Lrama::Lexer::Token::Ident.new(s_value: false) result end .,., -# reduce 132 omitted +# reduce 134 omitted -module_eval(<<'.,.,', 'parser.y', 517) - def _reduce_133(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 518) + def _reduce_135(val, _values, result) result = val[1].s_value result end .,., -# reduce 134 omitted +# reduce 136 omitted -# reduce 135 omitted +# reduce 137 omitted -module_eval(<<'.,.,', 'parser.y', 524) - def _reduce_136(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 525) + def _reduce_138(val, _values, result) begin_c_declaration('\Z') @grammar.epilogue_first_lineno = @lexer.line + 1 @@ -2286,8 +2298,8 @@ def _reduce_136(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 529) - def _reduce_137(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 530) + def _reduce_139(val, _values, result) end_c_declaration @grammar.epilogue = val[2].s_value @@ -2295,36 +2307,36 @@ def _reduce_137(val, _values, result) end .,., -# reduce 138 omitted - -# reduce 139 omitted - # reduce 140 omitted # reduce 141 omitted # reduce 142 omitted -module_eval(<<'.,.,', 'parser.y', 540) - def _reduce_143(val, _values, result) +# reduce 143 omitted + +# reduce 144 omitted + +module_eval(<<'.,.,', 'parser.y', 541) + def _reduce_145(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 541) - def _reduce_144(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 542) + def _reduce_146(val, _values, result) result = val[0].append(val[1]) result end .,., -# reduce 145 omitted +# reduce 147 omitted -# reduce 146 omitted +# reduce 148 omitted -module_eval(<<'.,.,', 'parser.y', 546) - def _reduce_147(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 547) + def _reduce_149(val, _values, result) result = Lrama::Lexer::Token::Ident.new(s_value: val[0]) result end diff --git a/parser.y b/parser.y index 62c1ff94..efb3d90c 100644 --- a/parser.y +++ b/parser.y @@ -252,14 +252,16 @@ rule rule_args: IDENTIFIER { result = [val[0]] } | rule_args "," IDENTIFIER { result = val[0].append(val[2]) } - rule_rhs_list: rule_rhs + rule_rhs_list: rule_rhs if_clause? { builder = val[0] + builder.symbols << val[1] if val[1] result = [builder] } - | rule_rhs_list "|" rule_rhs + | rule_rhs_list "|" rule_rhs if_clause? { builder = val[2] + builder.symbols << val[3] if val[3] result = val[0].append(builder) } @@ -321,11 +323,10 @@ rule builder.precedence_sym = sym result = builder } - | rule_rhs "%if" "(" IDENTIFIER ")" + + if_clause: "%if" "(" IDENTIFIER ")" { - builder = val[0] - builder.symbols << Lrama::Lexer::Token::ControlSyntax.new(s_value: val[1], location: @lexer.location, condition: val[3]) - result = builder + result = Lrama::Lexer::Token::ControlSyntax.new(s_value: val[0], location: @lexer.location, condition: val[2]) } alias: # empty