[BACK]Return to fgen.l CVS log [TXT][DIR] Up to [local] / src / usr.bin / fgen

Diff for /src/usr.bin/fgen/fgen.l between version 1.4 and 1.5

version 1.4, 2002/06/18 03:22:15 version 1.5, 2002/07/12 00:26:24
Line 991 
Line 991 
         initdic();          initdic();
         outbufsiz = BUFCLICK;          outbufsiz = BUFCLICK;
         outbuf = malloc(outbufsiz);          outbuf = malloc(outbufsiz);
           if (outbuf == NULL)
                   (void)err(1, "out of memory");
   
         fheader = (struct fcode_header *)outbuf;          fheader = (struct fcode_header *)outbuf;
         outpos = 0;          outpos = 0;
         emit(hdrtype);          emit(hdrtype);
Line 1152 
Line 1155 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         if (!fadd(dictionary, fcode))                          if (!fadd(dictionary, fcode))
                                 token_err(yylineno, infile, NULL,                                  token_err(yylineno, infile, NULL,
                                     "Duplicate definition: `%s'\n", fcode->name);                                      "Duplicate definition: `%s'\n", fcode->name);
Line 1214 
Line 1223 
                                               token->type);                                                token->type);
                         }                          }
                         alias = malloc(sizeof(*alias));                          alias = malloc(sizeof(*alias));
                           if (alias == NULL)
                                   (void)err(1, "out of memory");
   
                         alias->name = strdup(token->text);                          alias->name = strdup(token->text);
                           if (alias->name == NULL)
                                   (void)err(1, "out of memory");
   
                         token = yylex();                          token = yylex();
                         if (token == NULL) {                          if (token == NULL) {
                                 (void)printf( "EOF in alias definition\n");                                  (void)printf( "EOF in alias definition\n");
                                 return;                                  return;
                         }                          }
                         alias->equiv = strdup(token->text);                          alias->equiv = strdup(token->text);
                           if (alias->equiv == NULL)
                                   (void)err(1, "out of memory");
   
                         if (!aadd(aliases, alias)) {                          if (!aadd(aliases, alias)) {
                                 (void)printf( "ERROR: Duplicate alias %s\n",                                  (void)printf( "ERROR: Duplicate alias %s\n",
                                               alias->name);                                                alias->name);
Line 1272 
Line 1290 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1305 
Line 1329 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1346 
Line 1375 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1415 
Line 1450 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1551 
Line 1592 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1782 
Line 1829 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)
Line 1810 
Line 1863 
   
                         /* Add new code to dictionary */                          /* Add new code to dictionary */
                         fcode = malloc(sizeof(*fcode));                          fcode = malloc(sizeof(*fcode));
                           if (fcode == NULL)
                                   (void)err(1, "out of memory");
   
                         fcode->num = nextfcode++;                          fcode->num = nextfcode++;
                         fcode->name = strdup(token->text);                          fcode->name = strdup(token->text);
                           if (fcode->name == NULL)
                                   (void)err(1, "out of memory");
   
                         fadd(dictionary, fcode);                          fadd(dictionary, fcode);
   
                         if (state == 0)                          if (state == 0)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5