aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.h
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1994-02-25 03:26:25 +0000
committerDavid MacKenzie <djm@cygnus>1994-02-25 03:26:25 +0000
commitd4e5e3c330d5b2e7b6b972e03b1997a88270f703 (patch)
treedd57ae76fac89f06f3f85a050e9537847844d909 /ld/ldlex.h
parentb4f6f3c114e3cd2118ebb6c7e33ac65002d3255f (diff)
downloadbinutils-d4e5e3c330d5b2e7b6b972e03b1997a88270f703.zip
binutils-d4e5e3c330d5b2e7b6b972e03b1997a88270f703.tar.gz
binutils-d4e5e3c330d5b2e7b6b972e03b1997a88270f703.tar.bz2
Use getopt instead of lex and yacc to parse the command line.
* ld.texinfo (Options): Document changes to option syntax. * Makefile.in: Update dependencies. * ldver.c (help): Tweak dashes in usage message. * ldgram.y (%union): Remove unused members. Remove %tokens for command line options; add ones for input types. (command_line): Rules removed. (file): Instead of command line, recognize an input type indicator, then use the nonterminal for that type. (defsym_expr): New nonterminal from code formerly in command_line. * ldlex.h: Declare parser input type enum and variable. Don't declare parse_line. * ldlex.l: Remove unused variables. Make some used ones static and comment them. (COMMAND): Start state and its rules removed. At start of yylex, return input state token if at start of input. (lex_redirect): Don't need to set yyout. (ldlex_command): Function removed. * ldmain.c (main): Instead of calling parse_line, set up the redirections and call yyparse directly. * ldmisc.c (vfinfo): If there's no input filename, print nothing, not "command line". * lexsup.c: Remove #if 0'd code. (parse_line): Function removed. (parse_args): Rewrite to use getopt_long_only. (set_default_dirlist): New function from code formerly in ldgram.y:command_line. (set_section_start): New function. * emultempl/generic.em, emultempl/gld960.em, emultempl/hppaelf.em, emultempl/lnk960.em, emultempl/m88kbcs.em: Don't enclose compiled-in link scripts in "{" and "}", as the grammar no longer wants them to be.
Diffstat (limited to 'ld/ldlex.h')
-rw-r--r--ld/ldlex.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/ld/ldlex.h b/ld/ldlex.h
index ed79934..34ab4a1 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -22,6 +22,16 @@
#include <stdio.h>
+/* The initial parser states. */
+typedef enum input_enum {
+ input_selected, /* We've set the initial state. */
+ input_script = INPUT_SCRIPT,
+ input_mri_script = INPUT_MRI_SCRIPT,
+ input_defsym = INPUT_DEFSYM
+} input_type;
+
+extern input_type parser_input;
+
extern int hex_mode;
extern unsigned int lineno;
@@ -40,8 +50,9 @@ extern void ldlex_popstate PARAMS ((void));
/* In lexsup.c. */
extern int lex_input PARAMS ((void));
extern void lex_unput PARAMS ((int));
+#ifndef yywrap
extern int yywrap PARAMS ((void));
+#endif
extern void parse_args PARAMS ((int, char **));
-extern void parse_line PARAMS ((char*, int));
#endif