]>
git.saurik.com Git - bison.git/blob - src/vmsgetargs.c
   1 /* VMS version of getargs; Uses DCL command parsing. 
   2    Copyright (C) 1989, 1992 Free Software Foundation, Inc. 
   4 This file is part of Bison, the GNU Compiler Compiler. 
   6 Bison is free software; you can redistribute it and/or modify 
   7 it under the terms of the GNU General Public License as published by 
   8 the Free Software Foundation; either version 2, or (at your option) 
  11 Bison is distributed in the hope that it will be useful, 
  12 but WITHOUT ANY WARRANTY; without even the implied warranty of 
  13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  14 GNU General Public License for more details. 
  16 You should have received a copy of the GNU General Public License 
  17 along with Bison; see the file COPYING.  If not, write to 
  18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */ 
  26  *      VMS version of getargs: Uses DCL command parsing 
  27  *              (argc and argv are ignored) 
  33 extern int noparserflag
; 
  34 extern int toknumflag
; 
  35 extern int rawtoknumflag
; 
  36 extern int fixed_outfiles
; 
  37 extern char * version_string
; 
  39 /* Allocate storgate and initialize, since bison uses them elsewhere.  */ 
  40 char *spec_name_prefix
; 
  41 char *spec_file_prefix
; 
  48   static char Input_File
[256]; 
  49   static char output_spec
[256], name_prefix_spec
[256], file_prefix_spec
[256]; 
  61    *    Check for /VERBOSE qualifier 
  63   if (cli_present("BISON$VERBOSE")) verboseflag 
= 1; 
  65    *    Check for /DEFINES qualifier 
  67   if (cli_present("BISON$DEFINES")) definesflag 
= 1; 
  69    *    Check for /FIXED_OUTFILES qualifier 
  71   if (cli_present("BISON$FIXED_OUTFILES")) fixed_outfiles 
= 1; 
  72   if (cli_present("BISON$YACC")) fixed_outfiles 
= 1; 
  74    *    Check for /VERSION qualifier 
  76   if (cli_present("BISON$VERSION")) printf("%s",version_string
); 
  78    *    Check for /NOLINES qualifier 
  80   if (cli_present("BISON$NOLINES")) nolinesflag 
= 1; 
  82    *    Check for /NOPARSER qualifier 
  84   if (cli_present("BISON$NOPARSER")) noparserflag 
= 1; 
  86    *    Check for /RAW qualifier 
  88   if (cli_present("BISON$RAW")) rawtoknumflag 
= 1; 
  90    *    Check for /TOKEN_TABLE qualifier 
  92   if (cli_present("BISON$TOKEN_TABLE")) toknumflag 
= 1; 
  94    *    Check for /DEBUG qualifier 
  96   if (cli_present("BISON$DEBUG")) debugflag 
= 1; 
 100   cli_get_value("BISON$INFILE", Input_File
, sizeof(Input_File
)); 
 102    *    Lowercaseify the input filename 
 107       if (isupper(*cp
)) *cp 
= tolower(*cp
); 
 112    *    Get the output file 
 114   if (cli_present("BISON$OUTPUT")) 
 116       cli_get_value("BISON$OUTPUT", output_spec
, sizeof(output_spec
)); 
 117       for (cp 
= spec_outfile 
= output_spec
; *cp
; cp
++) 
 122    *    Get the output file 
 124   if (cli_present("BISON$FILE_PREFIX")) 
 126       cli_get_value("BISON$FILE_PREFIX", file_prefix_spec
,  
 127                      sizeof(file_prefix_spec
)); 
 128       for (cp 
= spec_file_prefix 
= file_prefix_spec
; *cp
; cp
++) 
 133    *    Get the output file 
 135   if (cli_present("BISON$NAME_PREFIX")) 
 137       cli_get_value("BISON$NAME_PREFIX", name_prefix_spec
,  
 138                      sizeof(name_prefix_spec
)); 
 139       for (cp 
= spec_name_prefix 
= name_prefix_spec
; *cp
; cp
++) 
 145 /************           DCL PARSING ROUTINES            **********/ 
 148  *      See if "NAME" is present 
 154   struct {int Size
; char *Ptr
;} Descr
; 
 157   Descr
.Size 
= strlen(Name
); 
 158   return((cli$
present(&Descr
) & 1) ? 1 : 0); 
 162  *      Get value of "NAME" 
 165 cli_get_value(Name
,Buffer
,Size
) 
 169   struct {int Size
; char *Ptr
;} Descr1
,Descr2
; 
 172   Descr1
.Size 
= strlen(Name
); 
 174   Descr2
.Size 
= Size
-1; 
 175   if (cli$
get_value(&Descr1
,&Descr2
,&Descr2
.Size
) & 1) { 
 176     Buffer
[Descr2
.Size
] = 0;