support spaces in node names

This commit is contained in:
David Rose 2005-10-14 21:38:51 +00:00
parent b49c72cc5d
commit 0d8cfd3131
5 changed files with 3471 additions and 3159 deletions

View File

@ -28,7 +28,7 @@
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
#include <errno.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
@ -41,6 +41,8 @@
#ifdef __cplusplus
#include <stdlib.h>
#ifndef _WIN32
#endif
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
@ -80,6 +82,7 @@
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
@ -302,47 +305,51 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 34
#define YY_END_OF_BUFFER 35
static yyconst short int yy_acclist[172] =
#define YY_NUM_RULES 35
#define YY_END_OF_BUFFER 36
static yyconst short int yy_acclist[194] =
{ 0,
35, 33, 34, 2, 33, 34, 1, 34, 30, 33,
34, 4, 33, 34, 33, 34, 10, 33, 34, 32,
33, 34, 9, 33, 34, 33, 34, 26, 33, 34,
11, 33, 34, 31, 33, 34, 7, 33, 34, 8,
33, 34, 32, 33, 34, 32, 33, 34, 32, 33,
34, 32, 33, 34, 32, 33, 34, 32, 33, 34,
32, 33, 34, 32, 33, 34, 32, 33, 34, 32,
33, 34, 5, 33, 34, 6, 33, 34, 1, 4,
26, 32, 26, 32, 3, 27,16412, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
36, 34, 35, 2, 34, 35, 1, 35, 30, 34,
35, 4, 34, 35, 34, 35, 10, 34, 35, 32,
34, 35, 9, 34, 35, 34, 35, 26, 34, 35,
11, 34, 35, 31, 34, 35, 7, 34, 35, 8,
34, 35, 32, 34, 35, 32, 34, 35, 32, 34,
35, 32, 34, 35, 32, 34, 35, 32, 34, 35,
32, 34, 35, 32, 34, 35, 32, 34, 35, 32,
34, 35, 5, 34, 35, 6, 34, 35, 1, 4,
26, 32, 33, 26, 32, 32, 33, 3, 27,16412,
26, 27,16412, 33, 26, 33, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 33, 32, 33, 32, 33, 32, 33, 29,
3, 27, 33, 33, 33, 33, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
8220, 32, 13, 32, 14, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 25, 32, 29, 29,
12, 32, 32, 32, 17, 32, 19, 32, 32, 32,
24, 32, 32, 22, 32, 32, 32, 16, 32, 18,
32, 20, 32, 32, 32, 29, 15, 32, 32, 23,
32, 21, 32
32, 29, 3, 27, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 8220, 32,
13, 32, 14, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 25, 32, 29, 29, 12, 32,
32, 32, 17, 32, 19, 32, 32, 32, 24, 32,
32, 22, 32, 32, 32, 16, 32, 18, 32, 20,
32, 32, 32, 29, 15, 32, 32, 23, 32, 21,
32
} ;
static yyconst short int yy_accept[122] =
static yyconst short int yy_accept[136] =
{ 0,
1, 1, 1, 2, 4, 7, 9, 12, 15, 17,
20, 23, 26, 28, 31, 34, 37, 40, 43, 46,
49, 52, 55, 58, 61, 64, 67, 70, 73, 76,
79, 80, 81, 81, 82, 83, 85, 85, 86, 88,
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 103, 104, 104, 105,
106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
116, 117, 118, 119, 119, 119, 119, 119, 119, 120,
121, 123, 125, 126, 127, 128, 129, 130, 131, 132,
133, 134, 135, 137, 138, 139, 141, 142, 143, 145,
79, 80, 81, 81, 82, 84, 86, 88, 88, 89,
91, 94, 95, 95, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 114, 116, 118, 120, 121, 121, 122, 122, 123,
124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
134, 135, 136, 137, 138, 139, 140, 141, 141, 141,
141, 141, 141, 142, 143, 145, 147, 148, 149, 150,
147, 148, 149, 151, 152, 154, 155, 155, 156, 158,
160, 162, 163, 164, 164, 165, 167, 168, 170, 172,
172
151, 152, 153, 154, 155, 156, 157, 159, 160, 161,
163, 164, 165, 167, 169, 170, 171, 173, 174, 176,
177, 177, 178, 180, 182, 184, 185, 186, 186, 187,
189, 190, 192, 194, 194
} ;
static yyconst int yy_ec[256] =
@ -350,17 +357,17 @@ static yyconst int yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
1, 1, 7, 8, 9, 10, 11, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 1, 13, 14,
1, 1, 1, 1, 18, 19, 20, 21, 22, 23,
24, 25, 26, 17, 17, 27, 28, 29, 30, 31,
17, 32, 33, 34, 35, 17, 36, 17, 37, 17,
15, 1, 16, 1, 17, 1, 18, 19, 20, 21,
1, 5, 1, 6, 7, 1, 1, 1, 1, 1,
1, 1, 8, 9, 10, 11, 12, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 1, 14, 15,
1, 1, 1, 1, 19, 20, 21, 22, 23, 24,
25, 26, 27, 18, 18, 28, 29, 30, 31, 32,
18, 33, 34, 35, 36, 18, 37, 18, 38, 18,
16, 1, 17, 1, 18, 1, 19, 20, 21, 22,
22, 23, 24, 25, 26, 17, 17, 27, 28, 29,
30, 31, 17, 32, 33, 34, 35, 17, 36, 17,
37, 17, 38, 1, 39, 1, 1, 1, 1, 1,
23, 24, 25, 26, 27, 18, 18, 28, 29, 30,
31, 32, 18, 33, 34, 35, 36, 18, 37, 18,
38, 18, 39, 1, 40, 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,
@ -377,124 +384,120 @@ static yyconst int yy_ec[256] =
1, 1, 1, 1, 1
} ;
static yyconst int yy_meta[40] =
static yyconst int yy_meta[41] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 3, 3,
1, 3, 1, 1, 1, 1, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 1, 1
1, 2, 3, 1, 2, 1, 1, 1, 2, 4,
5, 1, 6, 2, 1, 1, 1, 4, 4, 4,
4, 4, 6, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 1, 1
} ;
static yyconst short int yy_base[125] =
static yyconst short int yy_base[146] =
{ 0,
0, 0, 266, 267, 267, 0, 267, 0, 30, 267,
31, 253, 253, 42, 267, 267, 267, 267, 253, 35,
36, 37, 38, 39, 43, 41, 49, 46, 267, 267,
0, 0, 250, 73, 251, 80, 87, 0, 108, 89,
48, 50, 47, 62, 77, 84, 88, 93, 94, 95,
96, 97, 109, 98, 134, 125, 0, 248, 143, 113,
117, 118, 128, 130, 138, 144, 103, 142, 147, 149,
148, 51, 151, 153, 247, 157, 246, 169, 267, 154,
247, 246, 163, 165, 164, 166, 173, 168, 174, 176,
177, 178, 245, 194, 202, 244, 183, 189, 243, 242,
0, 0, 234, 235, 235, 0, 235, 0, 30, 235,
34, 220, 220, 46, 235, 235, 235, 235, 0, 198,
192, 16, 15, 201, 27, 205, 33, 196, 235, 235,
0, 0, 213, 56, 58, 70, 0, 53, 0, 83,
220, 64, 76, 98, 0, 0, 191, 188, 203, 186,
184, 188, 187, 180, 183, 184, 185, 187, 185, 178,
77, 85, 0, 0, 111, 118, 0, 197, 94, 104,
105, 0, 0, 190, 185, 174, 172, 182, 164, 174,
161, 164, 155, 153, 163, 156, 147, 116, 150, 119,
145, 131, 235, 119, 0, 0, 129, 126, 131, 117,
180, 203, 240, 207, 237, 208, 214, 209, 234, 231,
230, 188, 210, 225, 226, 226, 220, 225, 221, 267,
242, 245, 191, 248
117, 119, 120, 111, 105, 104, 0, 124, 0, 0,
104, 100, 0, 0, 88, 81, 0, 82, 0, 72,
133, 61, 0, 0, 0, 47, 55, 60, 146, 0,
30, 0, 0, 235, 160, 166, 169, 174, 177, 180,
183, 188, 194, 197, 200
} ;
static yyconst short int yy_def[125] =
static yyconst short int yy_def[146] =
{ 0,
120, 1, 120, 120, 120, 121, 120, 122, 120, 120,
123, 120, 120, 120, 120, 120, 120, 120, 123, 123,
123, 123, 123, 123, 123, 123, 123, 123, 120, 120,
121, 122, 120, 120, 123, 123, 120, 124, 120, 120,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 123, 120, 120, 124, 120, 120, 123,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 120, 120, 120, 120, 120, 120, 123,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 120, 120, 123, 123, 123, 123, 123,
134, 1, 134, 134, 134, 135, 134, 136, 134, 134,
137, 134, 134, 138, 134, 134, 134, 134, 139, 139,
139, 139, 139, 139, 139, 139, 139, 139, 134, 134,
135, 136, 134, 134, 140, 137, 141, 142, 143, 134,
40, 144, 142, 138, 145, 139, 139, 139, 139, 139,
139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
140, 140, 141, 141, 134, 134, 143, 134, 40, 144,
144, 145, 145, 139, 139, 139, 139, 139, 139, 139,
139, 139, 139, 139, 139, 139, 139, 134, 134, 134,
134, 134, 134, 139, 139, 139, 139, 139, 139, 139,
123, 123, 123, 123, 123, 123, 120, 123, 123, 123,
123, 123, 123, 120, 120, 123, 123, 123, 123, 0,
120, 120, 120, 120
139, 139, 139, 139, 139, 139, 139, 142, 108, 139,
139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
134, 139, 139, 139, 139, 139, 139, 134, 134, 139,
139, 139, 139, 0, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134
} ;
static yyconst short int yy_nxt[307] =
static yyconst short int yy_nxt[276] =
{ 0,
4, 5, 6, 5, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 19, 24, 19, 19, 19, 19, 19, 19, 19,
19, 19, 25, 26, 27, 28, 19, 29, 30, 33,
33, 34, 36, 39, 120, 120, 120, 120, 120, 39,
120, 40, 120, 34, 39, 120, 120, 120, 120, 120,
120, 43, 51, 48, 62, 47, 41, 45, 52, 44,
92, 120, 42, 46, 39, 54, 49, 53, 50, 60,
39, 39, 40, 61, 34, 39, 120, 39, 55, 40,
55, 36, 39, 120, 55, 63, 55, 120, 37, 55,
4, 5, 6, 5, 5, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 19, 24, 19, 19, 19, 19, 19, 19,
19, 19, 19, 25, 26, 27, 28, 19, 29, 30,
33, 49, 34, 35, 33, 51, 36, 40, 54, 50,
41, 52, 133, 58, 40, 42, 43, 40, 44, 40,
41, 55, 59, 56, 40, 38, 43, 61, 34, 40,
62, 40, 129, 70, 41, 66, 71, 132, 40, 35,
43, 131, 36, 40, 40, 130, 61, 40, 38, 62,
68, 40, 68, 127, 61, 69, 40, 62, 66, 40,
37, 55, 120, 120, 120, 120, 120, 120, 56, 39,
56, 64, 120, 65, 58, 39, 58, 66, 120, 59,
39, 71, 120, 70, 69, 68, 120, 120, 67, 73,
80, 77, 87, 77, 72, 55, 78, 120, 81, 120,
74, 55, 74, 75, 39, 76, 55, 120, 84, 82,
39, 120, 79, 120, 59, 39, 120, 120, 120, 83,
120, 86, 75, 120, 76, 91, 95, 88, 76, 85,
55, 93, 120, 120, 120, 120, 55, 120, 89, 90,
78, 55, 120, 120, 99, 120, 120, 120, 97, 120,
96, 98, 120, 35, 103, 55, 102, 120, 120, 100,
126, 134, 41, 134, 93, 125, 40, 42, 43, 124,
44, 40, 65, 70, 70, 65, 71, 71, 88, 65,
88, 89, 123, 90, 65, 91, 89, 91, 90, 109,
92, 90, 65, 122, 120, 65, 108, 119, 118, 65,
128, 117, 128, 92, 65, 129, 121, 65, 116, 115,
65, 114, 113, 112, 65, 111, 110, 92, 129, 65,
31, 31, 108, 31, 31, 31, 32, 32, 107, 32,
32, 32, 37, 37, 37, 45, 106, 45, 45, 45,
46, 105, 46, 63, 104, 63, 64, 103, 64, 65,
102, 101, 100, 65, 67, 67, 99, 67, 67, 67,
110, 55, 104, 55, 101, 94, 55, 106, 105, 55,
109, 108, 120, 94, 55, 107, 120, 120, 120, 120,
114, 117, 114, 107, 112, 115, 111, 55, 113, 120,
120, 118, 116, 55, 120, 120, 115, 115, 55, 120,
120, 119, 31, 120, 31, 32, 120, 32, 57, 120,
57, 120, 120, 120, 120, 120, 120, 78, 94, 59,
120, 37, 120, 38, 37, 120, 3, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120
72, 98, 72, 73, 97, 73, 96, 95, 94, 69,
87, 86, 85, 84, 83, 82, 81, 80, 79, 78,
77, 76, 75, 74, 41, 38, 60, 57, 53, 48,
47, 39, 38, 134, 3, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134
} ;
static yyconst short int yy_chk[307] =
static yyconst short int yy_chk[276] =
{ 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, 9,
11, 9, 11, 14, 20, 21, 22, 23, 24, 14,
26, 14, 25, 14, 14, 28, 43, 41, 27, 42,
72, 22, 26, 25, 43, 24, 20, 23, 27, 22,
72, 44, 21, 23, 34, 28, 25, 27, 25, 41,
34, 36, 34, 42, 34, 34, 45, 36, 37, 36,
40, 36, 36, 46, 37, 44, 40, 47, 37, 37,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
9, 22, 9, 11, 11, 23, 11, 14, 25, 22,
14, 23, 131, 27, 14, 14, 14, 34, 14, 14,
34, 25, 27, 25, 34, 38, 34, 35, 34, 34,
35, 36, 128, 42, 36, 38, 42, 127, 36, 36,
36, 126, 36, 36, 40, 122, 61, 40, 43, 61,
40, 40, 40, 120, 62, 40, 40, 62, 43, 44,
40, 40, 48, 49, 50, 51, 52, 54, 37, 39,
40, 45, 67, 46, 39, 39, 39, 47, 53, 39,
39, 52, 60, 51, 50, 49, 61, 62, 48, 54,
60, 56, 67, 56, 53, 55, 56, 63, 61, 64,
55, 55, 55, 55, 59, 55, 55, 65, 64, 62,
59, 68, 59, 66, 59, 59, 69, 71, 70, 63,
73, 66, 74, 80, 74, 71, 76, 68, 76, 65,
78, 73, 83, 85, 84, 86, 78, 88, 69, 70,
78, 78, 87, 89, 85, 90, 91, 92, 83, 101,
80, 84, 97, 123, 89, 94, 88, 112, 98, 86,
118, 69, 44, 69, 69, 116, 44, 44, 44, 115,
44, 44, 65, 70, 71, 65, 70, 71, 65, 65,
65, 65, 112, 65, 65, 66, 88, 66, 88, 90,
66, 90, 92, 111, 106, 92, 108, 105, 104, 92,
121, 103, 121, 92, 92, 121, 108, 129, 102, 101,
129, 100, 99, 98, 129, 97, 94, 91, 129, 129,
135, 135, 89, 135, 135, 135, 136, 136, 87, 136,
136, 136, 137, 137, 137, 138, 86, 138, 138, 138,
139, 85, 139, 140, 84, 140, 141, 83, 141, 142,
82, 81, 80, 142, 143, 143, 79, 143, 143, 143,
101, 94, 90, 95, 87, 94, 94, 92, 91, 95,
98, 97, 102, 95, 95, 94, 104, 106, 108, 113,
107, 112, 107, 95, 104, 107, 102, 115, 106, 117,
119, 113, 108, 115, 118, 116, 114, 115, 115, 111,
110, 117, 121, 109, 121, 122, 105, 122, 124, 103,
124, 100, 99, 96, 93, 82, 81, 77, 75, 58,
35, 33, 19, 13, 12, 3, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 120, 120
144, 78, 144, 145, 77, 145, 76, 75, 74, 68,
60, 59, 58, 57, 56, 55, 54, 53, 52, 51,
50, 49, 48, 47, 41, 33, 28, 26, 24, 21,
20, 13, 12, 3, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
134, 134, 134, 134, 134
} ;
static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
@ -919,7 +922,7 @@ inline void accept() {
x_col_number += yyleng;
}
#line 924 "lex.yy.c"
#line 927 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -1019,9 +1022,20 @@ YY_MALLOC_DECL
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(yyin); \
} \
}
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@ -1067,16 +1081,16 @@ YY_MALLOC_DECL
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp = NULL, *yy_bp = NULL;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 406 "xLexer.lxx"
#line 407 "xLexer.lxx"
#line 1081 "lex.yy.c"
#line 1095 "lex.yy.c"
if ( yy_init )
{
@ -1124,14 +1138,14 @@ 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 >= 121 )
if ( yy_current_state >= 135 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state;
++yy_cp;
}
while ( yy_base[yy_current_state] != 267 );
while ( yy_base[yy_current_state] != 235 );
yy_find_action:
yy_current_state = *--yy_state_ptr;
@ -1182,7 +1196,7 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
#line 411 "xLexer.lxx"
#line 412 "xLexer.lxx"
{
// New line. Save a copy of the line so we can print it out for the
// benefit of the user in case we get an error.
@ -1199,7 +1213,7 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
#line 425 "xLexer.lxx"
#line 426 "xLexer.lxx"
{
// Eat whitespace.
accept();
@ -1207,7 +1221,7 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
#line 430 "xLexer.lxx"
#line 431 "xLexer.lxx"
{
// Eat C++-style comments.
accept();
@ -1215,7 +1229,7 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
#line 435 "xLexer.lxx"
#line 436 "xLexer.lxx"
{
// Eat sh-style comments.
accept();
@ -1223,7 +1237,7 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 440 "xLexer.lxx"
#line 441 "xLexer.lxx"
{
accept();
return TOKEN_OBRACE;
@ -1231,7 +1245,7 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
#line 445 "xLexer.lxx"
#line 446 "xLexer.lxx"
{
accept();
return TOKEN_CBRACE;
@ -1239,7 +1253,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
#line 450 "xLexer.lxx"
#line 451 "xLexer.lxx"
{
accept();
return TOKEN_OBRACKET;
@ -1247,7 +1261,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
#line 455 "xLexer.lxx"
#line 456 "xLexer.lxx"
{
accept();
return TOKEN_CBRACKET;
@ -1255,7 +1269,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
#line 460 "xLexer.lxx"
#line 461 "xLexer.lxx"
{
accept();
return TOKEN_DOT;
@ -1263,7 +1277,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
#line 465 "xLexer.lxx"
#line 466 "xLexer.lxx"
{
accept();
return TOKEN_COMMA;
@ -1271,7 +1285,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
#line 470 "xLexer.lxx"
#line 471 "xLexer.lxx"
{
accept();
return TOKEN_SEMICOLON;
@ -1279,7 +1293,7 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
#line 475 "xLexer.lxx"
#line 476 "xLexer.lxx"
{
accept();
return TOKEN_ARRAY;
@ -1287,7 +1301,7 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
#line 480 "xLexer.lxx"
#line 481 "xLexer.lxx"
{
accept();
return TOKEN_UCHAR;
@ -1295,7 +1309,7 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
#line 485 "xLexer.lxx"
#line 486 "xLexer.lxx"
{
accept();
return TOKEN_CHAR;
@ -1303,7 +1317,7 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
#line 490 "xLexer.lxx"
#line 491 "xLexer.lxx"
{
accept();
return TOKEN_CSTRING;
@ -1311,7 +1325,7 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
#line 495 "xLexer.lxx"
#line 496 "xLexer.lxx"
{
accept();
return TOKEN_DOUBLE;
@ -1319,7 +1333,7 @@ YY_RULE_SETUP
YY_BREAK
case 17:
YY_RULE_SETUP
#line 500 "xLexer.lxx"
#line 501 "xLexer.lxx"
{
accept();
return TOKEN_DWORD;
@ -1327,7 +1341,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
#line 505 "xLexer.lxx"
#line 506 "xLexer.lxx"
{
accept();
return TOKEN_SDWORD;
@ -1335,7 +1349,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
#line 510 "xLexer.lxx"
#line 511 "xLexer.lxx"
{
accept();
return TOKEN_FLOAT;
@ -1343,7 +1357,7 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
#line 515 "xLexer.lxx"
#line 516 "xLexer.lxx"
{
accept();
return TOKEN_LPSTR;
@ -1351,7 +1365,7 @@ YY_RULE_SETUP
YY_BREAK
case 21:
YY_RULE_SETUP
#line 520 "xLexer.lxx"
#line 521 "xLexer.lxx"
{
accept();
return TOKEN_TEMPLATE;
@ -1359,7 +1373,7 @@ YY_RULE_SETUP
YY_BREAK
case 22:
YY_RULE_SETUP
#line 525 "xLexer.lxx"
#line 526 "xLexer.lxx"
{
accept();
return TOKEN_UCHAR;
@ -1367,7 +1381,7 @@ YY_RULE_SETUP
YY_BREAK
case 23:
YY_RULE_SETUP
#line 530 "xLexer.lxx"
#line 531 "xLexer.lxx"
{
accept();
return TOKEN_UNICODE;
@ -1375,7 +1389,7 @@ YY_RULE_SETUP
YY_BREAK
case 24:
YY_RULE_SETUP
#line 535 "xLexer.lxx"
#line 536 "xLexer.lxx"
{
accept();
return TOKEN_SWORD;
@ -1383,7 +1397,7 @@ YY_RULE_SETUP
YY_BREAK
case 25:
YY_RULE_SETUP
#line 540 "xLexer.lxx"
#line 541 "xLexer.lxx"
{
accept();
return TOKEN_WORD;
@ -1391,19 +1405,19 @@ YY_RULE_SETUP
YY_BREAK
case 26:
YY_RULE_SETUP
#line 545 "xLexer.lxx"
#line 546 "xLexer.lxx"
{
// A signed or unsigned integer number.
accept();
xyylval.u.number = atol(xyytext);
xyylval.str = yytext;
xyylval.str = trim_right(xyytext);
return TOKEN_INTEGER;
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 554 "xLexer.lxx"
#line 555 "xLexer.lxx"
{
// An integer as part of a semicolon- or comma-delimited list.
accept();
@ -1414,7 +1428,7 @@ YY_RULE_SETUP
YY_BREAK
case 28:
YY_RULE_SETUP
#line 562 "xLexer.lxx"
#line 563 "xLexer.lxx"
{
// This rule is used to match an integer list that is followed by a
// floating-point number. It's designed to prevent "0;0.5" from
@ -1427,7 +1441,7 @@ YY_RULE_SETUP
YY_BREAK
case 29:
YY_RULE_SETUP
#line 572 "xLexer.lxx"
#line 573 "xLexer.lxx"
{
// A floating-point number as part of a semicolon- or comma-delimited list.
accept();
@ -1438,7 +1452,7 @@ YY_RULE_SETUP
YY_BREAK
case 30:
YY_RULE_SETUP
#line 580 "xLexer.lxx"
#line 581 "xLexer.lxx"
{
// Quoted string.
accept();
@ -1448,7 +1462,7 @@ YY_RULE_SETUP
YY_BREAK
case 31:
YY_RULE_SETUP
#line 587 "xLexer.lxx"
#line 588 "xLexer.lxx"
{
// Long GUID string.
accept();
@ -1463,7 +1477,7 @@ YY_RULE_SETUP
YY_BREAK
case 32:
YY_RULE_SETUP
#line 599 "xLexer.lxx"
#line 600 "xLexer.lxx"
{
// Identifier.
accept();
@ -1474,18 +1488,28 @@ YY_RULE_SETUP
case 33:
YY_RULE_SETUP
#line 607 "xLexer.lxx"
{
// Identifier with leading digit.
accept();
xyylval.str = xyytext;
return TOKEN_NAME;
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 615 "xLexer.lxx"
{
// Any other character is invalid.
accept();
xyyerror("Invalid character '" + string(xyytext) + "'.");
}
YY_BREAK
case 34:
case 35:
YY_RULE_SETUP
#line 612 "xLexer.lxx"
#line 620 "xLexer.lxx"
ECHO;
YY_BREAK
#line 1490 "lex.yy.c"
#line 1514 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@ -1774,7 +1798,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 >= 121 )
if ( yy_current_state >= 135 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1804,11 +1828,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 >= 121 )
if ( yy_current_state >= 135 )
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 == 120);
yy_is_jam = (yy_current_state == 134);
if ( ! yy_is_jam )
*yy_state_ptr++ = yy_current_state;
@ -2043,6 +2067,14 @@ YY_BUFFER_STATE b;
}
#ifndef _WIN32
#else
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
@ -2360,4 +2392,4 @@ int main()
return 0;
}
#endif
#line 612 "xLexer.lxx"
#line 620 "xLexer.lxx"

View File

@ -402,6 +402,7 @@ inline void accept() {
INTEGERNUM ([+-]?([0-9]+))
REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?)
SEPARATOR [ \t;,]+
WHITESPACE [ ]+
%%
@ -542,11 +543,11 @@ SEPARATOR [ \t;,]+
return TOKEN_WORD;
}
{INTEGERNUM} {
{INTEGERNUM}({WHITESPACE})? {
// A signed or unsigned integer number.
accept();
xyylval.u.number = atol(xyytext);
xyylval.str = yytext;
xyylval.str = trim_right(xyytext);
return TOKEN_INTEGER;
}
@ -603,6 +604,13 @@ SEPARATOR [ \t;,]+
return TOKEN_NAME;
}
[0-9-]+[A-Za-z_-][A-Za-z_0-9-]* {
// Identifier with leading digit.
accept();
xyylval.str = xyytext;
return TOKEN_NAME;
}
. {
// Any other character is invalid.

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +1,110 @@
#ifndef BISON_Y_TAB_H
# define BISON_Y_TAB_H
/* A Bison parser, made by GNU Bison 1.875b. */
# define TOKEN_NAME 1
# define TOKEN_STRING 2
# define TOKEN_INTEGER 3
# define TOKEN_GUID 5
# define TOKEN_INTEGER_LIST 6
# define TOKEN_REALNUM_LIST 7
# define TOKEN_OBRACE 10
# define TOKEN_CBRACE 11
# define TOKEN_OPAREN 12
# define TOKEN_CPAREN 13
# define TOKEN_OBRACKET 14
# define TOKEN_CBRACKET 15
# define TOKEN_OANGLE 16
# define TOKEN_CANGLE 17
# define TOKEN_DOT 18
# define TOKEN_COMMA 19
# define TOKEN_SEMICOLON 20
# define TOKEN_TEMPLATE 31
# define TOKEN_WORD 40
# define TOKEN_DWORD 41
# define TOKEN_FLOAT 42
# define TOKEN_DOUBLE 43
# define TOKEN_CHAR 44
# define TOKEN_UCHAR 45
# define TOKEN_SWORD 46
# define TOKEN_SDWORD 47
# define TOKEN_VOID 48
# define TOKEN_LPSTR 49
# define TOKEN_UNICODE 50
# define TOKEN_CSTRING 51
# define TOKEN_ARRAY 52
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
TOKEN_NAME = 1,
TOKEN_STRING = 2,
TOKEN_INTEGER = 3,
TOKEN_GUID = 5,
TOKEN_INTEGER_LIST = 6,
TOKEN_REALNUM_LIST = 7,
TOKEN_OBRACE = 10,
TOKEN_CBRACE = 11,
TOKEN_OPAREN = 12,
TOKEN_CPAREN = 13,
TOKEN_OBRACKET = 14,
TOKEN_CBRACKET = 15,
TOKEN_OANGLE = 16,
TOKEN_CANGLE = 17,
TOKEN_DOT = 18,
TOKEN_COMMA = 19,
TOKEN_SEMICOLON = 20,
TOKEN_TEMPLATE = 31,
TOKEN_WORD = 40,
TOKEN_DWORD = 41,
TOKEN_FLOAT = 42,
TOKEN_DOUBLE = 43,
TOKEN_CHAR = 44,
TOKEN_UCHAR = 45,
TOKEN_SWORD = 46,
TOKEN_SDWORD = 47,
TOKEN_VOID = 48,
TOKEN_LPSTR = 49,
TOKEN_UNICODE = 50,
TOKEN_CSTRING = 51,
TOKEN_ARRAY = 52
};
#endif
#define TOKEN_NAME 1
#define TOKEN_STRING 2
#define TOKEN_INTEGER 3
#define TOKEN_GUID 5
#define TOKEN_INTEGER_LIST 6
#define TOKEN_REALNUM_LIST 7
#define TOKEN_OBRACE 10
#define TOKEN_CBRACE 11
#define TOKEN_OPAREN 12
#define TOKEN_CPAREN 13
#define TOKEN_OBRACKET 14
#define TOKEN_CBRACKET 15
#define TOKEN_OANGLE 16
#define TOKEN_CANGLE 17
#define TOKEN_DOT 18
#define TOKEN_COMMA 19
#define TOKEN_SEMICOLON 20
#define TOKEN_TEMPLATE 31
#define TOKEN_WORD 40
#define TOKEN_DWORD 41
#define TOKEN_FLOAT 42
#define TOKEN_DOUBLE 43
#define TOKEN_CHAR 44
#define TOKEN_UCHAR 45
#define TOKEN_SWORD 46
#define TOKEN_SDWORD 47
#define TOKEN_VOID 48
#define TOKEN_LPSTR 49
#define TOKEN_UNICODE 50
#define TOKEN_CSTRING 51
#define TOKEN_ARRAY 52
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE xyylval;
#endif /* not BISON_Y_TAB_H */

View File

@ -94,8 +94,9 @@ x_cleanup_parser() {
%type <u.primitive_type> primitive_type
%type <int_list> integer_list
%type <double_list> realnum_list
%type <str> name
%type <str> optional_name
%type <str> singleword_name
%type <str> multiword_name
%type <str> optional_multiword_name
%type <str> string
%type <guid> class_id
%type <guid> optional_class_id
@ -111,7 +112,7 @@ xfile:
;
template:
TOKEN_TEMPLATE name TOKEN_OBRACE class_id
TOKEN_TEMPLATE singleword_name TOKEN_OBRACE class_id
{
$$ = current_node;
XFileTemplate *templ = new XFileTemplate(x_file, $2, $4);
@ -155,7 +156,7 @@ template_members:
;
primitive:
primitive_type optional_name TOKEN_SEMICOLON
primitive_type optional_multiword_name TOKEN_SEMICOLON
{
current_data_def = new XFileDataDef(x_file, $2, $1);
current_node->add_child(current_data_def);
@ -167,7 +168,7 @@ array:
;
template_reference:
name optional_name TOKEN_SEMICOLON
singleword_name optional_multiword_name TOKEN_SEMICOLON
{
XFileTemplate *xtemplate = x_file->find_template($1);
if (xtemplate == (XFileTemplate *)NULL) {
@ -227,12 +228,12 @@ primitive_type:
;
array_data_type:
primitive_type name
primitive_type multiword_name
{
current_data_def = new XFileDataDef(x_file, $2, $1);
current_node->add_child(current_data_def);
}
| name name
| singleword_name multiword_name
{
XFileTemplate *xtemplate = x_file->find_template($1);
if (xtemplate == (XFileTemplate *)NULL) {
@ -258,7 +259,7 @@ dimension_size:
{
current_data_def->add_array_def(XFileArrayDef($1));
}
| name
| multiword_name
{
XFileNode *data_def = current_node->find_child($1);
if (data_def == (XFileNode *)NULL) {
@ -279,7 +280,7 @@ template_option_list:
;
template_option_part:
name
singleword_name
{
XFileTemplate *xtemplate = x_file->find_template($1);
if (xtemplate == (XFileTemplate *)NULL) {
@ -288,7 +289,7 @@ template_option_part:
DCAST(XFileTemplate, current_node)->add_option(xtemplate);
}
}
| name class_id
| singleword_name class_id
{
XFileTemplate *xtemplate = x_file->find_template($2);
if (xtemplate == (XFileTemplate *)NULL) {
@ -303,16 +304,28 @@ template_option_part:
}
;
name:
singleword_name:
TOKEN_NAME
;
optional_name:
multiword_name:
TOKEN_NAME
| multiword_name TOKEN_NAME
{
$$ = $1 + " " + $2;
}
| multiword_name TOKEN_INTEGER
{
$$ = $1 + " " + $<str>2;
}
;
optional_multiword_name:
empty
{
$$ = string();
}
| name
| multiword_name
;
class_id:
@ -332,7 +345,7 @@ ellipsis:
;
object:
name optional_name TOKEN_OBRACE
singleword_name optional_multiword_name TOKEN_OBRACE
{
XFileTemplate *xtemplate = x_file->find_template($1);
$$ = current_node;
@ -413,7 +426,7 @@ list_separator:
;
data_reference:
name
multiword_name
{
XFileDataNodeTemplate *data_object = x_file->find_data_object($1);
if (data_object == (XFileDataObject *)NULL) {
@ -422,7 +435,7 @@ data_reference:
$$ = new XFileDataNodeReference(data_object);
}
| name class_id
| multiword_name class_id
{
XFileDataNodeTemplate *data_object = x_file->find_data_object($2);
if (data_object == (XFileDataObject *)NULL) {