/[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.1 by akim, Tue Jun 11 20:16:05 2002 UTC revision 1.2 by akim, Tue Jun 11 21:43:18 2002 UTC
# Line 27  Line 27 
27  #define YY_FLEX_MINOR_VERSION 5  #define YY_FLEX_MINOR_VERSION 5
28    
29  #include <stdio.h>  #include <stdio.h>
30    #include <errno.h>
31    
32  /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */  /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
33  #ifdef c_plusplus  #ifdef c_plusplus
# Line 40  Line 40 
40  #ifdef __cplusplus  #ifdef __cplusplus
41    
42  #include <stdlib.h>  #include <stdlib.h>
43    #ifndef _WIN32
44  #include <unistd.h>  #include <unistd.h>
45    #endif
46    
47  /* Use prototypes in function declarations. */  /* Use prototypes in function declarations. */
48  #define YY_USE_PROTOS  #define YY_USE_PROTOS
# Line 687  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         88,   89,   90,   91,   92,   93,   94,   95,   96,   97,        115,  116,  117,  118,  119,  120,  121,  122,  123,  124,
693         98,   99,  100,  101,  102,  103,  104,  105,  106,  107,        125,  126,  127,  128,  129,  130,  131,  132,  133,  134,
694        108,  109,  110,  111,  112,  113,  114,  116,  117,  118,        135,  136,  137,  138,  139,  140,  141,  143,  144,  145,
695        119,  121,  122,  123,  129,  132,  135,  138,  139,  142,        146,  148,  149,  150,  157,  160,  163,  166,  167,  170,
696        145,  148,  150,  156,  172,  173,  184,  196,  197,  198,        173,  176,  178,  184,  200,  201,  212,  224,  225,  226,
697        215,  223,  225,  244,  259,  261,  280,  292,  296,  297,        243,  251,  253,  272,  286,  288,  307,  319,  323,  324,
698        298,  299,  300,  301,  302,  303,  304,  319,  325,  326,        325,  326,  327,  328,  329,  330,  331,  346,  352,  353,
699        328,  346,  352,  353,  355,  373,  376,  379,  380,  391,        355,  373,  379,  380,  382,  400,  403,  406,  407,  418,
700        401,  403,  404,  406,  407,  410,  429,  435,  436,  437,        428,  430,  431,  433,  434,  437,  456,  462,  463,  464,
701        457        484
702    
703      } ;      } ;
704    
# Line 746  char *yytext; Line 748  char *yytext;
748  #define YY_LINES        LOCATION_LINES (*yylloc, yyleng); lineno += yyleng;  #define YY_LINES        LOCATION_LINES (*yylloc, yyleng); lineno += yyleng;
749  #define YY_STEP         LOCATION_STEP (*yylloc)  #define YY_STEP         LOCATION_STEP (*yylloc)
750    
751  /* Appending to the STRING_OBSTACK. */  
752  #define YY_INIT         obstack_init (&string_obstack)  /* STRING_OBSTACK -- Used to store all the characters that we need to
753  #define YY_GROW         obstack_grow (&string_obstack, yytext, yyleng)     keep (to construct ID, STRINGS etc.).  Use the following macros to
754  #define YY_FINISH       obstack_1grow (&string_obstack, '\0'); yylval->string = obstack_finish (&string_obstack);     use it.
755    
756       Use YY_OBS_INIT to initialize a new growing string, YY_OBS_GROW to
757       append what has just been matched, and YY_OBS_FINISH to end the
758       string (it puts the ending 0).  YY_OBS_FINISH also stores this
759       string in LAST_STRING, which can be used, and which is used by
760       YY_OBS_FREE to free the last string.  */
761    
762    static struct obstack string_obstack;
763    char *last_string;
764    
765    #define YY_OBS_INIT   \
766      obstack_init (&string_obstack)
767    
768    #define YY_OBS_GROW   \
769      obstack_grow (&string_obstack, yytext, yyleng)
770    
771    #define YY_OBS_FINISH                                   \
772      do {                                                  \
773        obstack_1grow (&string_obstack, '\0');              \
774        last_string = obstack_finish (&string_obstack);     \
775        yylval->string = last_string;                       \
776      } while (0)
777    
778    #define YY_OBS_FREE                                             \
779      do {                                                          \
780        obstack_free (&string_obstack, last_string);                \
781      } while (0)
782    
783  /* This is only to avoid GCC warnings. */  /* This is only to avoid GCC warnings. */
784  #define YY_USER_INIT    if (yycontrol) {;};  #define YY_USER_INIT    if (yycontrol) {;};
785    
786  static struct obstack string_obstack;  
787  static int braces_level = 0;  static int braces_level = 0;
788  static int percent_percent_count = 0;  static int percent_percent_count = 0;
789    
# Line 773  static void handle_at PARAMS ((char *cp) Line 802  static void handle_at PARAMS ((char *cp)
802  #define SC_PROLOGUE 7  #define SC_PROLOGUE 7
803  #define SC_EPILOGUE 8  #define SC_EPILOGUE 8
804    
805  #line 777 "scan-gram.c"  #line 806 "scan-gram.c"
806    
807  /* Macros after this point can all be overridden by user definitions in  /* Macros after this point can all be overridden by user definitions in
808   * section 1.   * section 1.
# Line 873  YY_MALLOC_DECL Line 902  YY_MALLOC_DECL
902                          YY_FATAL_ERROR( "input in flex scanner failed" ); \                          YY_FATAL_ERROR( "input in flex scanner failed" ); \
903                  result = n; \                  result = n; \
904                  } \                  } \
905          else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \          else \
906                    && ferror( yyin ) ) \                  { \
907                  YY_FATAL_ERROR( "input in flex scanner failed" );                  errno=0; \
908                    while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
909                            { \
910                            if( errno != EINTR) \
911                                    { \
912                                    YY_FATAL_ERROR( "input in flex scanner failed" ); \
913                                    break; \
914                                    } \
915                            errno=0; \
916                            clearerr(yyin); \
917                            } \
918                    }
919  #endif  #endif
920    
921  /* No semi-colon after return; correct usage is to write "yyterminate();" -  /* No semi-colon after return; correct usage is to write "yyterminate();" -
# Line 924  YY_DECL Line 964  YY_DECL
964          register char *yy_cp, *yy_bp;          register char *yy_cp, *yy_bp;
965          register int yy_act;          register int yy_act;
966    
967  #line 64 "scan-gram.l"  #line 91 "scan-gram.l"
968    
969    
970    /* At each yylex invocation, mark the current position as the    /* At each yylex invocation, mark the current position as the
# Line 947  YY_DECL Line 987  YY_DECL
987    /*----------------------------.    /*----------------------------.
988    | Scanning Bison directives.  |    | Scanning Bison directives.  |
989    `----------------------------*/    `----------------------------*/
990  #line 951 "scan-gram.c"  #line 991 "scan-gram.c"
991    
992          if ( yy_init )          if ( yy_init )
993                  {                  {
# Line 1049  do_action:     /* This label is used only to Line 1089  do_action:     /* This label is used only to
1089    
1090  case 1:  case 1:
1091  YY_RULE_SETUP  YY_RULE_SETUP
1092  #line 88 "scan-gram.l"  #line 115 "scan-gram.l"
1093  return PERCENT_NONASSOC;  return PERCENT_NONASSOC;
1094          YY_BREAK          YY_BREAK
1095  case 2:  case 2:
1096  YY_RULE_SETUP  YY_RULE_SETUP
1097  #line 89 "scan-gram.l"  #line 116 "scan-gram.l"
1098  return PERCENT_DEBUG;  return PERCENT_DEBUG;
1099          YY_BREAK          YY_BREAK
1100  case 3:  case 3:
1101  YY_RULE_SETUP  YY_RULE_SETUP
1102  #line 90 "scan-gram.l"  #line 117 "scan-gram.l"
1103  return PERCENT_DEFINE;  return PERCENT_DEFINE;
1104          YY_BREAK          YY_BREAK
1105  case 4:  case 4:
1106  YY_RULE_SETUP  YY_RULE_SETUP
1107  #line 91 "scan-gram.l"  #line 118 "scan-gram.l"
1108  return PERCENT_DEFINES;  return PERCENT_DEFINES;
1109          YY_BREAK          YY_BREAK
1110  case 5:  case 5:
1111  YY_RULE_SETUP  YY_RULE_SETUP
1112  #line 92 "scan-gram.l"  #line 119 "scan-gram.l"
1113  return PERCENT_ERROR_VERBOSE;  return PERCENT_ERROR_VERBOSE;
1114          YY_BREAK          YY_BREAK
1115  case 6:  case 6:
1116  YY_RULE_SETUP  YY_RULE_SETUP
1117  #line 93 "scan-gram.l"  #line 120 "scan-gram.l"
1118  return PERCENT_EXPECT;  return PERCENT_EXPECT;
1119          YY_BREAK          YY_BREAK
1120  case 7:  case 7:
1121  YY_RULE_SETUP  YY_RULE_SETUP
1122  #line 94 "scan-gram.l"  #line 121 "scan-gram.l"
1123  return PERCENT_FILE_PREFIX;  return PERCENT_FILE_PREFIX;
1124          YY_BREAK          YY_BREAK
1125  case 8:  case 8:
1126  YY_RULE_SETUP  YY_RULE_SETUP
1127  #line 95 "scan-gram.l"  #line 122 "scan-gram.l"
1128  return PERCENT_YACC;  return PERCENT_YACC;
1129          YY_BREAK          YY_BREAK
1130  case 9:  case 9:
1131  YY_RULE_SETUP  YY_RULE_SETUP
1132  #line 96 "scan-gram.l"  #line 123 "scan-gram.l"
1133  return PERCENT_LEFT;  return PERCENT_LEFT;
1134          YY_BREAK          YY_BREAK
1135  case 10:  case 10:
1136  YY_RULE_SETUP  YY_RULE_SETUP
1137  #line 97 "scan-gram.l"  #line 124 "scan-gram.l"
1138  return PERCENT_LOCATIONS;  return PERCENT_LOCATIONS;
1139          YY_BREAK          YY_BREAK
1140  case 11:  case 11:
1141  YY_RULE_SETUP  YY_RULE_SETUP
1142  #line 98 "scan-gram.l"  #line 125 "scan-gram.l"
1143  return PERCENT_NAME_PREFIX;  return PERCENT_NAME_PREFIX;
1144          YY_BREAK          YY_BREAK
1145  case 12:  case 12:
1146  YY_RULE_SETUP  YY_RULE_SETUP
1147  #line 99 "scan-gram.l"  #line 126 "scan-gram.l"
1148  return PERCENT_NO_LINES;  return PERCENT_NO_LINES;
1149          YY_BREAK          YY_BREAK
1150  case 13:  case 13:
1151  YY_RULE_SETUP  YY_RULE_SETUP
1152  #line 100 "scan-gram.l"  #line 127 "scan-gram.l"
1153  return PERCENT_NONASSOC;  return PERCENT_NONASSOC;
1154          YY_BREAK          YY_BREAK
1155  case 14:  case 14:
1156  YY_RULE_SETUP  YY_RULE_SETUP
1157  #line 101 "scan-gram.l"  #line 128 "scan-gram.l"
1158  return PERCENT_NTERM;  return PERCENT_NTERM;
1159          YY_BREAK          YY_BREAK
1160  case 15:  case 15:
1161  YY_RULE_SETUP  YY_RULE_SETUP
1162  #line 102 "scan-gram.l"  #line 129 "scan-gram.l"
1163  return PERCENT_OUTPUT;  return PERCENT_OUTPUT;
1164          YY_BREAK          YY_BREAK
1165  case 16:  case 16:
1166  YY_RULE_SETUP  YY_RULE_SETUP
1167  #line 103 "scan-gram.l"  #line 130 "scan-gram.l"
1168  return PERCENT_PREC;  return PERCENT_PREC;
1169          YY_BREAK          YY_BREAK
1170  case 17:  case 17:
1171  YY_RULE_SETUP  YY_RULE_SETUP
1172  #line 104 "scan-gram.l"  #line 131 "scan-gram.l"
1173  return PERCENT_PURE_PARSER;  return PERCENT_PURE_PARSER;
1174          YY_BREAK          YY_BREAK
1175  case 18:  case 18:
1176  YY_RULE_SETUP  YY_RULE_SETUP
1177  #line 105 "scan-gram.l"  #line 132 "scan-gram.l"
1178  return PERCENT_RIGHT;  return PERCENT_RIGHT;
1179          YY_BREAK          YY_BREAK
1180  case 19:  case 19:
1181  YY_RULE_SETUP  YY_RULE_SETUP
1182  #line 106 "scan-gram.l"  #line 133 "scan-gram.l"
1183  return PERCENT_SKELETON;  return PERCENT_SKELETON;
1184          YY_BREAK          YY_BREAK
1185  case 20:  case 20:
1186  YY_RULE_SETUP  YY_RULE_SETUP
1187  #line 107 "scan-gram.l"  #line 134 "scan-gram.l"
1188  return PERCENT_START;  return PERCENT_START;
1189          YY_BREAK          YY_BREAK
1190  case 21:  case 21:
1191  YY_RULE_SETUP  YY_RULE_SETUP
1192  #line 108 "scan-gram.l"  #line 135 "scan-gram.l"
1193  return PERCENT_TOKEN;  return PERCENT_TOKEN;
1194          YY_BREAK          YY_BREAK
1195  case 22:  case 22:
1196  YY_RULE_SETUP  YY_RULE_SETUP
1197  #line 109 "scan-gram.l"  #line 136 "scan-gram.l"
1198  return PERCENT_TOKEN;  return PERCENT_TOKEN;
1199          YY_BREAK          YY_BREAK
1200  case 23:  case 23:
1201  YY_RULE_SETUP  YY_RULE_SETUP
1202  #line 110 "scan-gram.l"  #line 137 "scan-gram.l"
1203  return PERCENT_TOKEN_TABLE;  return PERCENT_TOKEN_TABLE;
1204          YY_BREAK          YY_BREAK
1205  case 24:  case 24:
1206  YY_RULE_SETUP  YY_RULE_SETUP
1207  #line 111 "scan-gram.l"  #line 138 "scan-gram.l"
1208  return PERCENT_TYPE;  return PERCENT_TYPE;
1209          YY_BREAK          YY_BREAK
1210  case 25:  case 25:
1211  YY_RULE_SETUP  YY_RULE_SETUP
1212  #line 112 "scan-gram.l"  #line 139 "scan-gram.l"
1213  return PERCENT_UNION;  return PERCENT_UNION;
1214          YY_BREAK          YY_BREAK
1215  case 26:  case 26:
1216  YY_RULE_SETUP  YY_RULE_SETUP
1217  #line 113 "scan-gram.l"  #line 140 "scan-gram.l"
1218  return PERCENT_VERBOSE;  return PERCENT_VERBOSE;
1219          YY_BREAK          YY_BREAK
1220  case 27:  case 27:
1221  YY_RULE_SETUP  YY_RULE_SETUP
1222  #line 114 "scan-gram.l"  #line 141 "scan-gram.l"
1223  return PERCENT_YACC;  return PERCENT_YACC;
1224          YY_BREAK          YY_BREAK
1225  case 28:  case 28:
1226  YY_RULE_SETUP  YY_RULE_SETUP
1227  #line 116 "scan-gram.l"  #line 143 "scan-gram.l"
1228  return EQUAL;  return EQUAL;
1229          YY_BREAK          YY_BREAK
1230  case 29:  case 29:
1231  YY_RULE_SETUP  YY_RULE_SETUP
1232  #line 117 "scan-gram.l"  #line 144 "scan-gram.l"
1233  return COLON;  return COLON;
1234          YY_BREAK          YY_BREAK
1235  case 30:  case 30:
1236  YY_RULE_SETUP  YY_RULE_SETUP
1237  #line 118 "scan-gram.l"  #line 145 "scan-gram.l"
1238  return PIPE;  return PIPE;
1239          YY_BREAK          YY_BREAK
1240  case 31:  case 31:
1241  YY_RULE_SETUP  YY_RULE_SETUP
1242  #line 119 "scan-gram.l"  #line 146 "scan-gram.l"
1243  return SEMICOLON;  return SEMICOLON;
1244          YY_BREAK          YY_BREAK
1245  case 32:  case 32:
1246  YY_RULE_SETUP  YY_RULE_SETUP
1247  #line 121 "scan-gram.l"  #line 148 "scan-gram.l"
1248  YY_LINES; YY_STEP;  YY_LINES; YY_STEP;
1249          YY_BREAK          YY_BREAK
1250  case 33:  case 33:
1251  YY_RULE_SETUP  YY_RULE_SETUP
1252  #line 122 "scan-gram.l"  #line 149 "scan-gram.l"
1253  YY_STEP;  YY_STEP;
1254          YY_BREAK          YY_BREAK
1255  case 34:  case 34:
1256  YY_RULE_SETUP  YY_RULE_SETUP
1257  #line 123 "scan-gram.l"  #line 150 "scan-gram.l"
1258  {  {
1259      YY_INIT; YY_GROW; YY_FINISH;      YY_OBS_INIT; YY_OBS_GROW; YY_OBS_FINISH;
1260      yylval->symbol = getsym (yylval->string);      yylval->symbol = getsym (last_string);
1261        YY_OBS_FREE;
1262      return ID;      return ID;
1263    }    }
1264          YY_BREAK          YY_BREAK
1265  case 35:  case 35:
1266  YY_RULE_SETUP  YY_RULE_SETUP
1267  #line 129 "scan-gram.l"  #line 157 "scan-gram.l"
1268  yylval->integer = strtol (yytext, 0, 10); return INT;  yylval->integer = strtol (yytext, 0, 10); return INT;
1269          YY_BREAK          YY_BREAK
1270  /* Characters.  We don't check there is only one.  */  /* Characters.  We don't check there is only one.  */
1271  case 36:  case 36:
1272  YY_RULE_SETUP  YY_RULE_SETUP
1273  #line 132 "scan-gram.l"  #line 160 "scan-gram.l"
1274  YY_INIT; YY_GROW; yy_push_state (SC_ESCAPED_CHARACTER);  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
1275          YY_BREAK          YY_BREAK
1276  /* Strings. */  /* Strings. */
1277  case 37:  case 37:
1278  YY_RULE_SETUP  YY_RULE_SETUP
1279  #line 135 "scan-gram.l"  #line 163 "scan-gram.l"
1280  YY_INIT; YY_GROW; yy_push_state (SC_ESCAPED_STRING);  YY_OBS_INIT; YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
1281          YY_BREAK          YY_BREAK
1282  /* Comments. */  /* Comments. */
1283  case 38:  case 38:
1284  YY_RULE_SETUP  YY_RULE_SETUP
1285  #line 138 "scan-gram.l"  #line 166 "scan-gram.l"
1286  yy_push_state (SC_COMMENT);  yy_push_state (SC_COMMENT);
1287          YY_BREAK          YY_BREAK
1288  case 39:  case 39:
1289  YY_RULE_SETUP  YY_RULE_SETUP
1290  #line 139 "scan-gram.l"  #line 167 "scan-gram.l"
1291  YY_STEP;  YY_STEP;
1292          YY_BREAK          YY_BREAK
1293  /* Prologue. */  /* Prologue. */
1294  case 40:  case 40:
1295  YY_RULE_SETUP  YY_RULE_SETUP
1296  #line 142 "scan-gram.l"  #line 170 "scan-gram.l"
1297  YY_INIT; yy_push_state (SC_PROLOGUE);  YY_OBS_INIT; yy_push_state (SC_PROLOGUE);
1298          YY_BREAK          YY_BREAK
1299  /* Code in between braces.  */  /* Code in between braces.  */
1300  case 41:  case 41:
1301  YY_RULE_SETUP  YY_RULE_SETUP
1302  #line 145 "scan-gram.l"  #line 173 "scan-gram.l"
1303  YY_INIT; YY_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);  YY_OBS_INIT; YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);
1304          YY_BREAK          YY_BREAK
1305  /* A type. */  /* A type. */
1306  case 42:  case 42:
1307  YY_RULE_SETUP  YY_RULE_SETUP
1308  #line 148 "scan-gram.l"  #line 176 "scan-gram.l"
1309  YY_INIT; obstack_grow (&string_obstack, yytext + 1, yyleng - 2); YY_FINISH; return TYPE;  YY_OBS_INIT; obstack_grow (&string_obstack, yytext + 1, yyleng - 2); YY_OBS_FINISH; return TYPE;
1310          YY_BREAK          YY_BREAK
1311  case 43:  case 43:
1312  YY_RULE_SETUP  YY_RULE_SETUP
1313  #line 150 "scan-gram.l"  #line 178 "scan-gram.l"
1314  {  {
1315      if (++percent_percent_count == 2)      if (++percent_percent_count == 2)
1316        yy_push_state (SC_EPILOGUE);        yy_push_state (SC_EPILOGUE);
# Line 1278  YY_RULE_SETUP Line 1319  YY_RULE_SETUP
1319          YY_BREAK          YY_BREAK
1320  case 44:  case 44:
1321  YY_RULE_SETUP  YY_RULE_SETUP
1322  #line 156 "scan-gram.l"  #line 184 "scan-gram.l"
1323  {  {
1324      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1325      fprintf (stderr, ": invalid character: `%c'\n", *yytext);      fprintf (stderr, ": invalid character: `%c'\n", *yytext);
# Line 1295  YY_RULE_SETUP Line 1336  YY_RULE_SETUP
1336    
1337  case 45:  case 45:
1338  YY_RULE_SETUP  YY_RULE_SETUP
1339  #line 172 "scan-gram.l"  #line 200 "scan-gram.l"
1340  obstack_sgrow (&string_obstack, "@<:@");  obstack_sgrow (&string_obstack, "@<:@");
1341          YY_BREAK          YY_BREAK
1342  case 46:  case 46:
1343  YY_RULE_SETUP  YY_RULE_SETUP
1344  #line 173 "scan-gram.l"  #line 201 "scan-gram.l"
1345  obstack_sgrow (&string_obstack, "@:>@");  obstack_sgrow (&string_obstack, "@:>@");
1346          YY_BREAK          YY_BREAK
1347    
# Line 1311  obstack_sgrow (&string_obstack, "@:>@"); Line 1352  obstack_sgrow (&string_obstack, "@:>@");
1352    
1353  case 47:  case 47:
1354  YY_RULE_SETUP  YY_RULE_SETUP
1355  #line 184 "scan-gram.l"  #line 212 "scan-gram.l"
1356  { /* End of the comment. */  { /* End of the comment. */
1357      if (yy_top_state () == INITIAL)      if (yy_top_state () == INITIAL)
1358        {        {
# Line 1319  YY_RULE_SETUP Line 1360  YY_RULE_SETUP
1360        }        }
1361      else      else
1362        {        {
1363          YY_GROW;          YY_OBS_GROW;
1364        }        }
1365      yy_pop_state ();      yy_pop_state ();
1366    }    }
1367          YY_BREAK          YY_BREAK
1368  case 48:  case 48:
1369  YY_RULE_SETUP  YY_RULE_SETUP
1370  #line 196 "scan-gram.l"  #line 224 "scan-gram.l"
1371  if (yy_top_state () != INITIAL) YY_GROW;  if (yy_top_state () != INITIAL) YY_OBS_GROW;
1372          YY_BREAK          YY_BREAK
1373  case 49:  case 49:
1374  YY_RULE_SETUP  YY_RULE_SETUP
1375  #line 197 "scan-gram.l"  #line 225 "scan-gram.l"
1376  if (yy_top_state () != INITIAL) YY_GROW; YY_LINES;  if (yy_top_state () != INITIAL) YY_OBS_GROW; YY_LINES;
1377          YY_BREAK          YY_BREAK
1378  case 50:  case 50:
1379  YY_RULE_SETUP  YY_RULE_SETUP
1380  #line 198 "scan-gram.l"  #line 226 "scan-gram.l"
1381  /* Stray `*'. */if (yy_top_state () != INITIAL) YY_GROW;  /* Stray `*'. */if (yy_top_state () != INITIAL) YY_OBS_GROW;
1382          YY_BREAK          YY_BREAK
1383  case YY_STATE_EOF(SC_COMMENT):  case YY_STATE_EOF(SC_COMMENT):
1384  #line 200 "scan-gram.l"  #line 228 "scan-gram.l"
1385  {  {
1386      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1387      fprintf (stderr, ": unexpected end of file in a comment\n");      fprintf (stderr, ": unexpected end of file in a comment\n");
# Line 1356  case YY_STATE_EOF(SC_COMMENT): Line 1397  case YY_STATE_EOF(SC_COMMENT):
1397    
1398  case 51:  case 51:
1399  YY_RULE_SETUP  YY_RULE_SETUP
1400  #line 215 "scan-gram.l"  #line 243 "scan-gram.l"
1401  {  {
1402      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1403      YY_GROW;      YY_OBS_GROW;
1404      YY_FINISH;      YY_OBS_FINISH;
1405      yy_pop_state ();      yy_pop_state ();
1406      return STRING;      return STRING;
1407    }    }
1408          YY_BREAK          YY_BREAK
1409  case 52:  case 52:
1410  YY_RULE_SETUP  YY_RULE_SETUP
1411  #line 223 "scan-gram.l"  #line 251 "scan-gram.l"
1412  YY_GROW;  YY_OBS_GROW;
1413          YY_BREAK          YY_BREAK
1414  case 53:  case 53:
1415  YY_RULE_SETUP  YY_RULE_SETUP
1416  #line 225 "scan-gram.l"  #line 253 "scan-gram.l"
1417  obstack_1grow (&string_obstack, '\n'); YY_LINES;  obstack_1grow (&string_obstack, '\n'); YY_LINES;
1418          YY_BREAK          YY_BREAK
1419  case YY_STATE_EOF(SC_ESCAPED_STRING):  case YY_STATE_EOF(SC_ESCAPED_STRING):
1420  #line 227 "scan-gram.l"  #line 255 "scan-gram.l"
1421  {  {
1422      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1423      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, ": unexpected end of file in a string\n");
1424      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1425      YY_FINISH;      YY_OBS_FINISH;
1426      yy_pop_state ();      yy_pop_state ();
1427      return STRING;      return STRING;
1428    }    }
# Line 1395  case YY_STATE_EOF(SC_ESCAPED_STRING): Line 1436  case YY_STATE_EOF(SC_ESCAPED_STRING):
1436    
1437  case 54:  case 54:
1438  YY_RULE_SETUP  YY_RULE_SETUP
1439  #line 244 "scan-gram.l"  #line 272 "scan-gram.l"
1440  {  {
1441      YY_GROW;      YY_OBS_GROW;
1442      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1443      {      {
1444        char c;        YY_OBS_FINISH;
1445        YY_FINISH;        yylval->symbol = getsym (last_string);
       c = yylval->string[1];  
       yylval->symbol = getsym (yylval->string);  
1446        symbol_class_set (yylval->symbol, token_sym);        symbol_class_set (yylval->symbol, token_sym);
1447        symbol_user_token_number_set (yylval->symbol, (unsigned int) c);        symbol_user_token_number_set (yylval->symbol, last_string[1]);
1448          YY_OBS_FREE;
1449        yy_pop_state ();        yy_pop_state ();
1450        return ID;        return ID;
1451      }      }
# Line 1413  YY_RULE_SETUP Line 1453  YY_RULE_SETUP
1453          YY_BREAK          YY_BREAK
1454  case 55:  case 55:
1455  YY_RULE_SETUP  YY_RULE_SETUP
1456  #line 259 "scan-gram.l"  #line 286 "scan-gram.l"
1457  YY_GROW;  YY_OBS_GROW;
1458          YY_BREAK          YY_BREAK
1459  case 56:  case 56:
1460  YY_RULE_SETUP  YY_RULE_SETUP
1461  #line 261 "scan-gram.l"  #line 288 "scan-gram.l"
1462  obstack_1grow (&string_obstack, '\n'); YY_LINES;  obstack_1grow (&string_obstack, '\n'); YY_LINES;
1463          YY_BREAK          YY_BREAK
1464  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1465  #line 263 "scan-gram.l"  #line 290 "scan-gram.l"
1466  {  {
1467      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1468      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, ": unexpected end of file in a character\n");
1469      assert (yy_top_state () == INITIAL);      assert (yy_top_state () == INITIAL);
1470      YY_FINISH;      YY_OBS_FINISH;
1471      yy_pop_state ();      yy_pop_state ();
1472      return CHARACTER;      return CHARACTER;
1473    }    }
# Line 1440  case YY_STATE_EOF(SC_ESCAPED_CHARACTER): Line 1480  case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1480    
1481  case 57:  case 57:
1482  YY_RULE_SETUP  YY_RULE_SETUP
1483  #line 280 "scan-gram.l"  #line 307 "scan-gram.l"
1484  {  {
1485      long c = strtol (yytext + 1, 0, 8);      long c = strtol (yytext + 1, 0, 8);
1486      if (c > 255)      if (c > 255)
# Line 1455  YY_RULE_SETUP Line 1495  YY_RULE_SETUP
1495          YY_BREAK          YY_BREAK
1496  case 58:  case 58:
1497  YY_RULE_SETUP  YY_RULE_SETUP
1498  #line 292 "scan-gram.l"  #line 319 "scan-gram.l"
1499  {  {
1500      obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));      obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));
1501    }    }
1502          YY_BREAK          YY_BREAK
1503  case 59:  case 59:
1504  YY_RULE_SETUP  YY_RULE_SETUP
1505  #line 296 "scan-gram.l"  #line 323 "scan-gram.l"
1506  obstack_1grow (&string_obstack, '\a');  obstack_1grow (&string_obstack, '\a');
1507          YY_BREAK          YY_BREAK
1508  case 60:  case 60:
1509  YY_RULE_SETUP  YY_RULE_SETUP
1510  #line 297 "scan-gram.l"  #line 324 "scan-gram.l"
1511  obstack_1grow (&string_obstack, '\b');  obstack_1grow (&string_obstack, '\b');
1512          YY_BREAK          YY_BREAK
1513  case 61:  case 61:
1514  YY_RULE_SETUP  YY_RULE_SETUP
1515  #line 298 "scan-gram.l"  #line 325 "scan-gram.l"
1516  obstack_1grow (&string_obstack, '\f');  obstack_1grow (&string_obstack, '\f');
1517          YY_BREAK          YY_BREAK
1518  case 62:  case 62:
1519  YY_RULE_SETUP  YY_RULE_SETUP
1520  #line 299 "scan-gram.l"  #line 326 "scan-gram.l"
1521  obstack_1grow (&string_obstack, '\n');  obstack_1grow (&string_obstack, '\n');
1522          YY_BREAK          YY_BREAK
1523  case 63:  case 63:
1524  YY_RULE_SETUP  YY_RULE_SETUP
1525  #line 300 "scan-gram.l"  #line 327 "scan-gram.l"
1526  obstack_1grow (&string_obstack, '\r');  obstack_1grow (&string_obstack, '\r');
1527          YY_BREAK          YY_BREAK
1528  case 64:  case 64:
1529  YY_RULE_SETUP  YY_RULE_SETUP
1530  #line 301 "scan-gram.l"  #line 328 "scan-gram.l"
1531  obstack_1grow (&string_obstack, '\t');  obstack_1grow (&string_obstack, '\t');
1532          YY_BREAK          YY_BREAK
1533  case 65:  case 65:
1534  YY_RULE_SETUP  YY_RULE_SETUP
1535  #line 302 "scan-gram.l"  #line 329 "scan-gram.l"
1536  obstack_1grow (&string_obstack, '\v');  obstack_1grow (&string_obstack, '\v');
1537          YY_BREAK          YY_BREAK
1538  case 66:  case 66:
1539  YY_RULE_SETUP  YY_RULE_SETUP
1540  #line 303 "scan-gram.l"  #line 330 "scan-gram.l"
1541  obstack_1grow (&string_obstack, yytext[1]);  obstack_1grow (&string_obstack, yytext[1]);
1542          YY_BREAK          YY_BREAK
1543  case 67:  case 67:
1544  YY_RULE_SETUP  YY_RULE_SETUP
1545  #line 304 "scan-gram.l"  #line 331 "scan-gram.l"
1546  {  {
1547      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1548      fprintf (stderr, ": unrecognized escape: %s\n", yytext);      fprintf (stderr, ": unrecognized escape: %s\n", yytext);
1549      YY_GROW;      YY_OBS_GROW;
1550    }    }
1551          YY_BREAK          YY_BREAK
1552    
# Line 1518  YY_RULE_SETUP Line 1558  YY_RULE_SETUP
1558    
1559  case 68:  case 68:
1560  YY_RULE_SETUP  YY_RULE_SETUP
1561  #line 319 "scan-gram.l"  #line 346 "scan-gram.l"
1562  {  {
1563      YY_GROW;      YY_OBS_GROW;
1564      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
1565      yy_pop_state ();      yy_pop_state ();
1566    }    }
1567          YY_BREAK          YY_BREAK
1568  case 69:  case 69:
1569  YY_RULE_SETUP  YY_RULE_SETUP
1570  #line 325 "scan-gram.l"  #line 352 "scan-gram.l"
1571  YY_GROW;  YY_OBS_GROW;
1572          YY_BREAK          YY_BREAK
1573  case 70:  case 70:
1574  YY_RULE_SETUP  YY_RULE_SETUP
1575  #line 326 "scan-gram.l"  #line 353 "scan-gram.l"
1576  YY_GROW;  YY_OBS_GROW;
1577          YY_BREAK          YY_BREAK
1578  case 71:  case 71:
1579  YY_RULE_SETUP  YY_RULE_SETUP
1580  #line 328 "scan-gram.l"  #line 355 "scan-gram.l"
1581  YY_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1582          YY_BREAK          YY_BREAK
1583  case YY_STATE_EOF(SC_CHARACTER):  case YY_STATE_EOF(SC_CHARACTER):
1584  #line 330 "scan-gram.l"  #line 357 "scan-gram.l"
1585  {  {
1586      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1587      fprintf (stderr, ": unexpected end of file in a character\n");      fprintf (stderr, ": unexpected end of file in a character\n");
# Line 1558  case YY_STATE_EOF(SC_CHARACTER): Line 1598  case YY_STATE_EOF(SC_CHARACTER):
1598    
1599  case 72:  case 72:
1600  YY_RULE_SETUP  YY_RULE_SETUP
1601  #line 346 "scan-gram.l"  #line 373 "scan-gram.l"
1602  {  {
1603      assert (yy_top_state () != INITIAL);      assert (yy_top_state () != INITIAL);
1604      YY_GROW;      YY_OBS_GROW;
1605      yy_pop_state ();      yy_pop_state ();
1606    }    }
1607          YY_BREAK          YY_BREAK
1608  case 73:  case 73:
1609  YY_RULE_SETUP  YY_RULE_SETUP
1610  #line 352 "scan-gram.l"  #line 379 "scan-gram.l"
1611  YY_GROW;  YY_OBS_GROW;
1612          YY_BREAK          YY_BREAK
1613  case 74:  case 74:
1614  YY_RULE_SETUP  YY_RULE_SETUP
1615  #line 353 "scan-gram.l"  #line 380 "scan-gram.l"
1616  YY_GROW;  YY_OBS_GROW;
1617          YY_BREAK          YY_BREAK
1618  case 75:  case 75:
1619  YY_RULE_SETUP  YY_RULE_SETUP
1620  #line 355 "scan-gram.l"  #line 382 "scan-gram.l"
1621  YY_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1622          YY_BREAK          YY_BREAK
1623  case YY_STATE_EOF(SC_STRING):  case YY_STATE_EOF(SC_STRING):
1624  #line 357 "scan-gram.l"  #line 384 "scan-gram.l"
1625  {  {
1626      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1627      fprintf (stderr, ": unexpected end of file in a string\n");      fprintf (stderr, ": unexpected end of file in a string\n");
# Line 1598  case YY_STATE_EOF(SC_STRING): Line 1638  case YY_STATE_EOF(SC_STRING):
1638  /* Characters.  We don't check there is only one.  */  /* Characters.  We don't check there is only one.  */
1639  case 76:  case 76:
1640  YY_RULE_SETUP  YY_RULE_SETUP
1641  #line 373 "scan-gram.l"  #line 400 "scan-gram.l"
1642  YY_GROW; yy_push_state (SC_CHARACTER);  YY_OBS_GROW; yy_push_state (SC_CHARACTER);
1643          YY_BREAK          YY_BREAK
1644  /* Strings. */  /* Strings. */
1645  case 77:  case 77:
1646  YY_RULE_SETUP  YY_RULE_SETUP
1647  #line 376 "scan-gram.l"  #line 403 "scan-gram.l"
1648  YY_GROW; yy_push_state (SC_STRING);  YY_OBS_GROW; yy_push_state (SC_STRING);
1649          YY_BREAK          YY_BREAK
1650  /* Comments. */  /* Comments. */
1651  case 78:  case 78:
1652  YY_RULE_SETUP  YY_RULE_SETUP
1653  #line 379 "scan-gram.l"  #line 406 "scan-gram.l"
1654  YY_GROW; yy_push_state (SC_COMMENT);  YY_OBS_GROW; yy_push_state (SC_COMMENT);
1655          YY_BREAK          YY_BREAK
1656  case 79:  case 79:
1657  YY_RULE_SETUP  YY_RULE_SETUP
1658  #line 380 "scan-gram.l"  #line 407 "scan-gram.l"
1659  YY_GROW;  YY_OBS_GROW;
1660          YY_BREAK          YY_BREAK
1661    
1662  /*---------------------------------------------------------------.  /*---------------------------------------------------------------.
# Line 1627  YY_GROW; Line 1667  YY_GROW;
1667    
1668  case 80:  case 80:
1669  YY_RULE_SETUP  YY_RULE_SETUP
1670  #line 391 "scan-gram.l"  #line 418 "scan-gram.l"
1671  {  {
1672      YY_GROW;      YY_OBS_GROW;
1673      if (--braces_level == 0)      if (--braces_level == 0)
1674        {        {
1675          yy_pop_state ();          yy_pop_state ();
1676          YY_FINISH;          YY_OBS_FINISH;
1677          return BRACED_CODE;          return BRACED_CODE;
1678        }        }
1679    }    }
1680          YY_BREAK          YY_BREAK
1681  case 81:  case 81:
1682  YY_RULE_SETUP  YY_RULE_SETUP
1683  #line 401 "scan-gram.l"  #line 428 "scan-gram.l"
1684  YY_GROW; braces_level++;  YY_OBS_GROW; braces_level++;
1685          YY_BREAK          YY_BREAK
1686  case 82:  case 82:
1687  YY_RULE_SETUP  YY_RULE_SETUP
1688  #line 403 "scan-gram.l"  #line 430 "scan-gram.l"
1689  { handle_dollar (yytext); }  { handle_dollar (yytext); }
1690          YY_BREAK          YY_BREAK
1691  case 83:  case 83:
1692  YY_RULE_SETUP  YY_RULE_SETUP
1693  #line 404 "scan-gram.l"  #line 431 "scan-gram.l"
1694  { handle_at (yytext); }  { handle_at (yytext); }
1695          YY_BREAK          YY_BREAK
1696  case 84:  case 84:
1697  YY_RULE_SETUP  YY_RULE_SETUP
1698  #line 406 "scan-gram.l"  #line 433 "scan-gram.l"
1699  YY_GROW;  YY_OBS_GROW;
1700          YY_BREAK          YY_BREAK
1701  case 85:  case 85:
1702  YY_RULE_SETUP  YY_RULE_SETUP
1703  #line 407 "scan-gram.l"  #line 434 "scan-gram.l"
1704  YY_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1705          YY_BREAK          YY_BREAK
1706  /* A lose $, or /, or etc. */  /* A lose $, or /, or etc. */
1707  case 86:  case 86:
1708  YY_RULE_SETUP  YY_RULE_SETUP
1709  #line 410 "scan-gram.l"  #line 437 "scan-gram.l"
1710  YY_GROW;  YY_OBS_GROW;
1711          YY_BREAK          YY_BREAK
1712  case YY_STATE_EOF(SC_BRACED_CODE):  case YY_STATE_EOF(SC_BRACED_CODE):
1713  #line 412 "scan-gram.l"  #line 439 "scan-gram.l"
1714  {  {
1715      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1716      fprintf (stderr, ": unexpected end of file in a braced code\n");      fprintf (stderr, ": unexpected end of file in a braced code\n");
1717      yy_pop_state ();      yy_pop_state ();
1718      YY_FINISH;      YY_OBS_FINISH;
1719      return PROLOGUE;      return PROLOGUE;
1720    }    }
1721          YY_BREAK          YY_BREAK
# Line 1687  case YY_STATE_EOF(SC_BRACED_CODE): Line 1727  case YY_STATE_EOF(SC_BRACED_CODE):
1727    
1728  case 87:  case 87:
1729  YY_RULE_SETUP  YY_RULE_SETUP
1730  #line 429 "scan-gram.l"  #line 456 "scan-gram.l"
1731  {  {
1732      yy_pop_state ();      yy_pop_state ();
1733      YY_FINISH;      YY_OBS_FINISH;
1734      return PROLOGUE;      return PROLOGUE;
1735    }    }
1736          YY_BREAK          YY_BREAK
1737  case 88:  case 88:
1738  YY_RULE_SETUP  YY_RULE_SETUP
1739  #line 435 "scan-gram.l"  #line 462 "scan-gram.l"
1740  YY_GROW;  YY_OBS_GROW;
1741          YY_BREAK          YY_BREAK
1742  case 89:  case 89:
1743  YY_RULE_SETUP  YY_RULE_SETUP
1744  #line 436 "scan-gram.l"  #line 463 "scan-gram.l"
1745  YY_GROW;  YY_OBS_GROW;
1746          YY_BREAK          YY_BREAK
1747  case 90:  case 90:
1748  YY_RULE_SETUP  YY_RULE_SETUP
1749  #line 437 "scan-gram.l"  #line 464 "scan-gram.l"
1750  YY_GROW; YY_LINES;  YY_OBS_GROW; YY_LINES;
1751          YY_BREAK          YY_BREAK
1752  case YY_STATE_EOF(SC_PROLOGUE):  case YY_STATE_EOF(SC_PROLOGUE):
1753  #line 439 "scan-gram.l"  #line 466 "scan-gram.l"
1754  {  {
1755      LOCATION_PRINT (stderr, *yylloc);      LOCATION_PRINT (stderr, *yylloc);
1756      fprintf (stderr, ": unexpected end of file in a prologue\n");      fprintf (stderr, ": unexpected end of file in a prologue\n");
1757      yy_pop_state ();      yy_pop_state ();
1758      YY_FINISH;      YY_OBS_FINISH;
1759      return PROLOGUE;      return PROLOGUE;
1760    }    }
1761          YY_BREAK          YY_BREAK
# Line 1728  case YY_STATE_EOF(SC_PROLOGUE): Line 1768  case YY_STATE_EOF(SC_PROLOGUE):
1768    
1769  case 91:  case 91:
1770  YY_RULE_SETUP  YY_RULE_SETUP
1771  #line 457 "scan-gram.l"  #line 484 "scan-gram.l"
1772  YY_GROW;  YY_OBS_GROW;
1773          YY_BREAK          YY_BREAK
1774  case YY_STATE_EOF(SC_EPILOGUE):  case YY_STATE_EOF(SC_EPILOGUE):
1775  #line 459 "scan-gram.l"  #line 486 "scan-gram.l"
1776  {  {
1777      yy_pop_state ();      yy_pop_state ();
1778      YY_FINISH;      YY_OBS_FINISH;
1779      return EPILOGUE;      return EPILOGUE;
1780    }    }
1781          YY_BREAK          YY_BREAK
1782    
1783  case 92:  case 92:
1784  YY_RULE_SETUP  YY_RULE_SETUP
1785  #line 467 "scan-gram.l"  #line 494 "scan-gram.l"
1786  YY_FATAL_ERROR( "flex scanner jammed" );  YY_FATAL_ERROR( "flex scanner jammed" );
1787          YY_BREAK          YY_BREAK
1788  #line 1749 "scan-gram.c"  #line 1789 "scan-gram.c"
1789  case YY_STATE_EOF(INITIAL):  case YY_STATE_EOF(INITIAL):
1790          yyterminate();          yyterminate();
1791    
# Line 2309  YY_BUFFER_STATE b; Line 2349  YY_BUFFER_STATE b;
2349          }          }
2350    
2351    
2352    #ifndef _WIN32
2353    #include <unistd.h>
2354    #else
2355  #ifndef YY_ALWAYS_INTERACTIVE  #ifndef YY_ALWAYS_INTERACTIVE
2356  #ifndef YY_NEVER_INTERACTIVE  #ifndef YY_NEVER_INTERACTIVE
2357  extern int isatty YY_PROTO(( int ));  extern int isatty YY_PROTO(( int ));
2358  #endif  #endif
2359  #endif  #endif
2360    #endif
2361    
2362  #ifdef YY_USE_PROTOS  #ifdef YY_USE_PROTOS
2363  void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )  void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
# Line 2631  int main() Line 2675  int main()
2675          return 0;          return 0;
2676          }          }
2677  #endif  #endif
2678  #line 467 "scan-gram.l"  #line 494 "scan-gram.l"
2679    
2680    
2681  /*------------------------------------------------------------------.  /*------------------------------------------------------------------.

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

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