/[bison]/bison/src/scan-gram.c
ViewVC logotype

Diff of /bison/src/scan-gram.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by akim, Tue Jun 11 21:43:18 2002 UTC revision 1.3 by akim, Tue Jun 11 21:45:49 2002 UTC
# Line 689  int yy_flex_debug = 1; Line 689  int yy_flex_debug = 1;
689    
690  static yyconst short int yy_rule_linenum[92] =  static yyconst short int yy_rule_linenum[92] =
691      {   0,      {   0,
692        115,  116,  117,  118,  119,  120,  121,  122,  123,  124,        121,  122,  123,  124,  125,  126,  127,  128,  129,  130,
693        125,  126,  127,  128,  129,  130,  131,  132,  133,  134,        131,  132,  133,  134,  135,  136,  137,  138,  139,  140,
694        135,  136,  137,  138,  139,  140,  141,  143,  144,  145,        141,  142,  143,  144,  145,  146,  147,  149,  150,  151,
695        146,  148,  149,  150,  157,  160,  163,  166,  167,  170,        152,  154,  155,  156,  161,  164,  167,  170,  171,  174,
696        173,  176,  178,  184,  200,  201,  212,  224,  225,  226,        177,  180,  189,  195,  211,  212,  223,  235,  236,  237,
697        243,  251,  253,  272,  286,  288,  307,  319,  323,  324,        254,  263,  265,  285,  299,  301,  321,  333,  337,  338,
698        325,  326,  327,  328,  329,  330,  331,  346,  352,  353,        339,  340,  341,  342,  343,  344,  345,  360,  366,  367,
699        355,  373,  379,  380,  382,  400,  403,  406,  407,  418,        369,  387,  393,  394,  396,  414,  417,  420,  421,  432,
700        428,  430,  431,  433,  434,  437,  456,  462,  463,  464,        443,  445,  446,  448,  449,  452,  472,  479,  480,  481,
701        484        502
702    
703      } ;      } ;
704    
# Line 772  char *last_string; Line 772  char *last_string;
772    do {                                                  \    do {                                                  \
773      obstack_1grow (&string_obstack, '\0');              \      obstack_1grow (&string_obstack, '\0');              \
774      last_string = obstack_finish (&string_obstack);     \      last_string = obstack_finish (&string_obstack);     \
     yylval->string = last_string;                       \  
775    } while (0)    } while (0)
776    
777  #define YY_OBS_FREE                                             \  #define YY_OBS_FREE                                             \
# Line 780  char *last_string; Line 779  char *last_string;
779      obstack_free (&string_obstack, last_string);                \      obstack_free (&string_obstack, last_string);                \
780    } while (0)    } while (0)
781    
782    void
783    scanner_last_string_free (void)
784    {
785      YY_OBS_FREE;
786    }
787    
788    
789  /* This is only to avoid GCC warnings. */  /* This is only to avoid GCC warnings. */
790  #define YY_USER_INIT    if (yycontrol) {;};  #define YY_USER_INIT    if (yycontrol) {;};
791    
# Line 802  static void handle_at PARAMS ((char *cp) Line 808  static void handle_at PARAMS ((char *cp)
808  #define SC_PROLOGUE 7  #define SC_PROLOGUE 7
809  #define SC_EPILOGUE 8  #define SC_EPILOGUE 8
810    
811  #line 806 "scan-gram.c"  #line 812 "scan-gram.c"
812    
813  /* Macros after this point can all be overridden by user definitions in  /* Macros after this point can all be overridden by user definitions in
814   * section 1.   * section 1.
# Line 964  YY_DECL Line 970  YY_DECL
970          register char *yy_cp, *yy_bp;          register char *yy_cp, *yy_bp;
971          register int yy_act;          register int yy_act;
972    
973  #line 91 "scan-gram.l"  #line 97 "scan-gram.l"
974    
975    
976    /* At each yylex invocation, mark the current position as the    /* At each yylex invocation, mark the current position as the
# Line 987  YY_DECL Line 993  YY_DECL
993    /*----------------------------.    /*----------------------------.
994    | Scanning Bison directives.  |    | Scanning Bison directives.  |
995    `----------------------------*/    `----------------------------*/
996  #line 991 "scan-gram.c"  #line 997 "scan-gram.c"
997    
998          if ( yy_init )          if ( yy_init )
999                  {                  {
# Line 1089  do_action:     /* This label is used only to Line 1095  do_action:     /* This label is used only to
1095    
1096  case 1:  case 1:
1097  YY_RULE_SETUP  YY_RULE_SETUP
1098  #line 115 "scan-gram.l"  #line 121 "scan-gram.l"
1099  return PERCENT_NONASSOC;  return PERCENT_NONASSOC;
1100          YY_BREAK          YY_BREAK
1101  case 2:  case 2:
1102  YY_RULE_SETUP  YY_RULE_SETUP
1103  #line 116 "scan-gram.l"  #line 122 "scan-gram.l"
1104  return PERCENT_DEBUG;  return PERCENT_DEBUG;
1105          YY_BREAK          YY_BREAK
1106  case 3:  case 3:
1107  YY_RULE_SETUP  YY_RULE_SETUP
1108  #line 117 "scan-gram.l"  #line 123 "scan-gram.l"
1109  return PERCENT_DEFINE;  return PERCENT_DEFINE;
1110          YY_BREAK          YY_BREAK
1111  case 4:  case 4:
1112  YY_RULE_SETUP  YY_RULE_SETUP
1113  #line 118 "scan-gram.l"  #line 124 "scan-gram.l"
1114  return PERCENT_DEFINES;  return PERCENT_DEFINES;
1115          YY_BREAK          YY_BREAK
1116  case 5:  case 5:
1117  YY_RULE_SETUP  YY_RULE_SETUP
1118  #line 119 "scan-gram.l"  #line 125 "scan-gram.l"
1119  return PERCENT_ERROR_VERBOSE;  return PERCENT_ERROR_VERBOSE;
1120          YY_BREAK          YY_BREAK
1121  case 6:  case 6:
1122  YY_RULE_SETUP  YY_RULE_SETUP
1123  #line 120 "scan-gram.l"  #line 126 "scan-gram.l"
1124  return PERCENT_EXPECT;  return PERCENT_EXPECT;
1125          YY_BREAK          YY_BREAK
1126  case 7:  case 7:
1127  YY_RULE_SETUP  YY_RULE_SETUP
1128  #line 121 "scan-gram.l"  #line 127 "scan-gram.l"
1129  return PERCENT_FILE_PREFIX;  return PERCENT_FILE_PREFIX;
1130          YY_BREAK          YY_BREAK
1131  case 8:  case 8:
1132  YY_RULE_SETUP  YY_RULE_SETUP
1133  #line 122 "scan-gram.l"  #line 128 "scan-gram.l"
1134  return PERCENT_YACC;  return PERCENT_YACC;
1135          YY_BREAK          YY_BREAK
1136  case 9:  case 9:
1137  YY_RULE_SETUP  YY_RULE_SETUP
1138  #line 123 "scan-gram.l"  #line 129 "scan-gram.l"
1139  return PERCENT_LEFT;  return PERCENT_LEFT;
1140          YY_BREAK          YY_BREAK
1141  case 10:  case 10:
1142  YY_RULE_SETUP  YY_RULE_SETUP
1143  #line 124 "scan-gram.l"  #line 130 "scan-gram.l"
1144  return PERCENT_LOCATIONS;  return PERCENT_LOCATIONS;
1145          YY_BREAK          YY_BREAK
1146  case 11:  case 11:
1147  YY_RULE_SETUP  YY_RULE_SETUP
1148  #line 125 "scan-gram.l"  #line 131 "scan-gram.l"
1149  return PERCENT_NAME_PREFIX;  return PERCENT_NAME_PREFIX;
1150          YY_BREAK          YY_BREAK
1151  case 12:  case 12:
1152  YY_RULE_SETUP  YY_RULE_SETUP
1153  #line 126 "scan-gram.l"  #line 132 "scan-gram.l"
1154  return PERCENT_NO_LINES;  return PERCENT_NO_LINES;
1155          YY_BREAK          YY_BREAK
1156  case 13:  case 13:
1157  YY_RULE_SETUP  YY_RULE_SETUP
1158  #line 127 "scan-gram.l"  #line 133 "scan-gram.l"
1159  return PERCENT_NONASSOC;  return PERCENT_NONASSOC;
1160          YY_BREAK          YY_BREAK
1161  case 14:  case 14:
1162  YY_RULE_SETUP  YY_RULE_SETUP
1163  #line 128 "scan-gram.l"  #line 134 "scan-gram.l"
1164  return PERCENT_NTERM;  return PERCENT_NTERM;
1165          YY_BREAK          YY_BREAK
1166  case 15:  case 15:
1167  YY_RULE_SETUP  YY_RULE_SETUP
1168  #line 129 "scan-gram.l"  #line 135 "scan-gram.l"
1169  return PERCENT_OUTPUT;  return PERCENT_OUTPUT;
1170          YY_BREAK          YY_BREAK
1171  case 16:  case 16:
1172  YY_RULE_SETUP  YY_RULE_SETUP
1173  #line 130 "scan-gram.l"  #line 136 "scan-gram.l"
1174  return PERCENT_PREC;  return PERCENT_PREC;
1175          YY_BREAK          YY_BREAK
1176  case 17:  case 17:
1177  YY_RULE_SETUP  YY_RULE_SETUP
1178  #line 131 "scan-gram.l"  #line 137 "scan-gram.l"
1179  return PERCENT_PURE_PARSER;  return PERCENT_PURE_PARSER;
1180          YY_BREAK          YY_BREAK
1181  case 18:  case 18:
1182  YY_RULE_SETUP  YY_RULE_SETUP
1183  #line 132 "scan-gram.l"  #line 138 "scan-gram.l"
1184  return PERCENT_RIGHT;  return PERCENT_RIGHT;
1185          YY_BREAK          YY_BREAK
1186  case 19:  case 19:
1187  YY_RULE_SETUP  YY_RULE_SETUP
1188  #line 133 "scan-gram.l"  #line 139 "scan-gram.l"
1189  return PERCENT_SKELETON;  return PERCENT_SKELETON;
1190          YY_BREAK          YY_BREAK
1191  case 20:  case 20:
1192  YY_RULE_SETUP  YY_RULE_SETUP
1193  #line 134 "scan-gram.l"  #line 140 "scan-gram.l"
1194  return PERCENT_START;  return PERCENT_START;
1195          YY_BREAK          YY_BREAK
1196  case 21:  case 21:
1197  YY_RULE_SETUP  YY_RULE_SETUP
1198  #line 135 "scan-gram.l"  #line 141 "scan-gram.l"
1199  return PERCENT_TOKEN;  return PERCENT_TOKEN;
1200          YY_BREAK          YY_BREAK
1201  case 22:  case 22:
1202  YY_RULE_SETUP  YY_RULE_SETUP
1203  #line 136 "scan-gram.l"  #line 142 "scan-gram.l"
1204  return PERCENT_TOKEN;  return PERCENT_TOKEN;
1205          YY_BREAK          YY_BREAK
1206  case 23:  case 23:
1207  YY_RULE_SETUP  YY_RULE_SETUP
1208  #line 137 "scan-gram.l"  #line 143 "scan-gram.l"
1209  return PERCENT_TOKEN_TABLE;  return PERCENT_TOKEN_TABLE;
1210          YY_BREAK          YY_BREAK
1211  case 24:  case 24:
1212  YY_RULE_SETUP  YY_RULE_SETUP
1213  #line 138 "scan-gram.l"  #line 144 "scan-gram.l"
1214  return PERCENT_TYPE;  return PERCENT_TYPE;
1215          YY_BREAK          YY_BREAK
1216  case 25:  case 25:
1217  YY_RULE_SETUP  YY_RULE_SETUP
1218  #line 139 "scan-gram.l"  #line 145 "scan-gram.l"
1219  return PERCENT_UNION;  return PERCENT_UNION;
1220          YY_BREAK          YY_BREAK
1221  case 26:  case 26:
1222  YY_RULE_SETUP  YY_RULE_SETUP
1223  #line 140 "scan-gram.l"  #line 146 "scan-gram.l"
1224  return PERCENT_VERBOSE;  return PERCENT_VERBOSE;
1225          YY_BREAK          YY_BREAK
1226  case 27:  case 27:
1227  YY_RULE_SETUP  YY_RULE_SETUP
1228  #line 141 "scan-gram.l"  #line 147 "scan-gram.l"
1229  return PERCENT_YACC;  return PERCENT_YACC;
1230          YY_BREAK          YY_BREAK
1231  case 28:  case 28:
1232  YY_RULE_SETUP  YY_RULE_SETUP
1233  #line 143 "scan-gram.l"  #line 149 "scan-gram.l"
1234  return EQUAL;  return EQUAL;
1235          YY_BREAK          YY_BREAK
1236  case 29:  case 29:
1237  YY_RULE_SETUP  YY_RULE_SETUP
1238  #line 144 "scan-gram.l"  #line 150 "scan-gram.l"
1239  return COLON;  return COLON;
1240          YY_BREAK          YY_BREAK
1241  case 30:  case 30:
1242  YY_RULE_SETUP  YY_RULE_SETUP
1243  #line 145 "scan-gram.l"  #line 151 "scan-gram.l"
1244  return PIPE;  return PIPE;
1245          YY_BREAK          YY_BREAK
1246  case 31:  case 31:
1247  YY_RULE_SETUP  YY_RULE_SETUP
1248  #line 146 "scan-gram.l"  #line 152 "scan-gram.l"
1249  return SEMICOLON;  return SEMICOLON;
1250          YY_BREAK          YY_BREAK
1251  case 32:  case 32:
1252  YY_RULE_SETUP  YY_RULE_SETUP
1253  #line 148 "scan-gram.l"  #line 154 "scan-gram.l"
1254  YY_LINES; YY_STEP;  YY_LINES; YY_STEP;
1255          YY_BREAK          YY_BREAK
1256  case 33:  case 33:
1257  YY_RULE_SETUP  YY_RULE_SETUP
1258  #line 149 "scan-gram.l"  #line 155 "scan-gram.l"
1259  YY_STEP;  YY_STEP;
1260          YY_BREAK          YY_BREAK
1261  case 34:  case 34:
1262  YY_RULE_SETUP  YY_RULE_SETUP
1263  #line 150 "scan-gram.l"  #line 156 "scan-gram.l"
1264  {  {
1265      YY_OBS_INIT; YY_OBS_GROW; YY_OBS_FINISH;      yylval->symbol = getsym (yytext);
     yylval->symbol = getsym (last_string);  
     YY_OBS_FREE;  
1266      return ID;      return ID;
1267    }    }
1268          YY_BREAK          YY_BREAK
1269  case 35:  case 35:
1270  YY_RULE_SETUP  YY_RULE_SETUP
1271  #line 157 "scan-gram.l"  #line 161 "scan-gram.l"
1272  yylval->integer = strtol (yytext, 0, 10); return INT;  yylval->integer = strtol (yytext, 0, 10); return INT;
1273          YY_BREAK          YY_BREAK
1274  /* Characters.  We don't check there is only one.  */  /* Characters.  We don't check there is only one.  */
1275  case 36:  case 36:
1276  YY_RULE_SETUP  YY_RULE_SETUP
1277  #line 160 "scan-gram.l"  #line 164 "scan-gram.l"
1278  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
1279          YY_BREAK          YY_BREAK
1280  /* Strings. */  /* Strings. */
1281  case 37:  case 37:
1282  YY_RULE_SETUP  YY_RULE_SETUP
1283  #line 163 "scan-gram.l"  #line 167 "scan-gram.l"
1284  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
1285          YY_BREAK          YY_BREAK
1286  /* Comments. */  /* Comments. */
1287  case 38:  case 38:
1288  YY_RULE_SETUP  YY_RULE_SETUP
1289  #line 166 "scan-gram.l"  #line 170 "scan-gram.l"
1290  yy_push_state (SC_COMMENT);  yy_push_state (SC_COMMENT);
1291          YY_BREAK          YY_BREAK
1292  case 39:  case 39:
1293  YY_RULE_SETUP  YY_RULE_SETUP
1294  #line 167 "scan-gram.l"  #line 171 "scan-gram.l"
1295  YY_STEP;  YY_STEP;
1296          YY_BREAK          YY_BREAK
1297  /* Prologue. */  /* Prologue. */
1298  case 40:  case 40:
1299  YY_RULE_SETUP  YY_RULE_SETUP
1300  #line 170 "scan-gram.l"  #line 174 "scan-gram.l"
1301  YY_OBS_INIT; yy_push_state (SC_PROLOGUE);  YY_OBS_INIT; yy_push_state (SC_PROLOGUE);
1302          YY_BREAK          YY_BREAK
1303  /* Code in between braces.  */  /* Code in between braces.  */
1304  case 41:  case 41:
1305  YY_RULE_SETUP  YY_RULE_SETUP
1306  #line 173 "scan-gram.l"  #line 177 "scan-gram.l"
1307  YY_OBS_INIT; YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);  YY_OBS_INIT; YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);
1308          YY_BREAK          YY_BREAK
1309  /* A type. */  /* A type. */
1310  case 42:  case 42:
1311  YY_RULE_SETUP  YY_RULE_SETUP
1312  #line 176 "scan-gram.l"  #line 180 "scan-gram.l"
1313  YY_OBS_INIT; obstack_grow (&string_obstack, yytext + 1, yyleng - 2); YY_OBS_FINISH; return TYPE;  {
1314        YY_OBS_INIT;
1315        obstack_grow (&string_obstack, yytext + 1, yyleng - 2);
1316        YY_OBS_FINISH;
1317        yylval->string = last_string;
1318        return TYPE;
1319      }
1320          YY_BREAK          YY_BREAK
1321  case 43:  case 43:
1322  YY_RULE_SETUP  YY_RULE_SETUP
1323  #line 178 "scan-gram.l"  #line 189 "scan-gram.l"
1324  {  {
1325      if (++percent_percent_count == 2)      if (++percent_percent_count == 2)
1326        yy_push_state (SC_EPILOGUE);        yy_push_state (SC_EPILOGUE);
# Line 1319  YY_RULE_SETUP Line 1329  YY_RULE_SETUP
1329          YY_BREAK          YY_BREAK
1330  case 44:  case 44:
1331  YY_RULE_SETUP  YY_RULE_SETUP
1332  #line 184 "scan-gram.l"  #line 195 "scan-gram.l"
1333  {  {
1334      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1335      fprintf (stderr, ": invalid character: `%c'\n", *yytext);      fprintf (stderr, ": invalid character: `%c'\n", *yytext);
# Line 1336  YY_RULE_SETUP Line 1346  YY_RULE_SETUP
1346    
1347  case 45:  case 45:
1348  YY_RULE_SETUP  YY_RULE_SETUP
1349  #line 200 "scan-gram.l"  #line 211 "scan-gram.l"
1350  obstack_sgrow (&string_obstack, "@<:@");  obstack_sgrow (&string_obstack, "@<:@");
1351          YY_BREAK          YY_BREAK
1352  case 46:  case 46:
1353  YY_RULE_SETUP  YY_RULE_SETUP
1354  #line 201 "scan-gram.l"  #line 212 "scan-gram.l"
1355  obstack_sgrow (&string_obstack, "@:>@");  obstack_sgrow (&string_obstack, "@:>@");
1356          YY_BREAK          YY_BREAK
1357    
# Line 1352  obstack_sgrow (&string_obstack, "@:>@"); Line 1362  obstack_sgrow (&string_obstack, "@:>@");
1362    
1363  case 47:  case 47:
1364  YY_RULE_SETUP  YY_RULE_SETUP
1365  #line 212 "scan-gram.l"  #line 223 "scan-gram.l"
1366  { /* End of the comment. */  { /* End of the comment. */
1367      if (yy_top_state () == INITIAL)      if (yy_top_state () == INITIAL)
1368        {        {
# Line 1367  YY_RULE_SETUP Line 1377  YY_RULE_SETUP
1377          YY_BREAK          YY_BREAK
1378  case 48:  case 48:
1379  YY_RULE_SETUP  YY_RULE_SETUP
1380  #line 224 "scan-gram.l"  #line 235 "scan-gram.l"
1381  if (yy_top_state () != INITIAL) YY_OBS_GROW;  if (yy_top_state () != INITIAL) YY_OBS_GROW;
1382          YY_BREAK          YY_BREAK
1383  case 49:  case 49:
1384  YY_RULE_SETUP  YY_RULE_SETUP
1385  #line 225 "scan-gram.l"  #line 236 "scan-gram.l"
1386  if (yy_top_state () != INITIAL) YY_OBS_GROW; YY_LINES;  if (yy_top_state () != INITIAL) YY_OBS_GROW; YY_LINES;
1387          YY_BREAK          YY_BREAK
1388  case 50:  case 50:
1389  YY_RULE_SETUP  YY_RULE_SETUP
1390  #line 226 "scan-gram.l"  #line 237 "scan-gram.l"
1391  /* Stray `*'. */if (yy_top_state () != INITIAL) YY_OBS_GROW;  /* Stray `*'. */if (yy_top_state () != INITIAL) YY_OBS_GROW;
1392          YY_BREAK          YY_BREAK
1393  case YY_STATE_EOF(SC_COMMENT):  case YY_STATE_EOF(SC_COMMENT):
1394  #line 228 "scan-gram.l"  #line 239 "scan-gram.l"
1395  {  {
1396      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1397      fprintf (stderr, ": unexpected end of file in a comment\n");      fprintf (stderr, ": unexpected end of file in a comment\n");
# Line 1397  case YY_STATE_EOF(SC_COMMENT): Line 1407  case YY_STATE_EOF(SC_COMMENT):
1407    
1408  case 51:  case 51:
1409  YY_RULE_SETUP  YY_RULE_SETUP
1410  #line 243 "scan-gram.l"  #line 254 "scan-gram.l"
1411  {  {
1412      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1413      YY_OBS_GROW;      YY_OBS_GROW;
1414      YY_OBS_FINISH;      YY_OBS_FINISH;
1415        yylval->string = last_string;
1416      yy_pop_state ();      yy_pop_state ();
1417      return STRING;      return STRING;
1418    }    }
1419          YY_BREAK          YY_BREAK
1420  case 52:  case 52:
1421  YY_RULE_SETUP  YY_RULE_SETUP
1422  #line 251 "scan-gram.l"  #line 263 "scan-gram.l"
1423  YY_OBS_GROW;  YY_OBS_GROW;
1424          YY_BREAK          YY_BREAK
1425  case 53:  case 53:
1426  YY_RULE_SETUP  YY_RULE_SETUP
1427  #line 253 "scan-gram.l"  #line 265 "scan-gram.l"
1428  obstack_1grow (&string_obstack, '\n'); YY_LINES;  obstack_1grow (&string_obstack, '\n'); YY_LINES;
1429          YY_BREAK          YY_BREAK
1430  case YY_STATE_EOF(SC_ESCAPED_STRING):  case YY_STATE_EOF(SC_ESCAPED_STRING):
1431  #line 255 "scan-gram.l"  #line 267 "scan-gram.l"
1432  {  {
1433      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1434      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, ": unexpected end of file in a string\n");
1435      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1436      YY_OBS_FINISH;      YY_OBS_FINISH;
1437        yylval->string = last_string;
1438      yy_pop_state ();      yy_pop_state ();
1439      return STRING;      return STRING;
1440    }    }
# Line 1436  case YY_STATE_EOF(SC_ESCAPED_STRING): Line 1448  case YY_STATE_EOF(SC_ESCAPED_STRING):
1448    
1449  case 54:  case 54:
1450  YY_RULE_SETUP  YY_RULE_SETUP
1451  #line 272 "scan-gram.l"  #line 285 "scan-gram.l"
1452  {  {
1453      YY_OBS_GROW;      YY_OBS_GROW;
1454      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
# Line 1453  YY_RULE_SETUP Line 1465  YY_RULE_SETUP
1465          YY_BREAK          YY_BREAK
1466  case 55:  case 55:
1467  YY_RULE_SETUP  YY_RULE_SETUP
1468  #line 286 "scan-gram.l"  #line 299 "scan-gram.l"
1469  YY_OBS_GROW;  YY_OBS_GROW;
1470          YY_BREAK          YY_BREAK
1471  case 56:  case 56:
1472  YY_RULE_SETUP  YY_RULE_SETUP
1473  #line 288 "scan-gram.l"  #line 301 "scan-gram.l"
1474  obstack_1grow (&string_obstack, '\n'); YY_LINES;  obstack_1grow (&string_obstack, '\n'); YY_LINES;
1475          YY_BREAK          YY_BREAK
1476  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1477  #line 290 "scan-gram.l"  #line 303 "scan-gram.l"
1478  {  {
1479      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1480      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, ": unexpected end of file in a character\n");
1481      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1482      YY_OBS_FINISH;      YY_OBS_FINISH;
1483        yylval->string = last_string;
1484      yy_pop_state ();      yy_pop_state ();
1485      return CHARACTER;      return CHARACTER;
1486    }    }
# Line 1480  case YY_STATE_EOF(SC_ESCAPED_CHARACTER): Line 1493  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1493    
1494  case 57:  case 57:
1495  YY_RULE_SETUP  YY_RULE_SETUP
1496  #line 307 "scan-gram.l"  #line 321 "scan-gram.l"
1497  {  {
1498      long c = strtol (yytext + 1, 0, 8);      long c = strtol (yytext + 1, 0, 8);
1499      if (c > 255)      if (c > 255)
# Line 1495  YY_RULE_SETUP Line 1508  YY_RULE_SETUP
1508          YY_BREAK          YY_BREAK
1509  case 58:  case 58:
1510  YY_RULE_SETUP  YY_RULE_SETUP
1511  #line 319 "scan-gram.l"  #line 333 "scan-gram.l"
1512  {  {
1513      obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));      obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));
1514    }    }
1515          YY_BREAK          YY_BREAK
1516  case 59:  case 59:
1517  YY_RULE_SETUP  YY_RULE_SETUP
1518  #line 323 "scan-gram.l"  #line 337 "scan-gram.l"
1519  obstack_1grow (&string_obstack, '\a');  obstack_1grow (&string_obstack, '\a');
1520          YY_BREAK          YY_BREAK
1521  case 60:  case 60:
1522  YY_RULE_SETUP  YY_RULE_SETUP
1523  #line 324 "scan-gram.l"  #line 338 "scan-gram.l"
1524  obstack_1grow (&string_obstack, '\b');  obstack_1grow (&string_obstack, '\b');
1525          YY_BREAK          YY_BREAK
1526  case 61:  case 61:
1527  YY_RULE_SETUP  YY_RULE_SETUP
1528  #line 325 "scan-gram.l"  #line 339 "scan-gram.l"
1529  obstack_1grow (&string_obstack, '\f');  obstack_1grow (&string_obstack, '\f');
1530          YY_BREAK          YY_BREAK
1531  case 62:  case 62:
1532  YY_RULE_SETUP  YY_RULE_SETUP
1533  #line 326 "scan-gram.l"  #line 340 "scan-gram.l"
1534  obstack_1grow (&string_obstack, '\n');  obstack_1grow (&string_obstack, '\n');
1535          YY_BREAK          YY_BREAK
1536  case 63:  case 63:
1537  YY_RULE_SETUP  YY_RULE_SETUP
1538  #line 327 "scan-gram.l"  #line 341 "scan-gram.l"
1539  obstack_1grow (&string_obstack, '\r');  obstack_1grow (&string_obstack, '\r');
1540          YY_BREAK          YY_BREAK
1541  case 64:  case 64:
1542  YY_RULE_SETUP  YY_RULE_SETUP
1543  #line 328 "scan-gram.l"  #line 342 "scan-gram.l"
1544  obstack_1grow (&string_obstack, '\t');  obstack_1grow (&string_obstack, '\t');
1545          YY_BREAK          YY_BREAK
1546  case 65:  case 65:
1547  YY_RULE_SETUP  YY_RULE_SETUP
1548  #line 329 "scan-gram.l"  #line 343 "scan-gram.l"
1549  obstack_1grow (&string_obstack, '\v');  obstack_1grow (&string_obstack, '\v');
1550          YY_BREAK          YY_BREAK
1551  case 66:  case 66:
1552  YY_RULE_SETUP  YY_RULE_SETUP
1553  #line 330 "scan-gram.l"  #line 344 "scan-gram.l"
1554  obstack_1grow (&string_obstack, yytext[1]);  obstack_1grow (&string_obstack, yytext[1]);
1555          YY_BREAK          YY_BREAK
1556  case 67:  case 67:
1557  YY_RULE_SETUP  YY_RULE_SETUP
1558  #line 331 "scan-gram.l"  #line 345 "scan-gram.l"
1559  {  {
1560      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1561      fprintf (stderr, ": unrecognized escape: %s\n", yytext);      fprintf (stderr, ": unrecognized escape: %s\n", yytext);
# Line 1558  YY_RULE_SETUP Line 1571  YY_RULE_SETUP
1571    
1572  case 68:  case 68:
1573  YY_RULE_SETUP  YY_RULE_SETUP
1574  #line 346 "scan-gram.l"  #line 360 "scan-gram.l"
1575  {  {
1576      YY_OBS_GROW;      YY_OBS_GROW;
1577      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
# Line 1567  YY_RULE_SETUP Line 1580  YY_RULE_SETUP
1580          YY_BREAK          YY_BREAK
1581  case 69:  case 69:
1582  YY_RULE_SETUP  YY_RULE_SETUP
1583  #line 352 "scan-gram.l"  #line 366 "scan-gram.l"
1584  YY_OBS_GROW;  YY_OBS_GROW;
1585          YY_BREAK          YY_BREAK
1586  case 70:  case 70:
1587  YY_RULE_SETUP  YY_RULE_SETUP
1588  #line 353 "scan-gram.l"  #line 367 "scan-gram.l"
1589  YY_OBS_GROW;  YY_OBS_GROW;
1590          YY_BREAK          YY_BREAK
1591  case 71:  case 71:
1592  YY_RULE_SETUP  YY_RULE_SETUP
1593  #line 355 "scan-gram.l"  #line 369 "scan-gram.l"
1594  YY_OBS_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1595          YY_BREAK          YY_BREAK
1596  case YY_STATE_EOF(SC_CHARACTER):  case YY_STATE_EOF(SC_CHARACTER):
1597  #line 357 "scan-gram.l"  #line 371 "scan-gram.l"
1598  {  {
1599      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1600      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, ": unexpected end of file in a character\n");
# Line 1598  case YY_STATE_EOF(SC_CHARACTER): Line 1611  case YY_STATE_EOF(SC_CHARACTER):
1611    
1612  case 72:  case 72:
1613  YY_RULE_SETUP  YY_RULE_SETUP
1614  #line 373 "scan-gram.l"  #line 387 "scan-gram.l"
1615  {  {
1616      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
1617      YY_OBS_GROW;      YY_OBS_GROW;
# Line 1607  YY_RULE_SETUP Line 1620  YY_RULE_SETUP
1620          YY_BREAK          YY_BREAK
1621  case 73:  case 73:
1622  YY_RULE_SETUP  YY_RULE_SETUP
1623  #line 379 "scan-gram.l"  #line 393 "scan-gram.l"
1624  YY_OBS_GROW;  YY_OBS_GROW;
1625          YY_BREAK          YY_BREAK
1626  case 74:  case 74:
1627  YY_RULE_SETUP  YY_RULE_SETUP
1628  #line 380 "scan-gram.l"  #line 394 "scan-gram.l"
1629  YY_OBS_GROW;  YY_OBS_GROW;
1630          YY_BREAK          YY_BREAK
1631  case 75:  case 75:
1632  YY_RULE_SETUP  YY_RULE_SETUP
1633  #line 382 "scan-gram.l"  #line 396 "scan-gram.l"
1634  YY_OBS_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1635          YY_BREAK          YY_BREAK
1636  case YY_STATE_EOF(SC_STRING):  case YY_STATE_EOF(SC_STRING):
1637  #line 384 "scan-gram.l"  #line 398 "scan-gram.l"
1638  {  {
1639      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1640      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, ": unexpected end of file in a string\n");
# Line 1638  case YY_STATE_EOF(SC_STRING): Line 1651  case YY_STATE_EOF(SC_STRING):
1651  /* Characters.  We don't check there is only one.  */  /* Characters.  We don't check there is only one.  */
1652  case 76:  case 76:
1653  YY_RULE_SETUP  YY_RULE_SETUP
1654  #line 400 "scan-gram.l"  #line 414 "scan-gram.l"
1655  YY_OBS_GROW; yy_push_state (SC_CHARACTER);  YY_OBS_GROW; yy_push_state (SC_CHARACTER);
1656          YY_BREAK          YY_BREAK
1657  /* Strings. */  /* Strings. */
1658  case 77:  case 77:
1659  YY_RULE_SETUP  YY_RULE_SETUP
1660  #line 403 "scan-gram.l"  #line 417 "scan-gram.l"
1661  YY_OBS_GROW; yy_push_state (SC_STRING);  YY_OBS_GROW; yy_push_state (SC_STRING);
1662          YY_BREAK          YY_BREAK
1663  /* Comments. */  /* Comments. */
1664  case 78:  case 78:
1665  YY_RULE_SETUP  YY_RULE_SETUP
1666  #line 406 "scan-gram.l"  #line 420 "scan-gram.l"
1667  YY_OBS_GROW; yy_push_state (SC_COMMENT);  YY_OBS_GROW; yy_push_state (SC_COMMENT);
1668          YY_BREAK          YY_BREAK
1669  case 79:  case 79:
1670  YY_RULE_SETUP  YY_RULE_SETUP
1671  #line 407 "scan-gram.l"  #line 421 "scan-gram.l"
1672  YY_OBS_GROW;  YY_OBS_GROW;
1673          YY_BREAK          YY_BREAK
1674    
# Line 1667  YY_OBS_GROW; Line 1680  YY_OBS_GROW;
1680    
1681  case 80:  case 80:
1682  YY_RULE_SETUP  YY_RULE_SETUP
1683  #line 418 "scan-gram.l"  #line 432 "scan-gram.l"
1684  {  {
1685      YY_OBS_GROW;      YY_OBS_GROW;
1686      if (--braces_level == 0)      if (--braces_level == 0)
1687        {        {
1688          yy_pop_state ();          yy_pop_state ();
1689          YY_OBS_FINISH;          YY_OBS_FINISH;
1690            yylval->string = last_string;
1691          return BRACED_CODE;          return BRACED_CODE;
1692        }        }
1693    }    }
1694          YY_BREAK          YY_BREAK
1695  case 81:  case 81:
1696  YY_RULE_SETUP  YY_RULE_SETUP
1697  #line 428 "scan-gram.l"  #line 443 "scan-gram.l"
1698  YY_OBS_GROW; braces_level++;  YY_OBS_GROW; braces_level++;
1699          YY_BREAK          YY_BREAK
1700  case 82:  case 82:
1701  YY_RULE_SETUP  YY_RULE_SETUP
1702  #line 430 "scan-gram.l"  #line 445 "scan-gram.l"
1703  { handle_dollar (yytext); }  { handle_dollar (yytext); }
1704          YY_BREAK          YY_BREAK
1705  case 83:  case 83:
1706  YY_RULE_SETUP  YY_RULE_SETUP
1707  #line 431 "scan-gram.l"  #line 446 "scan-gram.l"
1708  { handle_at (yytext); }  { handle_at (yytext); }
1709          YY_BREAK          YY_BREAK
1710  case 84:  case 84:
1711  YY_RULE_SETUP  YY_RULE_SETUP
1712  #line 433 "scan-gram.l"  #line 448 "scan-gram.l"
1713  YY_OBS_GROW;  YY_OBS_GROW;
1714          YY_BREAK          YY_BREAK
1715  case 85:  case 85:
1716  YY_RULE_SETUP  YY_RULE_SETUP
1717  #line 434 "scan-gram.l"  #line 449 "scan-gram.l"
1718  YY_OBS_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1719          YY_BREAK          YY_BREAK
1720  /* A lose $, or /, or etc. */  /* A lose $, or /, or etc. */
1721  case 86:  case 86:
1722  YY_RULE_SETUP  YY_RULE_SETUP
1723  #line 437 "scan-gram.l"  #line 452 "scan-gram.l"
1724  YY_OBS_GROW;  YY_OBS_GROW;
1725          YY_BREAK          YY_BREAK
1726  case YY_STATE_EOF(SC_BRACED_CODE):  case YY_STATE_EOF(SC_BRACED_CODE):
1727  #line 439 "scan-gram.l"  #line 454 "scan-gram.l"
1728  {  {
1729      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1730      fprintf (stderr, ": unexpected end of file in a braced code\n");      fprintf (stderr, ": unexpected end of file in a braced code\n");
1731      yy_pop_state ();      yy_pop_state ();
1732      YY_OBS_FINISH;      YY_OBS_FINISH;
1733      return PROLOGUE;      yylval->string = last_string;
1734        return BRACED_CODE;
1735    }    }
1736          YY_BREAK          YY_BREAK
1737    
# Line 1727  case YY_STATE_EOF(SC_BRACED_CODE): Line 1742  case YY_STATE_EOF(SC_BRACED_CODE):
1742    
1743  case 87:  case 87:
1744  YY_RULE_SETUP  YY_RULE_SETUP
1745  #line 456 "scan-gram.l"  #line 472 "scan-gram.l"
1746  {  {
1747      yy_pop_state ();      yy_pop_state ();
1748      YY_OBS_FINISH;      YY_OBS_FINISH;
1749        yylval->string = last_string;
1750      return PROLOGUE;      return PROLOGUE;
1751    }    }
1752          YY_BREAK          YY_BREAK
1753  case 88:  case 88:
1754  YY_RULE_SETUP  YY_RULE_SETUP
1755  #line 462 "scan-gram.l"  #line 479 "scan-gram.l"
1756  YY_OBS_GROW;  YY_OBS_GROW;
1757          YY_BREAK          YY_BREAK
1758  case 89:  case 89:
1759  YY_RULE_SETUP  YY_RULE_SETUP
1760  #line 463 "scan-gram.l"  #line 480 "scan-gram.l"
1761  YY_OBS_GROW;  YY_OBS_GROW;
1762          YY_BREAK          YY_BREAK
1763  case 90:  case 90:
1764  YY_RULE_SETUP  YY_RULE_SETUP
1765  #line 464 "scan-gram.l"  #line 481 "scan-gram.l"
1766  YY_OBS_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1767          YY_BREAK          YY_BREAK
1768  case YY_STATE_EOF(SC_PROLOGUE):  case YY_STATE_EOF(SC_PROLOGUE):
1769  #line 466 "scan-gram.l"  #line 483 "scan-gram.l"
1770  {  {
1771      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1772      fprintf (stderr, ": unexpected end of file in a prologue\n");      fprintf (stderr, ": unexpected end of file in a prologue\n");
1773      yy_pop_state ();      yy_pop_state ();
1774      YY_OBS_FINISH;      YY_OBS_FINISH;
1775        yylval->string = last_string;
1776      return PROLOGUE;      return PROLOGUE;
1777    }    }
1778          YY_BREAK          YY_BREAK
# Line 1768  case YY_STATE_EOF(SC_PROLOGUE): Line 1785  case YY_STATE_EOF(SC_PROLOGUE):
1785    
1786  case 91:  case 91:
1787  YY_RULE_SETUP  YY_RULE_SETUP
1788  #line 484 "scan-gram.l"  #line 502 "scan-gram.l"
1789  YY_OBS_GROW;  YY_OBS_GROW;
1790          YY_BREAK          YY_BREAK
1791  case YY_STATE_EOF(SC_EPILOGUE):  case YY_STATE_EOF(SC_EPILOGUE):
1792  #line 486 "scan-gram.l"  #line 504 "scan-gram.l"
1793  {  {
1794      yy_pop_state ();      yy_pop_state ();
1795      YY_OBS_FINISH;      YY_OBS_FINISH;
1796        yylval->string = last_string;
1797      return EPILOGUE;      return EPILOGUE;
1798    }    }
1799          YY_BREAK          YY_BREAK
1800    
1801  case 92:  case 92:
1802  YY_RULE_SETUP  YY_RULE_SETUP
1803  #line 494 "scan-gram.l"  #line 513 "scan-gram.l"
1804  YY_FATAL_ERROR( "flex scanner jammed" );  YY_FATAL_ERROR( "flex scanner jammed" );
1805          YY_BREAK          YY_BREAK
1806  #line 1789 "scan-gram.c"  #line 1807 "scan-gram.c"
1807  case YY_STATE_EOF(INITIAL):  case YY_STATE_EOF(INITIAL):
1808          yyterminate();          yyterminate();
1809    
# Line 2675  int main() Line 2693  int main()
2693          return 0;          return 0;
2694          }          }
2695  #endif  #endif
2696  #line 494 "scan-gram.l"  #line 513 "scan-gram.l"
2697    
2698    
2699  /*------------------------------------------------------------------.  /*------------------------------------------------------------------.
# Line 2792  handle_at (char *cp) Line 2810  handle_at (char *cp)
2810        complain (_("%s is invalid"), quote (buf));        complain (_("%s is invalid"), quote (buf));
2811      }      }
2812  }  }
2813    
2814    void
2815    scanner_free (void)
2816    {
2817      obstack_free (&string_obstack, 0);
2818    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26