From 9d97d87db4a6d72de0d707d85bb18cb8730de8ad Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 24 Jun 2004 16:21:54 +0000 Subject: [PATCH] prebuild-bison --- direct/src/dcparser/dcLexer.cxx.prebuilt | 353 ++++---- direct/src/dcparser/dcParser.cxx.prebuilt | 941 ++++++++++++---------- direct/src/dcparser/dcParser.h.prebuilt | 62 +- 3 files changed, 743 insertions(+), 613 deletions(-) diff --git a/direct/src/dcparser/dcLexer.cxx.prebuilt b/direct/src/dcparser/dcLexer.cxx.prebuilt index feac1e1901..53fc56631b 100644 --- a/direct/src/dcparser/dcLexer.cxx.prebuilt +++ b/direct/src/dcparser/dcLexer.cxx.prebuilt @@ -300,29 +300,30 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 45 -#define YY_END_OF_BUFFER 46 -static yyconst short int yy_accept[179] = +#define YY_NUM_RULES 47 +#define YY_END_OF_BUFFER 48 +static yyconst short int yy_accept[187] = { 0, - 0, 0, 46, 44, 2, 1, 41, 44, 44, 44, - 38, 38, 42, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 1, 0, 38, 40, - 4, 3, 40, 39, 43, 43, 43, 43, 43, 33, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 0, 3, 39, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 31, 32, 43, 43, - 43, 43, 0, 40, 43, 20, 43, 43, 43, 43, - 43, 7, 43, 43, 43, 43, 10, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 0, 0, 48, 46, 2, 1, 43, 46, 46, 46, + 40, 40, 44, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 1, 0, 40, 42, + 4, 3, 42, 41, 45, 45, 45, 45, 45, 45, + 35, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 0, 3, 41, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 33, + 34, 45, 45, 45, 45, 45, 0, 42, 45, 22, + 45, 11, 45, 45, 45, 45, 7, 45, 45, 45, + 45, 12, 45, 45, 45, 45, 45, 45, 45, 45, - 43, 11, 12, 13, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 14, 37, 21, 43, 35, 34, 5, - 43, 8, 43, 43, 43, 43, 43, 19, 6, 43, - 15, 16, 17, 43, 43, 18, 43, 43, 43, 36, - 43, 9, 43, 43, 43, 43, 43, 43, 43, 43, - 29, 43, 43, 43, 43, 30, 43, 43, 22, 43, - 43, 43, 43, 23, 24, 43, 43, 43, 25, 26, - 27, 43, 43, 43, 43, 43, 28, 0 + 45, 45, 45, 45, 45, 45, 45, 13, 14, 15, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 16, 39, 23, 45, 37, 36, 5, 45, 8, 45, + 45, 45, 45, 45, 21, 6, 10, 45, 17, 18, + 19, 45, 45, 20, 45, 45, 45, 38, 45, 9, + 45, 45, 45, 45, 45, 45, 45, 45, 31, 45, + 45, 45, 45, 32, 45, 45, 24, 45, 45, 45, + 45, 25, 26, 45, 45, 45, 27, 28, 29, 45, + 45, 45, 45, 45, 30, 0 } ; static yyconst int yy_ec[256] = @@ -338,9 +339,9 @@ static yyconst int yy_ec[256] = 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 1, 1, 1, 1, 20, 1, 21, 22, 23, 24, - 25, 26, 27, 20, 28, 20, 20, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 20, 1, 1, 1, 1, 1, 1, 1, 1, + 25, 26, 27, 28, 29, 20, 20, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -357,125 +358,131 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[43] = +static yyconst int yy_meta[44] = { 0, 1, 1, 2, 1, 1, 3, 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, 1, 6, 6, 7, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7 + 7, 7, 7 } ; -static yyconst short int yy_base[186] = +static yyconst short int yy_base[194] = { 0, - 0, 0, 214, 215, 215, 0, 215, 206, 0, 38, - 37, 205, 215, 0, 183, 16, 181, 25, 20, 22, - 169, 197, 29, 170, 164, 177, 0, 0, 197, 37, - 215, 0, 0, 0, 0, 168, 170, 169, 22, 0, - 171, 167, 166, 164, 159, 164, 161, 163, 158, 156, - 157, 158, 182, 0, 0, 162, 164, 164, 159, 158, - 161, 160, 150, 147, 49, 142, 0, 0, 139, 32, - 151, 138, 168, 167, 149, 159, 146, 146, 137, 131, - 129, 0, 130, 149, 152, 149, 140, 135, 131, 127, - 134, 132, 56, 116, 143, 130, 113, 127, 114, 134, + 0, 0, 223, 224, 224, 0, 224, 215, 0, 39, + 38, 214, 224, 0, 191, 16, 27, 27, 23, 23, + 178, 207, 35, 20, 174, 187, 0, 0, 208, 43, + 224, 0, 0, 0, 0, 178, 180, 179, 174, 27, + 0, 180, 176, 175, 173, 168, 173, 170, 172, 167, + 165, 171, 165, 166, 191, 0, 0, 171, 173, 173, + 168, 167, 166, 169, 168, 157, 154, 55, 149, 0, + 0, 146, 37, 146, 158, 144, 175, 174, 156, 166, + 153, 0, 153, 143, 137, 135, 0, 136, 156, 159, + 156, 147, 142, 137, 133, 141, 140, 138, 62, 121, + + 149, 136, 118, 133, 119, 140, 116, 132, 131, 0, + 115, 118, 113, 121, 109, 118, 120, 129, 132, 129, + 120, 0, 0, 119, 0, 0, 0, 126, 0, 102, + 101, 100, 111, 109, 0, 0, 0, 107, 111, 30, + 0, 95, 93, 0, 93, 92, 106, 0, 102, 0, + 89, 88, 94, 86, 83, 99, 98, 75, 0, 81, + 80, 83, 93, 0, 70, 69, 0, 90, 89, 71, + 65, 0, 0, 64, 63, 89, 0, 0, 0, 82, + 58, 46, 58, 32, 0, 224, 80, 84, 68, 85, + 92, 95, 99 - 111, 126, 125, 0, 110, 113, 108, 115, 104, 115, - 124, 127, 124, 115, 0, 0, 114, 0, 0, 0, - 121, 0, 98, 97, 96, 106, 104, 0, 0, 102, - 106, 42, 0, 91, 89, 0, 89, 88, 101, 0, - 97, 0, 85, 84, 90, 82, 79, 94, 93, 71, - 0, 77, 76, 79, 88, 0, 66, 65, 0, 85, - 84, 66, 52, 0, 0, 40, 37, 61, 0, 0, - 0, 55, 40, 39, 52, 27, 0, 215, 80, 84, - 62, 85, 92, 95, 99 } ; -static yyconst short int yy_def[186] = +static yyconst short int yy_def[194] = { 0, - 178, 1, 178, 178, 178, 179, 178, 180, 181, 178, - 180, 180, 178, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 179, 181, 180, 181, - 178, 183, 30, 184, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 185, 183, 184, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 185, 185, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 186, 1, 186, 186, 186, 187, 186, 188, 189, 186, + 188, 188, 186, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 187, 189, 188, 189, + 186, 191, 30, 192, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 193, 191, 192, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 193, 193, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 0, 186, 186, 186, 186, + 186, 186, 186 - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 0, 178, 178, - 178, 178, 178, 178, 178 } ; -static yyconst short int yy_nxt[258] = +static yyconst short int yy_nxt[268] = { 0, 4, 5, 6, 7, 4, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 14, 14, - 15, 16, 17, 18, 14, 19, 14, 20, 14, 14, - 14, 21, 22, 14, 23, 24, 25, 26, 14, 14, - 14, 14, 31, 33, 37, 32, 40, 41, 42, 48, - 38, 44, 45, 49, 43, 53, 59, 60, 84, 90, - 85, 53, 144, 86, 87, 111, 30, 112, 177, 91, - 113, 114, 176, 175, 174, 173, 172, 34, 171, 145, - 27, 170, 27, 27, 27, 27, 27, 29, 29, 35, - 35, 35, 54, 169, 54, 54, 54, 54, 54, 55, + 15, 16, 17, 18, 14, 19, 14, 14, 20, 14, + 14, 14, 21, 22, 14, 23, 24, 25, 26, 14, + 14, 14, 14, 31, 33, 37, 32, 39, 41, 42, + 152, 38, 43, 45, 46, 49, 40, 51, 44, 50, + 52, 55, 62, 63, 89, 95, 90, 55, 153, 91, + 92, 118, 30, 119, 185, 96, 120, 121, 184, 34, + 27, 183, 27, 27, 27, 27, 27, 29, 29, 35, + 35, 35, 56, 182, 56, 56, 56, 56, 56, 57, - 55, 74, 168, 74, 167, 166, 165, 164, 163, 162, - 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, - 151, 150, 149, 148, 147, 146, 143, 142, 141, 140, - 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, - 119, 118, 117, 116, 115, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, - 95, 94, 178, 178, 93, 92, 89, 88, 83, 82, - 81, 80, 79, 78, 77, 76, 75, 73, 72, 71, - 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, + 57, 78, 181, 78, 180, 179, 178, 177, 176, 175, + 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, + 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, + 154, 151, 150, 149, 148, 147, 146, 145, 144, 143, + 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, + 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, + 122, 117, 116, 115, 114, 113, 112, 111, 110, 109, + 108, 107, 106, 105, 104, 103, 102, 101, 100, 186, + 186, 99, 98, 97, 94, 93, 88, 87, 86, 85, + 84, 83, 82, 81, 80, 79, 77, 76, 75, 74, - 58, 57, 56, 33, 52, 51, 50, 47, 46, 39, - 36, 33, 28, 178, 3, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178 + 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, + 61, 60, 59, 58, 33, 54, 53, 48, 47, 36, + 33, 28, 186, 3, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186 } ; -static yyconst short int yy_chk[258] = +static yyconst short int yy_chk[268] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 10, 11, 16, 10, 18, 18, 19, 23, - 16, 20, 20, 23, 19, 30, 39, 39, 65, 70, - 65, 30, 132, 65, 65, 93, 181, 93, 176, 70, - 93, 93, 175, 174, 173, 172, 168, 11, 167, 132, - 179, 166, 179, 179, 179, 179, 179, 180, 180, 182, - 182, 182, 183, 163, 183, 183, 183, 183, 183, 184, + 1, 1, 1, 10, 11, 16, 10, 17, 18, 18, + 140, 16, 19, 20, 20, 23, 17, 24, 19, 23, + 24, 30, 40, 40, 68, 73, 68, 30, 140, 68, + 68, 99, 189, 99, 184, 73, 99, 99, 183, 11, + 187, 182, 187, 187, 187, 187, 187, 188, 188, 190, + 190, 190, 191, 181, 191, 191, 191, 191, 191, 192, - 184, 185, 162, 185, 161, 160, 158, 157, 155, 154, - 153, 152, 150, 149, 148, 147, 146, 145, 144, 143, - 141, 139, 138, 137, 135, 134, 131, 130, 127, 126, - 125, 124, 123, 121, 117, 114, 113, 112, 111, 110, - 109, 108, 107, 106, 105, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 92, 91, 90, 89, 88, - 87, 86, 85, 84, 83, 81, 80, 79, 78, 77, - 76, 75, 74, 73, 72, 71, 69, 66, 64, 63, - 62, 61, 60, 59, 58, 57, 56, 53, 52, 51, - 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, + 192, 193, 180, 193, 176, 175, 174, 171, 170, 169, + 168, 166, 165, 163, 162, 161, 160, 158, 157, 156, + 155, 154, 153, 152, 151, 149, 147, 146, 145, 143, + 142, 139, 138, 134, 133, 132, 131, 130, 128, 124, + 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, + 111, 109, 108, 107, 106, 105, 104, 103, 102, 101, + 100, 98, 97, 96, 95, 94, 93, 92, 91, 90, + 89, 88, 86, 85, 84, 83, 81, 80, 79, 78, + 77, 76, 75, 74, 72, 69, 67, 66, 65, 64, + 63, 62, 61, 60, 59, 58, 55, 54, 53, 52, - 38, 37, 36, 29, 26, 25, 24, 22, 21, 17, - 15, 12, 8, 3, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178 + 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, + 39, 38, 37, 36, 29, 26, 25, 22, 21, 15, + 12, 8, 3, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186 } ; static yy_state_type yy_last_accepting_state; @@ -790,7 +797,7 @@ inline void accept() { col_number += yyleng; } -#line 795 "lex.yy.c" +#line 802 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -952,7 +959,7 @@ YY_DECL } -#line 957 "lex.yy.c" +#line 964 "lex.yy.c" if ( yy_init ) { @@ -1003,13 +1010,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 179 ) + if ( yy_current_state >= 187 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 215 ); + while ( yy_base[yy_current_state] != 224 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1122,7 +1129,7 @@ YY_RULE_SETUP #line 373 "dcLexer.lxx" { accept(); - return KW_INT8; + return KW_SWITCH; } YY_BREAK case 11: @@ -1130,7 +1137,7 @@ YY_RULE_SETUP #line 378 "dcLexer.lxx" { accept(); - return KW_INT16; + return KW_CASE; } YY_BREAK case 12: @@ -1138,7 +1145,7 @@ YY_RULE_SETUP #line 383 "dcLexer.lxx" { accept(); - return KW_INT32; + return KW_INT8; } YY_BREAK case 13: @@ -1146,7 +1153,7 @@ YY_RULE_SETUP #line 388 "dcLexer.lxx" { accept(); - return KW_INT64; + return KW_INT16; } YY_BREAK case 14: @@ -1154,7 +1161,7 @@ YY_RULE_SETUP #line 393 "dcLexer.lxx" { accept(); - return KW_UINT8; + return KW_INT32; } YY_BREAK case 15: @@ -1162,7 +1169,7 @@ YY_RULE_SETUP #line 398 "dcLexer.lxx" { accept(); - return KW_UINT16; + return KW_INT64; } YY_BREAK case 16: @@ -1170,7 +1177,7 @@ YY_RULE_SETUP #line 403 "dcLexer.lxx" { accept(); - return KW_UINT32; + return KW_UINT8; } YY_BREAK case 17: @@ -1178,7 +1185,7 @@ YY_RULE_SETUP #line 408 "dcLexer.lxx" { accept(); - return KW_UINT64; + return KW_UINT16; } YY_BREAK case 18: @@ -1186,7 +1193,7 @@ YY_RULE_SETUP #line 413 "dcLexer.lxx" { accept(); - return KW_FLOAT64; + return KW_UINT32; } YY_BREAK case 19: @@ -1194,7 +1201,7 @@ YY_RULE_SETUP #line 418 "dcLexer.lxx" { accept(); - return KW_STRING; + return KW_UINT64; } YY_BREAK case 20: @@ -1202,7 +1209,7 @@ YY_RULE_SETUP #line 423 "dcLexer.lxx" { accept(); - return KW_BLOB; + return KW_FLOAT64; } YY_BREAK case 21: @@ -1210,7 +1217,7 @@ YY_RULE_SETUP #line 428 "dcLexer.lxx" { accept(); - return KW_BLOB32; + return KW_STRING; } YY_BREAK case 22: @@ -1218,7 +1225,7 @@ YY_RULE_SETUP #line 433 "dcLexer.lxx" { accept(); - return KW_INT8ARRAY; + return KW_BLOB; } YY_BREAK case 23: @@ -1226,7 +1233,7 @@ YY_RULE_SETUP #line 438 "dcLexer.lxx" { accept(); - return KW_INT16ARRAY; + return KW_BLOB32; } YY_BREAK case 24: @@ -1234,7 +1241,7 @@ YY_RULE_SETUP #line 443 "dcLexer.lxx" { accept(); - return KW_INT32ARRAY; + return KW_INT8ARRAY; } YY_BREAK case 25: @@ -1242,7 +1249,7 @@ YY_RULE_SETUP #line 448 "dcLexer.lxx" { accept(); - return KW_UINT8ARRAY; + return KW_INT16ARRAY; } YY_BREAK case 26: @@ -1250,7 +1257,7 @@ YY_RULE_SETUP #line 453 "dcLexer.lxx" { accept(); - return KW_UINT16ARRAY; + return KW_INT32ARRAY; } YY_BREAK case 27: @@ -1258,7 +1265,7 @@ YY_RULE_SETUP #line 458 "dcLexer.lxx" { accept(); - return KW_UINT32ARRAY; + return KW_UINT8ARRAY; } YY_BREAK case 28: @@ -1266,7 +1273,7 @@ YY_RULE_SETUP #line 463 "dcLexer.lxx" { accept(); - return KW_UINT32UINT8ARRAY; + return KW_UINT16ARRAY; } YY_BREAK case 29: @@ -1274,7 +1281,7 @@ YY_RULE_SETUP #line 468 "dcLexer.lxx" { accept(); - return KW_REQUIRED; + return KW_UINT32ARRAY; } YY_BREAK case 30: @@ -1282,7 +1289,7 @@ YY_RULE_SETUP #line 473 "dcLexer.lxx" { accept(); - return KW_BROADCAST; + return KW_UINT32UINT8ARRAY; } YY_BREAK case 31: @@ -1290,7 +1297,7 @@ YY_RULE_SETUP #line 478 "dcLexer.lxx" { accept(); - return KW_P2P; + return KW_REQUIRED; } YY_BREAK case 32: @@ -1298,7 +1305,7 @@ YY_RULE_SETUP #line 483 "dcLexer.lxx" { accept(); - return KW_RAM; + return KW_BROADCAST; } YY_BREAK case 33: @@ -1306,7 +1313,7 @@ YY_RULE_SETUP #line 488 "dcLexer.lxx" { accept(); - return KW_DB; + return KW_P2P; } YY_BREAK case 34: @@ -1314,7 +1321,7 @@ YY_RULE_SETUP #line 493 "dcLexer.lxx" { accept(); - return KW_CLSEND; + return KW_RAM; } YY_BREAK case 35: @@ -1322,7 +1329,7 @@ YY_RULE_SETUP #line 498 "dcLexer.lxx" { accept(); - return KW_CLRECV; + return KW_DB; } YY_BREAK case 36: @@ -1330,7 +1337,7 @@ YY_RULE_SETUP #line 503 "dcLexer.lxx" { accept(); - return KW_OWNSEND; + return KW_CLSEND; } YY_BREAK case 37: @@ -1338,12 +1345,28 @@ YY_RULE_SETUP #line 508 "dcLexer.lxx" { accept(); - return KW_AIRECV; + return KW_CLRECV; } YY_BREAK case 38: YY_RULE_SETUP #line 513 "dcLexer.lxx" +{ + accept(); + return KW_OWNSEND; +} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 518 "dcLexer.lxx" +{ + accept(); + return KW_AIRECV; +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 523 "dcLexer.lxx" { // An integer number. accept(); @@ -1370,9 +1393,9 @@ YY_RULE_SETUP return INTEGER; } YY_BREAK -case 39: +case 41: YY_RULE_SETUP -#line 539 "dcLexer.lxx" +#line 549 "dcLexer.lxx" { // A hexadecimal integer number. accept(); @@ -1393,9 +1416,9 @@ YY_RULE_SETUP return INTEGER; } YY_BREAK -case 40: +case 42: YY_RULE_SETUP -#line 559 "dcLexer.lxx" +#line 569 "dcLexer.lxx" { // A floating-point number. accept(); @@ -1404,9 +1427,9 @@ YY_RULE_SETUP return REAL; } YY_BREAK -case 41: +case 43: YY_RULE_SETUP -#line 567 "dcLexer.lxx" +#line 577 "dcLexer.lxx" { // Quoted string. accept(); @@ -1414,9 +1437,9 @@ YY_RULE_SETUP return STRING; } YY_BREAK -case 42: +case 44: YY_RULE_SETUP -#line 574 "dcLexer.lxx" +#line 584 "dcLexer.lxx" { // Long hex string. accept(); @@ -1424,9 +1447,9 @@ YY_RULE_SETUP return HEX_STRING; } YY_BREAK -case 43: +case 45: YY_RULE_SETUP -#line 581 "dcLexer.lxx" +#line 591 "dcLexer.lxx" { // Identifier. accept(); @@ -1434,21 +1457,21 @@ YY_RULE_SETUP return IDENTIFIER; } YY_BREAK -case 44: +case 46: YY_RULE_SETUP -#line 589 "dcLexer.lxx" +#line 599 "dcLexer.lxx" { // Send any other printable character as itself. accept(); return dcyytext[0]; } YY_BREAK -case 45: +case 47: YY_RULE_SETUP -#line 595 "dcLexer.lxx" +#line 605 "dcLexer.lxx" ECHO; YY_BREAK -#line 1453 "lex.yy.c" +#line 1476 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1740,7 +1763,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 179 ) + if ( yy_current_state >= 187 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1775,11 +1798,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 179 ) + if ( yy_current_state >= 187 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 178); + yy_is_jam = (yy_current_state == 186); return yy_is_jam ? 0 : yy_current_state; } @@ -2329,4 +2352,4 @@ int main() return 0; } #endif -#line 595 "dcLexer.lxx" +#line 605 "dcLexer.lxx" diff --git a/direct/src/dcparser/dcParser.cxx.prebuilt b/direct/src/dcparser/dcParser.cxx.prebuilt index 30f00617b0..ec11b16a01 100644 --- a/direct/src/dcparser/dcParser.cxx.prebuilt +++ b/direct/src/dcparser/dcParser.cxx.prebuilt @@ -20,36 +20,38 @@ # define KW_FROM 264 # define KW_IMPORT 265 # define KW_TYPEDEF 266 -# define KW_INT8 267 -# define KW_INT16 268 -# define KW_INT32 269 -# define KW_INT64 270 -# define KW_UINT8 271 -# define KW_UINT16 272 -# define KW_UINT32 273 -# define KW_UINT64 274 -# define KW_FLOAT64 275 -# define KW_STRING 276 -# define KW_BLOB 277 -# define KW_BLOB32 278 -# define KW_INT8ARRAY 279 -# define KW_INT16ARRAY 280 -# define KW_INT32ARRAY 281 -# define KW_UINT8ARRAY 282 -# define KW_UINT16ARRAY 283 -# define KW_UINT32ARRAY 284 -# define KW_UINT32UINT8ARRAY 285 -# define KW_REQUIRED 286 -# define KW_BROADCAST 287 -# define KW_P2P 288 -# define KW_RAM 289 -# define KW_DB 290 -# define KW_CLSEND 291 -# define KW_CLRECV 292 -# define KW_OWNSEND 293 -# define KW_AIRECV 294 -# define START_DC 295 -# define START_PARAMETER_VALUE 296 +# define KW_SWITCH 267 +# define KW_CASE 268 +# define KW_INT8 269 +# define KW_INT16 270 +# define KW_INT32 271 +# define KW_INT64 272 +# define KW_UINT8 273 +# define KW_UINT16 274 +# define KW_UINT32 275 +# define KW_UINT64 276 +# define KW_FLOAT64 277 +# define KW_STRING 278 +# define KW_BLOB 279 +# define KW_BLOB32 280 +# define KW_INT8ARRAY 281 +# define KW_INT16ARRAY 282 +# define KW_INT32ARRAY 283 +# define KW_UINT8ARRAY 284 +# define KW_UINT16ARRAY 285 +# define KW_UINT32ARRAY 286 +# define KW_UINT32UINT8ARRAY 287 +# define KW_REQUIRED 288 +# define KW_BROADCAST 289 +# define KW_P2P 290 +# define KW_RAM 291 +# define KW_DB 292 +# define KW_CLSEND 293 +# define KW_CLRECV 294 +# define KW_OWNSEND 295 +# define KW_AIRECV 296 +# define START_DC 297 +# define START_PARAMETER_VALUE 298 #line 6 "dcParser.yxx" @@ -57,6 +59,7 @@ #include "dcParserDefs.h" #include "dcFile.h" #include "dcClass.h" +#include "dcSwitch.h" #include "dcAtomicField.h" #include "dcMolecularField.h" #include "dcClassParameter.h" @@ -76,6 +79,7 @@ static DCFile *dc_file = (DCFile *)NULL; static DCClass *current_class = (DCClass *)NULL; +static DCSwitch *current_switch = (DCSwitch *)NULL; static DCAtomicField *current_atomic = (DCAtomicField *)NULL; static DCMolecularField *current_molecular = (DCMolecularField *)NULL; static DCAtomicField::ElementType atomic_element(new DCSimpleParameter(ST_invalid)); @@ -115,12 +119,12 @@ dc_cleanup_parser() { -#define YYFINAL 185 +#define YYFINAL 210 #define YYFLAG -32768 -#define YYNTBASE 57 +#define YYNTBASE 59 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 296 ? yytranslate[x] : 103) +#define YYTRANSLATE(x) ((unsigned)(x) <= 298 ? yytranslate[x] : 113) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = @@ -129,15 +133,15 @@ static const char yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 51, 52, 48, 2, 49, 54, 47, 46, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 50, 43, - 2, 53, 2, 2, 2, 2, 2, 2, 2, 2, + 53, 54, 50, 2, 51, 56, 49, 48, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 52, 45, + 2, 55, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 55, 2, 56, 2, 2, 2, 2, 2, 2, + 2, 57, 2, 58, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 44, 2, 45, 2, 2, 2, 2, + 2, 2, 2, 46, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -154,7 +158,7 @@ static const char yytranslate[] = 6, 7, 8, 9, 10, 11, 12, 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, 38, 39, 40, 41, 42 + 36, 37, 38, 39, 40, 41, 42, 43, 44 }; #if YYDEBUG @@ -163,56 +167,62 @@ static const short yyprhs[] = 0, 0, 3, 6, 8, 11, 14, 17, 20, 21, 29, 31, 33, 35, 37, 41, 43, 47, 50, 51, 57, 59, 61, 63, 67, 70, 72, 75, 77, 81, - 83, 86, 89, 92, 96, 99, 100, 107, 109, 111, - 113, 115, 119, 121, 122, 127, 128, 132, 134, 136, - 138, 140, 145, 149, 156, 163, 165, 167, 169, 173, - 176, 180, 186, 191, 193, 195, 199, 202, 206, 212, - 217, 219, 224, 226, 230, 235, 237, 239, 241, 243, - 245, 247, 248, 253, 254, 259, 260, 265, 269, 273, - 277, 279, 282, 284, 286, 288, 292, 294, 296, 298, - 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, - 320, 322, 324, 326, 328, 330, 332, 335, 338, 341, - 344, 347, 350, 353, 356, 359, 360, 365, 367, 371 + 83, 86, 89, 91, 93, 95, 98, 100, 101, 108, + 110, 112, 114, 118, 120, 121, 126, 127, 131, 133, + 135, 137, 139, 144, 148, 155, 162, 164, 166, 168, + 172, 175, 179, 185, 190, 192, 194, 198, 201, 205, + 211, 216, 218, 223, 225, 229, 234, 236, 238, 240, + 242, 244, 246, 247, 252, 253, 258, 259, 264, 268, + 272, 276, 278, 281, 283, 285, 287, 291, 293, 295, + 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, + 317, 319, 321, 323, 325, 327, 329, 331, 334, 337, + 340, 343, 346, 349, 352, 355, 358, 359, 364, 366, + 368, 372, 374, 376, 377, 387, 389, 392, 395, 398, + 399, 404, 406, 409, 411 }; static const short yyrhs[] = { - 41, 58, 0, 42, 90, 0, 102, 0, 58, 43, - 0, 58, 59, 0, 58, 65, 0, 58, 69, 0, - 0, 61, 7, 60, 70, 44, 72, 45, 0, 9, - 0, 8, 0, 7, 0, 7, 0, 63, 46, 7, - 0, 63, 0, 64, 47, 63, 0, 11, 64, 0, - 0, 10, 64, 11, 66, 67, 0, 68, 0, 48, - 0, 63, 0, 68, 49, 63, 0, 12, 83, 0, - 102, 0, 50, 71, 0, 62, 0, 71, 49, 62, - 0, 102, 0, 72, 43, 0, 72, 73, 0, 72, - 99, 0, 72, 82, 43, 0, 72, 80, 0, 0, - 7, 51, 74, 76, 52, 98, 0, 7, 0, 102, - 0, 77, 0, 78, 0, 77, 49, 78, 0, 83, - 0, 0, 83, 53, 79, 90, 0, 0, 87, 81, - 88, 0, 87, 0, 80, 0, 82, 0, 97, 0, - 97, 51, 85, 52, 0, 97, 46, 3, 0, 97, - 46, 3, 51, 85, 52, 0, 97, 51, 85, 52, - 46, 3, 0, 7, 0, 102, 0, 89, 0, 89, - 54, 89, 0, 89, 89, 0, 85, 49, 89, 0, - 85, 49, 89, 54, 89, 0, 85, 49, 89, 89, - 0, 102, 0, 3, 0, 3, 54, 3, 0, 3, - 3, 0, 86, 49, 3, 0, 86, 49, 3, 54, - 3, 0, 86, 49, 3, 3, 0, 84, 0, 87, - 55, 86, 56, 0, 7, 0, 88, 46, 3, 0, - 88, 55, 86, 56, 0, 3, 0, 4, 0, 3, - 0, 4, 0, 5, 0, 6, 0, 0, 44, 91, - 94, 45, 0, 0, 55, 92, 94, 56, 0, 0, - 51, 93, 94, 52, 0, 3, 48, 3, 0, 4, - 48, 3, 0, 6, 48, 3, 0, 95, 0, 96, - 95, 0, 102, 0, 49, 0, 90, 0, 96, 49, - 90, 0, 13, 0, 14, 0, 15, 0, 16, 0, - 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, - 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, - 27, 0, 28, 0, 29, 0, 30, 0, 31, 0, - 102, 0, 98, 32, 0, 98, 33, 0, 98, 34, - 0, 98, 35, 0, 98, 36, 0, 98, 37, 0, - 98, 38, 0, 98, 39, 0, 98, 40, 0, 0, - 7, 50, 100, 101, 0, 75, 0, 101, 49, 75, + 43, 60, 0, 44, 92, 0, 112, 0, 60, 45, + 0, 60, 61, 0, 60, 67, 0, 60, 71, 0, + 0, 63, 7, 62, 72, 46, 74, 47, 0, 9, + 0, 8, 0, 7, 0, 7, 0, 65, 48, 7, + 0, 65, 0, 66, 49, 65, 0, 11, 66, 0, + 0, 10, 66, 11, 68, 69, 0, 70, 0, 50, + 0, 65, 0, 70, 51, 65, 0, 12, 85, 0, + 112, 0, 52, 73, 0, 64, 0, 73, 51, 64, + 0, 112, 0, 74, 45, 0, 74, 75, 0, 76, + 0, 101, 0, 106, 0, 84, 45, 0, 82, 0, + 0, 7, 53, 77, 78, 54, 100, 0, 112, 0, + 79, 0, 80, 0, 79, 51, 80, 0, 85, 0, + 0, 85, 55, 81, 92, 0, 0, 89, 83, 90, + 0, 89, 0, 82, 0, 84, 0, 99, 0, 99, + 53, 87, 54, 0, 99, 48, 3, 0, 99, 48, + 3, 53, 87, 54, 0, 99, 53, 87, 54, 48, + 3, 0, 7, 0, 112, 0, 91, 0, 91, 56, + 91, 0, 91, 91, 0, 87, 51, 91, 0, 87, + 51, 91, 56, 91, 0, 87, 51, 91, 91, 0, + 112, 0, 3, 0, 3, 56, 3, 0, 3, 3, + 0, 88, 51, 3, 0, 88, 51, 3, 56, 3, + 0, 88, 51, 3, 3, 0, 86, 0, 89, 57, + 88, 58, 0, 7, 0, 90, 48, 3, 0, 90, + 57, 88, 58, 0, 3, 0, 4, 0, 3, 0, + 4, 0, 5, 0, 6, 0, 0, 46, 93, 96, + 47, 0, 0, 57, 94, 96, 58, 0, 0, 53, + 95, 96, 54, 0, 3, 50, 3, 0, 4, 50, + 3, 0, 6, 50, 3, 0, 97, 0, 98, 97, + 0, 112, 0, 51, 0, 92, 0, 98, 51, 92, + 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, + 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, + 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, + 0, 30, 0, 31, 0, 32, 0, 33, 0, 112, + 0, 100, 34, 0, 100, 35, 0, 100, 36, 0, + 100, 37, 0, 100, 38, 0, 100, 39, 0, 100, + 40, 0, 100, 41, 0, 100, 42, 0, 0, 7, + 52, 102, 104, 0, 7, 0, 103, 0, 104, 51, + 103, 0, 112, 0, 7, 0, 0, 13, 105, 53, + 85, 54, 46, 107, 108, 47, 0, 112, 0, 108, + 45, 0, 108, 109, 0, 108, 111, 0, 0, 14, + 110, 92, 52, 0, 106, 0, 84, 45, 0, 82, 0, 0 }; @@ -222,19 +232,21 @@ static const short yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { - 0, 127, 129, 132, 134, 135, 136, 137, 140, 140, - 156, 161, 167, 180, 182, 188, 190, 196, 201, 201, - 208, 210, 216, 221, 227, 243, 245, 248, 255, 263, - 265, 266, 267, 268, 272, 280, 280, 291, 307, 309, - 312, 314, 317, 323, 323, 347, 347, 358, 362, 364, - 367, 372, 380, 391, 405, 419, 440, 445, 452, 459, - 468, 474, 480, 490, 495, 506, 517, 528, 536, 544, - 556, 558, 564, 570, 584, 590, 595, 598, 603, 607, - 611, 615, 615, 623, 623, 631, 631, 639, 645, 651, - 659, 661, 664, 666, 669, 671, 674, 679, 683, 687, - 691, 695, 699, 703, 707, 711, 715, 719, 723, 727, - 731, 735, 739, 743, 747, 753, 755, 759, 763, 767, - 771, 775, 779, 783, 787, 793, 793, 804, 811, 824 + 0, 137, 139, 142, 144, 145, 146, 147, 150, 150, + 166, 171, 177, 190, 192, 198, 200, 206, 211, 211, + 218, 220, 226, 231, 237, 253, 255, 258, 265, 273, + 275, 276, 284, 286, 287, 288, 292, 298, 298, 309, + 311, 314, 316, 319, 325, 325, 349, 349, 360, 364, + 366, 369, 374, 382, 393, 407, 421, 442, 447, 454, + 461, 470, 476, 482, 492, 497, 508, 519, 530, 538, + 546, 558, 560, 566, 572, 586, 592, 597, 600, 605, + 609, 613, 617, 617, 625, 625, 633, 633, 641, 647, + 653, 661, 663, 666, 668, 671, 673, 676, 681, 685, + 689, 693, 697, 701, 705, 709, 713, 717, 721, 725, + 729, 733, 737, 741, 745, 749, 755, 757, 761, 765, + 769, 773, 777, 781, 785, 789, 795, 795, 806, 822, + 829, 842, 847, 850, 850, 864, 866, 867, 868, 878, + 878, 894, 896, 900, 906 }; #endif @@ -246,43 +258,47 @@ static const char *const yytname[] = { "$", "error", "$undefined.", "INTEGER", "REAL", "STRING", "HEX_STRING", "IDENTIFIER", "KW_DCLASS", "KW_STRUCT", "KW_FROM", "KW_IMPORT", - "KW_TYPEDEF", "KW_INT8", "KW_INT16", "KW_INT32", "KW_INT64", "KW_UINT8", - "KW_UINT16", "KW_UINT32", "KW_UINT64", "KW_FLOAT64", "KW_STRING", - "KW_BLOB", "KW_BLOB32", "KW_INT8ARRAY", "KW_INT16ARRAY", - "KW_INT32ARRAY", "KW_UINT8ARRAY", "KW_UINT16ARRAY", "KW_UINT32ARRAY", - "KW_UINT32UINT8ARRAY", "KW_REQUIRED", "KW_BROADCAST", "KW_P2P", - "KW_RAM", "KW_DB", "KW_CLSEND", "KW_CLRECV", "KW_OWNSEND", "KW_AIRECV", - "START_DC", "START_PARAMETER_VALUE", "';'", "'{'", "'}'", "'/'", "'.'", - "'*'", "','", "':'", "'('", "')'", "'='", "'-'", "'['", "']'", - "grammar", "dc", "dclass", "@1", "kw_struct_or_kw_dclass", + "KW_TYPEDEF", "KW_SWITCH", "KW_CASE", "KW_INT8", "KW_INT16", "KW_INT32", + "KW_INT64", "KW_UINT8", "KW_UINT16", "KW_UINT32", "KW_UINT64", + "KW_FLOAT64", "KW_STRING", "KW_BLOB", "KW_BLOB32", "KW_INT8ARRAY", + "KW_INT16ARRAY", "KW_INT32ARRAY", "KW_UINT8ARRAY", "KW_UINT16ARRAY", + "KW_UINT32ARRAY", "KW_UINT32UINT8ARRAY", "KW_REQUIRED", "KW_BROADCAST", + "KW_P2P", "KW_RAM", "KW_DB", "KW_CLSEND", "KW_CLRECV", "KW_OWNSEND", + "KW_AIRECV", "START_DC", "START_PARAMETER_VALUE", "';'", "'{'", "'}'", + "'/'", "'.'", "'*'", "','", "':'", "'('", "')'", "'='", "'-'", "'['", + "']'", "grammar", "dc", "dclass", "@1", "kw_struct_or_kw_dclass", "dclass_name", "slash_identifier", "import_identifier", "import", "@2", "import_symbol_list_or_star", "import_symbol_list", "typedef_decl", - "dclass_derivation", "base_list", "dclass_fields", "atomic_field", "@3", - "atomic_name", "parameter_list", "nonempty_parameter_list", + "dclass_derivation", "base_list", "dclass_fields", "dclass_field", + "atomic_field", "@3", "parameter_list", "nonempty_parameter_list", "atomic_element", "@4", "named_parameter", "@5", "unnamed_parameter", "parameter", "type_name", "double_range", "uint_range", "type_definition", "parameter_definition", "number", "parameter_value", "@6", "@7", "@8", "array", "maybe_comma", "array_def", "type_token", - "atomic_flags", "molecular_field", "@9", "molecular_atom_list", "empty", 0 + "atomic_flags", "molecular_field", "@9", "atomic_name", + "molecular_atom_list", "optional_name", "switch", "@10", + "switch_fields", "switch_case", "@11", "switch_field", "empty", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { - 0, 57, 57, 58, 58, 58, 58, 58, 60, 59, - 61, 61, 62, 63, 63, 64, 64, 65, 66, 65, - 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, - 72, 72, 72, 72, 72, 74, 73, 75, 76, 76, - 77, 77, 78, 79, 78, 81, 80, 82, 83, 83, - 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, - 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, - 87, 87, 88, 88, 88, 89, 89, 90, 90, 90, - 90, 91, 90, 92, 90, 93, 90, 90, 90, 90, - 94, 94, 95, 95, 96, 96, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, - 98, 98, 98, 98, 98, 100, 99, 101, 101, 102 + 0, 59, 59, 60, 60, 60, 60, 60, 62, 61, + 63, 63, 64, 65, 65, 66, 66, 67, 68, 67, + 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, + 74, 74, 75, 75, 75, 75, 75, 77, 76, 78, + 78, 79, 79, 80, 81, 80, 83, 82, 84, 85, + 85, 86, 86, 86, 86, 86, 86, 87, 87, 87, + 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, + 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, + 92, 92, 93, 92, 94, 92, 95, 92, 92, 92, + 92, 96, 96, 97, 97, 98, 98, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 102, 101, 103, 104, + 104, 105, 105, 107, 106, 108, 108, 108, 108, 110, + 109, 111, 111, 111, 112 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -291,16 +307,18 @@ static const short yyr2[] = 0, 2, 2, 1, 2, 2, 2, 2, 0, 7, 1, 1, 1, 1, 3, 1, 3, 2, 0, 5, 1, 1, 1, 3, 2, 1, 2, 1, 3, 1, - 2, 2, 2, 3, 2, 0, 6, 1, 1, 1, - 1, 3, 1, 0, 4, 0, 3, 1, 1, 1, - 1, 4, 3, 6, 6, 1, 1, 1, 3, 2, - 3, 5, 4, 1, 1, 3, 2, 3, 5, 4, - 1, 4, 1, 3, 4, 1, 1, 1, 1, 1, - 1, 0, 4, 0, 4, 0, 4, 3, 3, 3, - 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, + 2, 2, 1, 1, 1, 2, 1, 0, 6, 1, + 1, 1, 3, 1, 0, 4, 0, 3, 1, 1, + 1, 1, 4, 3, 6, 6, 1, 1, 1, 3, + 2, 3, 5, 4, 1, 1, 3, 2, 3, 5, + 4, 1, 4, 1, 3, 4, 1, 1, 1, 1, + 1, 1, 0, 4, 0, 4, 0, 4, 3, 3, + 3, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 0, 4, 1, 3, 0 + 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 0, 4, 1, 1, + 3, 1, 1, 0, 9, 1, 2, 2, 2, 0, + 4, 1, 2, 1, 0 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -308,116 +326,132 @@ static const short yyr2[] = error. */ static const short yydefact[] = { - 0, 129, 0, 1, 3, 77, 78, 79, 80, 81, - 85, 83, 2, 11, 10, 0, 0, 0, 4, 5, - 0, 6, 7, 0, 0, 0, 129, 129, 129, 13, - 15, 0, 17, 55, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 48, 49, 24, 70, 47, 50, 8, - 87, 88, 89, 93, 94, 0, 90, 129, 92, 0, - 0, 0, 18, 0, 129, 0, 0, 129, 129, 82, - 93, 91, 86, 84, 14, 0, 16, 64, 0, 63, - 72, 46, 52, 75, 76, 0, 57, 56, 0, 0, - 25, 95, 21, 22, 19, 20, 66, 0, 0, 71, - 0, 129, 129, 0, 51, 0, 59, 12, 27, 26, - 129, 0, 65, 67, 73, 0, 0, 60, 0, 58, - 0, 0, 29, 23, 69, 0, 74, 53, 0, 62, - 54, 28, 55, 30, 9, 31, 34, 0, 32, 68, - 61, 125, 35, 33, 0, 129, 37, 127, 126, 0, - 39, 40, 42, 38, 0, 129, 0, 43, 128, 36, - 115, 41, 0, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 44, 0, 0, 0 + 0, 144, 0, 1, 3, 78, 79, 80, 81, 82, + 86, 84, 2, 11, 10, 0, 0, 0, 4, 5, + 0, 6, 7, 0, 0, 0, 144, 144, 144, 13, + 15, 0, 17, 56, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 49, 50, 24, 71, 48, 51, 8, + 88, 89, 90, 94, 95, 0, 91, 144, 93, 0, + 0, 0, 18, 0, 144, 0, 0, 144, 144, 83, + 94, 92, 87, 85, 14, 0, 16, 65, 0, 64, + 73, 47, 53, 76, 77, 0, 58, 57, 0, 0, + 25, 96, 21, 22, 19, 20, 67, 0, 0, 72, + 0, 144, 144, 0, 52, 0, 60, 12, 27, 26, + 144, 0, 66, 68, 74, 0, 0, 61, 0, 59, + 0, 0, 29, 23, 70, 0, 75, 54, 0, 63, + 55, 28, 56, 144, 30, 9, 31, 32, 36, 0, + 33, 34, 69, 62, 126, 37, 132, 0, 131, 35, + 0, 144, 0, 128, 129, 127, 0, 40, 41, 43, + 39, 0, 0, 144, 0, 44, 0, 130, 38, 116, + 42, 0, 133, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 45, 144, 0, 135, 139, 136, 134, 143, + 0, 141, 137, 138, 0, 142, 0, 140, 0, 0, + 0 }; static const short yydefgoto[] = { - 183, 3, 19, 78, 20, 118, 30, 31, 21, 85, - 104, 105, 22, 99, 119, 131, 145, 155, 157, 159, - 160, 161, 172, 53, 75, 54, 162, 56, 95, 88, + 208, 3, 19, 78, 20, 118, 30, 31, 21, 85, + 104, 105, 22, 99, 119, 131, 146, 147, 161, 166, + 167, 168, 181, 53, 75, 54, 169, 56, 95, 88, 57, 91, 96, 64, 26, 28, 27, 65, 66, 67, - 58, 169, 148, 154, 158, 68 + 58, 178, 150, 160, 164, 165, 157, 151, 193, 194, + 202, 204, 203, 68 }; static const short yypact[] = { - 28,-32768, 7, 25,-32768, -21, -16,-32768, -8,-32768, - -32768,-32768,-32768,-32768,-32768, 16, 16, 111,-32768,-32768, - 50,-32768,-32768, 44, 51, 58, 1, 1, 1,-32768, - 18, 8, 30,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 38,-32768, 9, 28,-32768, -23, -15,-32768, -8,-32768, + -32768,-32768,-32768,-32768,-32768, 18, 18, 189,-32768,-32768, + 39,-32768,-32768, 47, 58, 72, 3, 3, 3,-32768, + 59, -6, 57,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, -6, -26,-32768, - -32768,-32768,-32768,-32768,-32768, 37,-32768, 34,-32768, 32, - 29, 79,-32768, 16, 103, 100, 105, 40, 59,-32768, - 7,-32768,-32768,-32768,-32768, 15, 18, -1, -28,-32768, - -32768, -29, 60,-32768,-32768, -11, 5,-32768, 108, 66, - -32768,-32768,-32768, 18,-32768, 63,-32768, 113, 117,-32768, - 118, 103, 40, 40, 77, 40,-32768,-32768,-32768, 94, - -32768, 16,-32768, 13,-32768, -25, -10, 11, 150,-32768, - 108, 74,-32768, 18,-32768, 151,-32768,-32768, 40,-32768, - -32768,-32768, 22,-32768,-32768,-32768,-32768, 115,-32768,-32768, - -32768,-32768,-32768,-32768, 148, 111,-32768,-32768, 107, 109, - 110,-32768, 116,-32768, 148,-32768, 111,-32768,-32768, 112, - -32768,-32768, 7,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768, 160, 162,-32768 + -32768,-32768,-32768,-32768,-32768,-32768,-32768, 17, -19,-32768, + -32768,-32768,-32768,-32768,-32768, 61,-32768, 60,-32768, 55, + 52, 105,-32768, 18, 116, 109, 117, 49, 69,-32768, + 9,-32768,-32768,-32768,-32768, 14, 59, 15, -28,-32768, + -32768, -26, 104,-32768,-32768, -10, 7,-32768, 118, 114, + -32768,-32768,-32768, 59,-32768, 108,-32768, 120, 158,-32768, + 159, 116, 49, 49, 119, 49,-32768,-32768,-32768, 115, + -32768, 18,-32768, 16,-32768, -25, -3, 13, 161,-32768, + 118, 111,-32768, 59,-32768, 162,-32768,-32768, 49,-32768, + -32768,-32768, 5, 163,-32768,-32768,-32768,-32768,-32768, 123, + -32768,-32768,-32768,-32768,-32768,-32768,-32768, 121,-32768,-32768, + 164, 189, 189,-32768,-32768, 122, 124, 125,-32768, 126, + -32768, 128, 164,-32768, 189,-32768, 131,-32768, 113,-32768, + -32768, 9,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + -32768,-32768,-32768,-32768, 70,-32768,-32768,-32768,-32768,-32768, + 127,-32768,-32768,-32768, 9,-32768, 132,-32768, 169, 180, + -32768 }; static const short yypgoto[] = { - -32768,-32768,-32768,-32768,-32768, 33, -55, 149,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 0,-32768, - -32768, 6,-32768, 35,-32768, 42, 154,-32768, 56, 64, - -32768,-32768, -67, -2,-32768,-32768,-32768, 47, 114,-32768, - -32768,-32768,-32768,-32768,-32768, 2 + -32768,-32768,-32768,-32768,-32768, 53, -53, 170,-32768,-32768, + -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + -32768, 11,-32768, -129,-32768, -127, -16,-32768, 75, 78, + -32768,-32768, -68, -2,-32768,-32768,-32768, 77, 130,-32768, + -32768,-32768,-32768,-32768, 19,-32768,-32768, -4,-32768,-32768, + -32768,-32768,-32768, 2 }; -#define YYLAST 181 +#define YYLAST 222 static const short yytable[] = { - 12, -45, 106, 4, 5, 6, 7, 8, 93, 94, - 5, 6, 7, 8, 93, 94, 134, 110, 86, 72, - 76, 108, 29, 29, 108, 77, 111, 23, 109, 116, - 103, 136, 24, 13, 14, 15, 16, 17, 113, 113, - 25, 114, 137, 93, 94, 9, 127, 60, 129, 74, - 63, 9, 10, 107, 61, 73, 11, 59, 10, 115, - 139, 62, 11, 102, 71, 138, 133, 135, 18, 1, - 2, 150, 151, 152, 69, 70, 89, 73, 101, 97, - 100, 142, 79, 80, 82, 83, 84, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 87, 90, 92, 98, - 120, 112, 121, 89, 97, 117, 122, 143, 33, 144, - 123, 124, 132, 128, 34, 35, 36, 37, 38, 39, + 12, 55, 148, 4, 149, 72, 5, 6, 7, 8, + 93, 94, 5, 6, 7, 8, 93, 94, 106, 134, + 86, 29, 110, 108, -46, 29, 108, 23, 116, 76, + 109, 111, 103, 136, 77, 24, 13, 14, 15, 16, + 17, 113, 25, 73, 114, 127, 59, 129, 113, 9, + 60, 137, 93, 94, 63, 9, 10, 154, 155, 139, + 11, 61, 10, 115, 102, 199, 11, 200, 133, 138, + 153, 107, 135, 18, 74, 62, 89, 33, 101, 97, + 100, 1, 2, 143, 196, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 69, 70, 73, 71, 79, 82, + 83, 80, 84, 89, 97, 197, 90, 198, 142, 87, + 92, 98, 132, 122, 143, 117, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 158, 171, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 144, 112, 145, 121, + 120, 123, 124, 170, 140, 152, 130, 128, 159, 209, + 156, 163, 205, 172, 162, 179, 174, 182, 173, 192, + 210, 175, 176, 141, 207, 180, 32, 126, 0, 125, + 201, 177, 0, 0, 0, 195, 33, 81, 0, 0, + 0, 0, 206, 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 130, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 140, 149, 156, 164, 163, 153, 166, - 184, 165, 185, 141, 168, 32, 146, 170, 126, 167, - 182, 55, 171, 147, 0, 125, 0, 0, 0, 0, - 0, 81 + 50, 51, 52 }; static const short yycheck[] = { - 2, 7, 3, 1, 3, 4, 5, 6, 3, 4, - 3, 4, 5, 6, 3, 4, 3, 46, 73, 11, - 46, 49, 7, 7, 49, 51, 55, 48, 56, 96, - 85, 56, 48, 8, 9, 10, 11, 12, 49, 49, - 48, 52, 52, 3, 4, 44, 113, 3, 115, 55, - 49, 44, 51, 54, 3, 47, 55, 7, 51, 54, - 127, 3, 55, 48, 46, 54, 121, 54, 43, 41, - 42, 138, 50, 51, 27, 28, 74, 47, 80, 77, - 78, 7, 45, 49, 52, 56, 7, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 3, 7, 3, 50, - 44, 51, 49, 111, 112, 7, 3, 43, 7, 45, - 3, 3, 120, 46, 13, 14, 15, 16, 17, 18, + 2, 17, 131, 1, 131, 11, 3, 4, 5, 6, + 3, 4, 3, 4, 5, 6, 3, 4, 3, 3, + 73, 7, 48, 51, 7, 7, 51, 50, 96, 48, + 58, 57, 85, 58, 53, 50, 8, 9, 10, 11, + 12, 51, 50, 49, 54, 113, 7, 115, 51, 46, + 3, 54, 3, 4, 51, 46, 53, 52, 53, 127, + 57, 3, 53, 56, 50, 194, 57, 194, 121, 56, + 138, 56, 56, 45, 57, 3, 74, 7, 80, 77, + 78, 43, 44, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 27, 28, 49, 48, 47, 54, + 58, 51, 7, 111, 112, 45, 7, 47, 7, 3, + 3, 52, 120, 3, 13, 7, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 49, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 3, 3, 7, 49, 155, 43, 49, - 0, 52, 0, 130, 164, 16, 131, 165, 112, 53, - 172, 17, 166, 131, -1, 111, -1, -1, -1, -1, - -1, 67 + 29, 30, 31, 32, 33, 143, 162, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 45, 53, 47, 51, + 46, 3, 3, 161, 3, 3, 51, 48, 45, 0, + 7, 7, 45, 51, 53, 173, 51, 46, 54, 181, + 0, 55, 54, 130, 52, 174, 16, 112, -1, 111, + 194, 172, -1, -1, -1, 193, 7, 67, -1, -1, + -1, -1, 204, -1, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/bison/bison.simple" @@ -1127,7 +1161,7 @@ yyreduce: switch (yyn) { case 8: -#line 142 "dcParser.yxx" +#line 152 "dcParser.yxx" { current_class = new DCClass(yyvsp[0].str, yyvsp[-1].u.flag, false); if (!dc_file->add_class(current_class)) { @@ -1141,19 +1175,19 @@ case 8: } break; case 10: -#line 158 "dcParser.yxx" +#line 168 "dcParser.yxx" { yyval.u.flag = true; } break; case 11: -#line 162 "dcParser.yxx" +#line 172 "dcParser.yxx" { yyval.u.flag = false; } break; case 12: -#line 169 "dcParser.yxx" +#line 179 "dcParser.yxx" { DCClass *dclass = dc_file->get_class_by_name(yyvsp[0].str); if (dclass == (DCClass *)NULL) { @@ -1165,49 +1199,49 @@ case 12: } break; case 14: -#line 183 "dcParser.yxx" +#line 193 "dcParser.yxx" { yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str; } break; case 16: -#line 191 "dcParser.yxx" +#line 201 "dcParser.yxx" { yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str; } break; case 17: -#line 198 "dcParser.yxx" +#line 208 "dcParser.yxx" { dc_file->add_import_module(yyvsp[0].str); } break; case 18: -#line 202 "dcParser.yxx" +#line 212 "dcParser.yxx" { dc_file->add_import_module(yyvsp[-1].str); } break; case 21: -#line 211 "dcParser.yxx" +#line 221 "dcParser.yxx" { dc_file->add_import_symbol("*"); } break; case 22: -#line 218 "dcParser.yxx" +#line 228 "dcParser.yxx" { dc_file->add_import_symbol(yyvsp[0].str); } break; case 23: -#line 222 "dcParser.yxx" +#line 232 "dcParser.yxx" { dc_file->add_import_symbol(yyvsp[0].str); } break; case 24: -#line 229 "dcParser.yxx" +#line 239 "dcParser.yxx" { DCTypedef *dtypedef = new DCTypedef(yyvsp[0].u.parameter); @@ -1222,7 +1256,7 @@ case 24: } break; case 27: -#line 250 "dcParser.yxx" +#line 260 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); @@ -1230,67 +1264,61 @@ case 27: } break; case 28: -#line 256 "dcParser.yxx" +#line 266 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); } } break; -case 33: -#line 269 "dcParser.yxx" +case 31: +#line 277 "dcParser.yxx" { - current_class->add_field(yyvsp[-1].u.parameter); -} - break; -case 34: -#line 273 "dcParser.yxx" -{ - if (!current_class->add_field(yyvsp[0].u.parameter)) { - yyerror("Duplicate field name: " + yyvsp[0].u.parameter->get_name()); + if (!current_class->add_field(yyvsp[0].u.field)) { + yyerror("Duplicate field name: " + yyvsp[0].u.field->get_name()); } } break; case 35: -#line 282 "dcParser.yxx" +#line 289 "dcParser.yxx" { - current_atomic = new DCAtomicField(yyvsp[-1].str); - if (!current_class->add_field(current_atomic)) { - yyerror("Duplicate field name: " + current_atomic->get_name()); - } + yyval.u.field = yyvsp[-1].u.parameter; +} + break; +case 36: +#line 293 "dcParser.yxx" +{ + yyval.u.field = yyvsp[0].u.parameter; } break; case 37: -#line 293 "dcParser.yxx" +#line 300 "dcParser.yxx" { - DCField *field = current_class->get_field_by_name(yyvsp[0].str); - yyval.u.atomic = (DCAtomicField *)NULL; - if (field == (DCField *)NULL) { - yyerror("Unknown field: " + yyvsp[0].str); - } else { - yyval.u.atomic = field->as_atomic_field(); - if (yyval.u.atomic == (DCAtomicField *)NULL) { - yyerror("Not an atomic field: " + yyvsp[0].str); - } - } + current_atomic = new DCAtomicField(yyvsp[-1].str); } break; -case 42: -#line 319 "dcParser.yxx" +case 38: +#line 304 "dcParser.yxx" +{ + yyval.u.field = current_atomic; +} + break; +case 43: +#line 321 "dcParser.yxx" { atomic_element = DCAtomicField::ElementType(yyvsp[0].u.parameter); current_atomic->add_element(atomic_element); } break; -case 43: -#line 324 "dcParser.yxx" +case 44: +#line 326 "dcParser.yxx" { current_packer = &default_packer; current_packer->begin_pack(yyvsp[-1].u.parameter); } break; -case 44: -#line 329 "dcParser.yxx" +case 45: +#line 331 "dcParser.yxx" { bool is_valid = yyvsp[-3].u.parameter->is_valid(); atomic_element = DCAtomicField::ElementType(yyvsp[-3].u.parameter); @@ -1308,26 +1336,26 @@ case 44: current_atomic->add_element(atomic_element); } break; -case 45: -#line 349 "dcParser.yxx" +case 46: +#line 351 "dcParser.yxx" { current_parameter = yyvsp[0].u.parameter; } break; -case 46: -#line 353 "dcParser.yxx" +case 47: +#line 355 "dcParser.yxx" { yyval.u.parameter = yyvsp[0].u.parameter; } break; -case 50: -#line 369 "dcParser.yxx" +case 51: +#line 371 "dcParser.yxx" { yyval.u.parameter = new DCSimpleParameter(yyvsp[0].u.subatomic); } break; -case 51: -#line 373 "dcParser.yxx" +case 52: +#line 375 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-3].u.subatomic); if (!simple_param->set_range(double_range)) { @@ -1336,8 +1364,8 @@ case 51: yyval.u.parameter = simple_param; } break; -case 52: -#line 381 "dcParser.yxx" +case 53: +#line 383 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-2].u.subatomic); if (yyvsp[0].u.integer == 0) { @@ -1349,8 +1377,8 @@ case 52: yyval.u.parameter = simple_param; } break; -case 53: -#line 392 "dcParser.yxx" +case 54: +#line 394 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic); if (yyvsp[-3].u.integer == 0) { @@ -1365,8 +1393,8 @@ case 53: yyval.u.parameter = simple_param; } break; -case 54: -#line 406 "dcParser.yxx" +case 55: +#line 408 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic); if (yyvsp[0].u.integer == 0) { @@ -1381,8 +1409,8 @@ case 54: yyval.u.parameter = simple_param; } break; -case 55: -#line 420 "dcParser.yxx" +case 56: +#line 422 "dcParser.yxx" { DCTypedef *dtypedef = dc_file->get_typedef_by_name(yyvsp[0].str); if (dtypedef == (DCTypedef *)NULL) { @@ -1402,32 +1430,32 @@ case 55: yyval.u.parameter = dtypedef->make_new_parameter(); } break; -case 56: -#line 442 "dcParser.yxx" -{ - double_range.clear(); -} - break; case 57: -#line 446 "dcParser.yxx" +#line 444 "dcParser.yxx" { double_range.clear(); - if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) { - yyerror("Overlapping range"); - } } break; case 58: -#line 453 "dcParser.yxx" +#line 448 "dcParser.yxx" { double_range.clear(); - if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) { + if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) { yyerror("Overlapping range"); } } break; case 59: -#line 460 "dcParser.yxx" +#line 455 "dcParser.yxx" +{ + double_range.clear(); + if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) { + yyerror("Overlapping range"); + } +} + break; +case 60: +#line 462 "dcParser.yxx" { double_range.clear(); if (yyvsp[0].u.real >= 0) { @@ -1437,24 +1465,24 @@ case 59: } } break; -case 60: -#line 469 "dcParser.yxx" +case 61: +#line 471 "dcParser.yxx" { if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) { yyerror("Overlapping range"); } } break; -case 61: -#line 475 "dcParser.yxx" +case 62: +#line 477 "dcParser.yxx" { if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) { yyerror("Overlapping range"); } } break; -case 62: -#line 481 "dcParser.yxx" +case 63: +#line 483 "dcParser.yxx" { if (yyvsp[0].u.real >= 0) { yyerror("Syntax error"); @@ -1463,14 +1491,14 @@ case 62: } } break; -case 63: -#line 492 "dcParser.yxx" +case 64: +#line 494 "dcParser.yxx" { uint_range.clear(); } break; -case 64: -#line 496 "dcParser.yxx" +case 65: +#line 498 "dcParser.yxx" { if (yyvsp[0].u.integer < 0) { yyerror("Nonnegative values only"); @@ -1482,8 +1510,8 @@ case 64: } } break; -case 65: -#line 507 "dcParser.yxx" +case 66: +#line 509 "dcParser.yxx" { if (yyvsp[-2].u.integer < 0 || yyvsp[0].u.integer < 0) { yyerror("Nonnegative values only"); @@ -1495,8 +1523,8 @@ case 65: } } break; -case 66: -#line 518 "dcParser.yxx" +case 67: +#line 520 "dcParser.yxx" { uint_range.clear(); if (yyvsp[0].u.integer >= 0) { @@ -1508,8 +1536,8 @@ case 66: } } break; -case 67: -#line 529 "dcParser.yxx" +case 68: +#line 531 "dcParser.yxx" { if (yyvsp[0].u.integer < 0) { yyerror("Nonnegative values only"); @@ -1518,8 +1546,8 @@ case 67: } } break; -case 68: -#line 537 "dcParser.yxx" +case 69: +#line 539 "dcParser.yxx" { if (yyvsp[-2].u.integer < 0 || yyvsp[0].u.integer < 0) { yyerror("Nonnegative values only"); @@ -1528,8 +1556,8 @@ case 68: } } break; -case 69: -#line 545 "dcParser.yxx" +case 70: +#line 547 "dcParser.yxx" { if (yyvsp[0].u.integer >= 0) { yyerror("Syntax error"); @@ -1540,21 +1568,21 @@ case 69: } } break; -case 71: -#line 559 "dcParser.yxx" +case 72: +#line 561 "dcParser.yxx" { yyval.u.parameter = new DCArrayParameter(yyvsp[-3].u.parameter, uint_range); } break; -case 72: -#line 566 "dcParser.yxx" +case 73: +#line 568 "dcParser.yxx" { current_parameter->set_name(yyvsp[0].str); yyval.u.parameter = current_parameter; } break; -case 73: -#line 571 "dcParser.yxx" +case 74: +#line 573 "dcParser.yxx" { if (yyvsp[0].u.integer == 0) { yyerror("Invalid divisor."); @@ -1569,289 +1597,307 @@ case 73: } } break; -case 74: -#line 585 "dcParser.yxx" +case 75: +#line 587 "dcParser.yxx" { yyval.u.parameter = new DCArrayParameter(yyvsp[-3].u.parameter, uint_range); } break; -case 75: -#line 592 "dcParser.yxx" +case 76: +#line 594 "dcParser.yxx" { yyval.u.real = (double)yyvsp[0].u.integer; } break; -case 77: -#line 600 "dcParser.yxx" +case 78: +#line 602 "dcParser.yxx" { current_packer->pack_int64(yyvsp[0].u.integer); } break; -case 78: -#line 604 "dcParser.yxx" +case 79: +#line 606 "dcParser.yxx" { current_packer->pack_double(yyvsp[0].u.real); } break; -case 79: -#line 608 "dcParser.yxx" +case 80: +#line 610 "dcParser.yxx" { current_packer->pack_string(yyvsp[0].str); } break; -case 80: -#line 612 "dcParser.yxx" +case 81: +#line 614 "dcParser.yxx" { current_packer->pack_literal_value(yyvsp[0].str); } break; -case 81: -#line 616 "dcParser.yxx" +case 82: +#line 618 "dcParser.yxx" { current_packer->push(); } break; -case 82: -#line 620 "dcParser.yxx" -{ - current_packer->pop(); -} - break; case 83: -#line 624 "dcParser.yxx" +#line 622 "dcParser.yxx" { - current_packer->push(); + current_packer->pop(); } break; case 84: -#line 628 "dcParser.yxx" -{ - current_packer->pop(); -} - break; -case 85: -#line 632 "dcParser.yxx" +#line 626 "dcParser.yxx" { current_packer->push(); } break; -case 86: -#line 636 "dcParser.yxx" +case 85: +#line 630 "dcParser.yxx" { current_packer->pop(); } break; +case 86: +#line 634 "dcParser.yxx" +{ + current_packer->push(); +} + break; case 87: -#line 640 "dcParser.yxx" +#line 638 "dcParser.yxx" +{ + current_packer->pop(); +} + break; +case 88: +#line 642 "dcParser.yxx" { for (int i = 0; i < yyvsp[0].u.integer; i++) { current_packer->pack_int64(yyvsp[-2].u.integer); } } break; -case 88: -#line 646 "dcParser.yxx" +case 89: +#line 648 "dcParser.yxx" { for (int i = 0; i < yyvsp[0].u.integer; i++) { current_packer->pack_double(yyvsp[-2].u.real); } } break; -case 89: -#line 652 "dcParser.yxx" +case 90: +#line 654 "dcParser.yxx" { for (int i = 0; i < yyvsp[0].u.integer; i++) { current_packer->pack_literal_value(yyvsp[-2].str); } } break; -case 96: -#line 676 "dcParser.yxx" +case 97: +#line 678 "dcParser.yxx" { yyval.u.subatomic = ST_int8; } break; -case 97: -#line 680 "dcParser.yxx" +case 98: +#line 682 "dcParser.yxx" { yyval.u.subatomic = ST_int16; } break; -case 98: -#line 684 "dcParser.yxx" +case 99: +#line 686 "dcParser.yxx" { yyval.u.subatomic = ST_int32; } break; -case 99: -#line 688 "dcParser.yxx" +case 100: +#line 690 "dcParser.yxx" { yyval.u.subatomic = ST_int64; } break; -case 100: -#line 692 "dcParser.yxx" +case 101: +#line 694 "dcParser.yxx" { yyval.u.subatomic = ST_uint8; } break; -case 101: -#line 696 "dcParser.yxx" +case 102: +#line 698 "dcParser.yxx" { yyval.u.subatomic = ST_uint16; } break; -case 102: -#line 700 "dcParser.yxx" +case 103: +#line 702 "dcParser.yxx" { yyval.u.subatomic = ST_uint32; } break; -case 103: -#line 704 "dcParser.yxx" +case 104: +#line 706 "dcParser.yxx" { yyval.u.subatomic = ST_uint64; } break; -case 104: -#line 708 "dcParser.yxx" +case 105: +#line 710 "dcParser.yxx" { yyval.u.subatomic = ST_float64; } break; -case 105: -#line 712 "dcParser.yxx" +case 106: +#line 714 "dcParser.yxx" { yyval.u.subatomic = ST_string; } break; -case 106: -#line 716 "dcParser.yxx" +case 107: +#line 718 "dcParser.yxx" { yyval.u.subatomic = ST_blob; } break; -case 107: -#line 720 "dcParser.yxx" +case 108: +#line 722 "dcParser.yxx" { yyval.u.subatomic = ST_blob32; } break; -case 108: -#line 724 "dcParser.yxx" +case 109: +#line 726 "dcParser.yxx" { yyval.u.subatomic = ST_int8array; } break; -case 109: -#line 728 "dcParser.yxx" +case 110: +#line 730 "dcParser.yxx" { yyval.u.subatomic = ST_int16array; } break; -case 110: -#line 732 "dcParser.yxx" +case 111: +#line 734 "dcParser.yxx" { yyval.u.subatomic = ST_int32array; } break; -case 111: -#line 736 "dcParser.yxx" +case 112: +#line 738 "dcParser.yxx" { yyval.u.subatomic = ST_uint8array; } break; -case 112: -#line 740 "dcParser.yxx" +case 113: +#line 742 "dcParser.yxx" { yyval.u.subatomic = ST_uint16array; } break; -case 113: -#line 744 "dcParser.yxx" +case 114: +#line 746 "dcParser.yxx" { yyval.u.subatomic = ST_uint32array; } break; -case 114: -#line 748 "dcParser.yxx" +case 115: +#line 750 "dcParser.yxx" { yyval.u.subatomic = ST_uint32uint8array; } break; -case 116: -#line 756 "dcParser.yxx" +case 117: +#line 758 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_required); } break; -case 117: -#line 760 "dcParser.yxx" +case 118: +#line 762 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_broadcast); } break; -case 118: -#line 764 "dcParser.yxx" +case 119: +#line 766 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_p2p); } break; -case 119: -#line 768 "dcParser.yxx" +case 120: +#line 770 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_ram); } break; -case 120: -#line 772 "dcParser.yxx" +case 121: +#line 774 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_db); } break; -case 121: -#line 776 "dcParser.yxx" +case 122: +#line 778 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_clsend); } break; -case 122: -#line 780 "dcParser.yxx" +case 123: +#line 782 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_clrecv); } break; -case 123: -#line 784 "dcParser.yxx" +case 124: +#line 786 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_ownsend); } break; -case 124: -#line 788 "dcParser.yxx" +case 125: +#line 790 "dcParser.yxx" { current_atomic->add_flag(DCAtomicField::F_airecv); } break; -case 125: -#line 795 "dcParser.yxx" +case 126: +#line 797 "dcParser.yxx" { current_molecular = new DCMolecularField(yyvsp[-1].str); - if (!current_class->add_field(current_molecular)) { - yyerror("Duplicate field name: " + current_molecular->get_name()); - } } break; case 127: -#line 806 "dcParser.yxx" +#line 801 "dcParser.yxx" +{ + yyval.u.field = current_molecular; +} + break; +case 128: +#line 808 "dcParser.yxx" +{ + DCField *field = current_class->get_field_by_name(yyvsp[0].str); + yyval.u.atomic = (DCAtomicField *)NULL; + if (field == (DCField *)NULL) { + yyerror("Unknown field: " + yyvsp[0].str); + } else { + yyval.u.atomic = field->as_atomic_field(); + if (yyval.u.atomic == (DCAtomicField *)NULL) { + yyerror("Not an atomic field: " + yyvsp[0].str); + } + } +} + break; +case 129: +#line 824 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); } } break; -case 128: -#line 812 "dcParser.yxx" +case 130: +#line 830 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); @@ -1863,6 +1909,65 @@ case 128: } } break; +case 131: +#line 844 "dcParser.yxx" +{ + yyval.str = ""; +} + break; +case 133: +#line 852 "dcParser.yxx" +{ + yyval.u.field = current_switch; + current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.parameter); +} + break; +case 134: +#line 857 "dcParser.yxx" +{ + yyval.u.field = current_switch; + current_switch = (DCSwitch *)yyvsp[-2].u.parameter; +} + break; +case 138: +#line 869 "dcParser.yxx" +{ + if (current_switch->get_num_cases() == 0) { + yyerror("case declaration required before first element"); + } else if (!current_switch->add_field(yyvsp[0].u.field)) { + yyerror("Duplicate field name: " + yyvsp[0].u.field->get_name()); + } +} + break; +case 139: +#line 880 "dcParser.yxx" +{ + current_packer = &default_packer; + current_packer->begin_pack(current_switch->get_switch_parameter()); +} + break; +case 140: +#line 885 "dcParser.yxx" +{ + if (!current_packer->end_pack()) { + yyerror("Invalid value for switch parameter"); + } else { + current_switch->add_case(current_packer->get_string()); + } +} + break; +case 142: +#line 897 "dcParser.yxx" +{ + yyval.u.field = yyvsp[-1].u.parameter; +} + break; +case 143: +#line 901 "dcParser.yxx" +{ + yyval.u.field = yyvsp[0].u.parameter; +} + break; } #line 705 "/usr/share/bison/bison.simple" @@ -2096,4 +2201,4 @@ yyreturn: #endif return yyresult; } -#line 827 "dcParser.yxx" +#line 909 "dcParser.yxx" diff --git a/direct/src/dcparser/dcParser.h.prebuilt b/direct/src/dcparser/dcParser.h.prebuilt index bdaac625ea..08fde320bd 100644 --- a/direct/src/dcparser/dcParser.h.prebuilt +++ b/direct/src/dcparser/dcParser.h.prebuilt @@ -11,36 +11,38 @@ # define KW_FROM 264 # define KW_IMPORT 265 # define KW_TYPEDEF 266 -# define KW_INT8 267 -# define KW_INT16 268 -# define KW_INT32 269 -# define KW_INT64 270 -# define KW_UINT8 271 -# define KW_UINT16 272 -# define KW_UINT32 273 -# define KW_UINT64 274 -# define KW_FLOAT64 275 -# define KW_STRING 276 -# define KW_BLOB 277 -# define KW_BLOB32 278 -# define KW_INT8ARRAY 279 -# define KW_INT16ARRAY 280 -# define KW_INT32ARRAY 281 -# define KW_UINT8ARRAY 282 -# define KW_UINT16ARRAY 283 -# define KW_UINT32ARRAY 284 -# define KW_UINT32UINT8ARRAY 285 -# define KW_REQUIRED 286 -# define KW_BROADCAST 287 -# define KW_P2P 288 -# define KW_RAM 289 -# define KW_DB 290 -# define KW_CLSEND 291 -# define KW_CLRECV 292 -# define KW_OWNSEND 293 -# define KW_AIRECV 294 -# define START_DC 295 -# define START_PARAMETER_VALUE 296 +# define KW_SWITCH 267 +# define KW_CASE 268 +# define KW_INT8 269 +# define KW_INT16 270 +# define KW_INT32 271 +# define KW_INT64 272 +# define KW_UINT8 273 +# define KW_UINT16 274 +# define KW_UINT32 275 +# define KW_UINT64 276 +# define KW_FLOAT64 277 +# define KW_STRING 278 +# define KW_BLOB 279 +# define KW_BLOB32 280 +# define KW_INT8ARRAY 281 +# define KW_INT16ARRAY 282 +# define KW_INT32ARRAY 283 +# define KW_UINT8ARRAY 284 +# define KW_UINT16ARRAY 285 +# define KW_UINT32ARRAY 286 +# define KW_UINT32UINT8ARRAY 287 +# define KW_REQUIRED 288 +# define KW_BROADCAST 289 +# define KW_P2P 290 +# define KW_RAM 291 +# define KW_DB 292 +# define KW_CLSEND 293 +# define KW_CLRECV 294 +# define KW_OWNSEND 295 +# define KW_AIRECV 296 +# define START_DC 297 +# define START_PARAMETER_VALUE 298 extern YYSTYPE dcyylval;