#include "getargs.h"
#include "files.h"
-#include "alloc.h"
+#include "xalloc.h"
#include "gram.h"
#include "complain.h"
extern char *mktemp (); /* So the compiler won't complain */
extern char *getenv ();
-int fixed_outfiles = 0;
-
extern char *program_name;
\f
while (*cp1++)
i++;
- ostring = NEW2 (i + end1 + 1, char);
+ ostring = XCALLOC (char, i + end1 + 1);
cp = ostring;
cp1 = string1;
short_base_length = strlen (spec_file_prefix);
/* Count room for `.tab'. */
base_length = short_base_length + 4;
- name_base = (char *) xmalloc (base_length + 1);
+ name_base = XMALLOC (char, base_length + 1);
/* Append `.tab'. */
strcpy (name_base, spec_file_prefix);
#ifdef VMS
static char FIXED_NAME_BASE[] = "y.y";
- name_base = fixed_outfiles ? FIXED_NAME_BASE : infile;
+ name_base = yacc_flag ? FIXED_NAME_BASE : infile;
/* BASE_LENGTH gets length of NAME_BASE, sans ".y" suffix if any. */
finput = xfopen (infile, "r");
- if (!noparserflag)
+ if (!no_parser_flag)
{
filename = getenv ("BISON_SIMPLE");
#ifdef MSDOS
cp = getenv ("INIT");
if (filename == 0 && cp != NULL)
{
- filename = xmalloc (strlen (cp) + strlen (PFILE) + 2);
+ filename = XMALLOC (char, strlen (cp) + strlen (PFILE) + 2);
strcpy (filename, cp);
cp = filename + strlen (filename);
*cp++ = '/';
fparser = xfopen (filename ? filename : PFILE, "r");
}
- if (verboseflag)
+ if (verbose_flag)
{
#ifdef MSDOS
outfile = stringappend (name_base, short_base_length, ".out");
foutput = xfopen (outfile, "w");
}
- if (noparserflag)
+ if (no_parser_flag)
{
/* use permanent name for actions file */
actfile = stringappend (name_base, short_base_length, ".act");
}
#ifdef MSDOS
- if (!noparserflag)
+ if (!no_parser_flag)
actfile = mktemp (stringappend (tmp_base, tmp_len, "acXXXXXX"));
tmpattrsfile = mktemp (stringappend (tmp_base, tmp_len, "atXXXXXX"));
tmptabfile = mktemp (stringappend (tmp_base, tmp_len, "taXXXXXX"));
tmpdefsfile = mktemp (stringappend (tmp_base, tmp_len, "deXXXXXX"));
#else
- if (!noparserflag)
+ if (!no_parser_flag)
actfile = mktemp (stringappend (tmp_base, tmp_len, "act.XXXXXX"));
tmpattrsfile = mktemp (stringappend (tmp_base, tmp_len, "attrs.XXXXXX"));
tmptabfile = mktemp (stringappend (tmp_base, tmp_len, "tab.XXXXXX"));
tmpdefsfile = mktemp (stringappend (tmp_base, tmp_len, "defs.XXXXXX"));
#endif /* not MSDOS */
- if (!noparserflag)
+ if (!no_parser_flag)
faction = xfopen (actfile, "w+");
fattrs = xfopen (tmpattrsfile, "w+");
ftable = xfopen (tmptabfile, "w+");
- if (definesflag)
+ if (defines_flag)
{
defsfile = stringappend (name_base, base_length, ".h");
fdefines = xfopen (tmpdefsfile, "w+");
}
#if !(defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__)))
- if (!noparserflag)
+ if (!no_parser_flag)
unlink (actfile);
unlink (tmpattrsfile);
unlink (tmptabfile);
xfclose (fparser);
- if (!noparserflag)
+ if (!no_parser_flag)
{
filename = (char *) getenv ("BISON_HAIRY");
#ifdef MSDOS
cp = getenv ("INIT");
if (filename == 0 && cp != NULL)
{
- filename = xmalloc (strlen (cp) + strlen (PFILE1) + 2);
+ filename = XMALLOC (char, strlen (cp) + strlen (PFILE1) + 2);
strcpy (filename, cp);
cp = filename + strlen (filename);
*cp++ = '/';
xfclose (ftmp);
xfclose (ftable);
- if (definesflag)
+ if (defines_flag)
{
ftmp = xfopen (defsfile, "w");
fflush (fdefines);
}
#if defined (VMS) & !defined (__VMS_POSIX)
- if (faction && !noparserflag)
+ if (faction && !no_parser_flag)
delete (actfile);
if (fattrs)
delete (tmpattrsfile);
sys$exit(SS$_ABORT); */
#else
#if (defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__)))
- if (actfile && !noparserflag)
+ if (actfile && !no_parser_flag)
unlink (actfile);
if (tmpattrsfile)
unlink (tmpattrsfile);