/[bison]/bison/src/output.c
ViewVC logotype

Diff of /bison/src/output.c

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

revision 1.148 by ra, Wed Apr 24 16:22:56 2002 UTC revision 1.149 by akim, Thu May 2 15:06:46 2002 UTC
# Line 568  actions_output (FILE *out) Line 568  actions_output (FILE *out)
568  }  }
569    
570    
 /*----------------------------.  
 | Output the guards to OOUT.  |  
 `----------------------------*/  
   
 void  
 guards_output (FILE *out)  
 {  
   int rule;  
   for (rule = 1; rule < nrules + 1; ++rule)  
     if (rules[rule].guard)  
       {  
         fprintf (out, "  case %d:\n", rule);  
   
         if (!no_lines_flag)  
           fprintf (out, muscle_find ("linef"),  
                    rules[rule].guard_line,  
                    quotearg_style (c_quoting_style,  
                                    muscle_find ("filename")));  
         fprintf (out, "{ %s; }\n    break;\n\n",  
                  rules[rule].guard);  
       }  
 }  
   
   
571  /*---------------------------------------.  /*---------------------------------------.
572  | Output the tokens definition to OOUT.  |  | Output the tokens definition to OOUT.  |
573  `---------------------------------------*/  `---------------------------------------*/
# Line 629  token_definitions_output (FILE *out) Line 605  token_definitions_output (FILE *out)
605    
606        fprintf (out, "%s  [[[%s]], [%d]]",        fprintf (out, "%s  [[[%s]], [%d]]",
607                 first ? "" : ",\n", symbol->tag, number);                 first ? "" : ",\n", symbol->tag, number);
       if (semantic_parser)  
         /* FIXME: This is probably wrong, and should be just as  
            above. --akim.  */  
         fprintf (out, "# define T%s\t%d\n", symbol->tag, symbol->number);  
608        first = 0;        first = 0;
609      }      }
610  }  }
# Line 1020  output_skeleton (void) Line 992  output_skeleton (void)
992    actions_output (out);    actions_output (out);
993    fputs ("]])\n\n", out);    fputs ("]])\n\n", out);
994    
   fputs ("m4_define([b4_guards], \n[[", out);  
   guards_output (out);  
   fputs ("]])\n\n", out);  
   
995    fputs ("m4_define([b4_tokens], \n[", out);    fputs ("m4_define([b4_tokens], \n[", out);
996    token_definitions_output (out);    token_definitions_output (out);
997    fputs ("])\n\n", out);    fputs ("])\n\n", out);
# Line 1099  prepare (void) Line 1067  prepare (void)
1067    
1068    /* Find the right skeleton file.  */    /* Find the right skeleton file.  */
1069    if (!skeleton)    if (!skeleton)
1070      {      skeleton = "bison.simple";
       if (semantic_parser)  
         skeleton = "bison.hairy";  
       else  
         skeleton = "bison.simple";  
     }  
1071    
1072    /* Parse the skeleton file and output the needed parsers.  */    /* Parse the skeleton file and output the needed parsers.  */
1073    muscle_insert ("skeleton", skeleton);    muscle_insert ("skeleton", skeleton);

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.149

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