1999-05-03 07:29:11 +00:00
|
|
|
/* ldlex.h -
|
PR ld/13343
* ld.h (parsing_defsym): Delete.
* ldexp.c (exp_intop, exp_bigintop, exp_relop): Set type.filename.
(fold_binary, fold_name, exp_fold_tree_1, exp_get_vma, exp_get_fill,
exp_get_abs_int): Add tree arg for %S in error messages. Don't
fudge lineno.
(exp_binop, exp_unop, exp_nameop, exp_assop, exp_assert): Copy
type.filename from sub-tree.
(exp_trinop): Likewise, and use "cond" rather than "lhs".
* ldexp.h (node_type): Add filename field to struct.
* ldfile.c (ldfile_input_filename): Delete. Remove all refs.
* ldfile.h (ldfile_input_filename): Delete.
* ldgram.y (phdr_type, phdr_qualifiers, yyerror): Add NULL arg for
%S in error messages.
* ldemul.c (syslib_default, hll_default): Likewise.
* ldlang.c (lang_memory_region_lookup, lang_memory_region_alias,
lang_get_regions, lang_new_phdr): Likewise.
(lang_size_sections_1): Pass addr_tree for %S.
* ldlex.h (lex_redirect): Update prototype.
(ldlex_filename): Declare.
* ldlex.l (<EOF>): Don't set ldfile_input_filename.
(lex_redirect): Add fake_filename and count params. Push
fake_filename to file_name_stack and init lineno from count.
(ldlex_filename): New function.
(lex_warn_invalid): Use above.
* ldmain.c (main): Update lex_redirect call.
* ldmisc.c (vfinfo <%S>): Take file name and line number from
etree_type arg, or use current if arg is NULL.
* lexsup.c (parsing_defsym): Delete.
(parse_args <OPTION_DEFSYM>): Update lex_redirect call.
2012-02-17 14:09:57 +00:00
|
|
|
Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000, 2003, 2005, 2006,
|
|
|
|
2007, 2012 Free Software Foundation, Inc.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2007-07-06 14:09:45 +00:00
|
|
|
This file is part of the GNU Binutils.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2007-07-06 14:09:45 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
1999-05-03 07:29:11 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-06 14:09:45 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2007-07-06 14:09:45 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
1999-05-03 07:29:11 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-07-06 14:09:45 +00:00
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
#ifndef LDLEX_H
|
|
|
|
#define LDLEX_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
/* The initial parser states. */
|
|
|
|
typedef enum input_enum {
|
|
|
|
input_selected, /* We've set the initial state. */
|
|
|
|
input_script,
|
|
|
|
input_mri_script,
|
|
|
|
input_version_script,
|
2006-09-07 17:16:34 +00:00
|
|
|
input_dynamic_list,
|
1999-05-03 07:29:11 +00:00
|
|
|
input_defsym
|
|
|
|
} input_type;
|
|
|
|
|
|
|
|
extern input_type parser_input;
|
|
|
|
|
|
|
|
extern unsigned int lineno;
|
|
|
|
extern const char *lex_string;
|
|
|
|
|
|
|
|
/* In ldlex.l. */
|
2003-06-28 05:28:54 +00:00
|
|
|
extern int yylex (void);
|
2012-03-08 05:29:33 +00:00
|
|
|
extern void lex_push_file (FILE *, const char *, unsigned int);
|
PR ld/13343
* ld.h (parsing_defsym): Delete.
* ldexp.c (exp_intop, exp_bigintop, exp_relop): Set type.filename.
(fold_binary, fold_name, exp_fold_tree_1, exp_get_vma, exp_get_fill,
exp_get_abs_int): Add tree arg for %S in error messages. Don't
fudge lineno.
(exp_binop, exp_unop, exp_nameop, exp_assop, exp_assert): Copy
type.filename from sub-tree.
(exp_trinop): Likewise, and use "cond" rather than "lhs".
* ldexp.h (node_type): Add filename field to struct.
* ldfile.c (ldfile_input_filename): Delete. Remove all refs.
* ldfile.h (ldfile_input_filename): Delete.
* ldgram.y (phdr_type, phdr_qualifiers, yyerror): Add NULL arg for
%S in error messages.
* ldemul.c (syslib_default, hll_default): Likewise.
* ldlang.c (lang_memory_region_lookup, lang_memory_region_alias,
lang_get_regions, lang_new_phdr): Likewise.
(lang_size_sections_1): Pass addr_tree for %S.
* ldlex.h (lex_redirect): Update prototype.
(ldlex_filename): Declare.
* ldlex.l (<EOF>): Don't set ldfile_input_filename.
(lex_redirect): Add fake_filename and count params. Push
fake_filename to file_name_stack and init lineno from count.
(ldlex_filename): New function.
(lex_warn_invalid): Use above.
* ldmain.c (main): Update lex_redirect call.
* ldmisc.c (vfinfo <%S>): Take file name and line number from
etree_type arg, or use current if arg is NULL.
* lexsup.c (parsing_defsym): Delete.
(parse_args <OPTION_DEFSYM>): Update lex_redirect call.
2012-02-17 14:09:57 +00:00
|
|
|
extern void lex_redirect (const char *, const char *, unsigned int);
|
2003-06-28 05:28:54 +00:00
|
|
|
extern void ldlex_script (void);
|
|
|
|
extern void ldlex_mri_script (void);
|
|
|
|
extern void ldlex_version_script (void);
|
|
|
|
extern void ldlex_version_file (void);
|
|
|
|
extern void ldlex_defsym (void);
|
|
|
|
extern void ldlex_expression (void);
|
|
|
|
extern void ldlex_both (void);
|
|
|
|
extern void ldlex_command (void);
|
|
|
|
extern void ldlex_popstate (void);
|
PR ld/13343
* ld.h (parsing_defsym): Delete.
* ldexp.c (exp_intop, exp_bigintop, exp_relop): Set type.filename.
(fold_binary, fold_name, exp_fold_tree_1, exp_get_vma, exp_get_fill,
exp_get_abs_int): Add tree arg for %S in error messages. Don't
fudge lineno.
(exp_binop, exp_unop, exp_nameop, exp_assop, exp_assert): Copy
type.filename from sub-tree.
(exp_trinop): Likewise, and use "cond" rather than "lhs".
* ldexp.h (node_type): Add filename field to struct.
* ldfile.c (ldfile_input_filename): Delete. Remove all refs.
* ldfile.h (ldfile_input_filename): Delete.
* ldgram.y (phdr_type, phdr_qualifiers, yyerror): Add NULL arg for
%S in error messages.
* ldemul.c (syslib_default, hll_default): Likewise.
* ldlang.c (lang_memory_region_lookup, lang_memory_region_alias,
lang_get_regions, lang_new_phdr): Likewise.
(lang_size_sections_1): Pass addr_tree for %S.
* ldlex.h (lex_redirect): Update prototype.
(ldlex_filename): Declare.
* ldlex.l (<EOF>): Don't set ldfile_input_filename.
(lex_redirect): Add fake_filename and count params. Push
fake_filename to file_name_stack and init lineno from count.
(ldlex_filename): New function.
(lex_warn_invalid): Use above.
* ldmain.c (main): Update lex_redirect call.
* ldmisc.c (vfinfo <%S>): Take file name and line number from
etree_type arg, or use current if arg is NULL.
* lexsup.c (parsing_defsym): Delete.
(parse_args <OPTION_DEFSYM>): Update lex_redirect call.
2012-02-17 14:09:57 +00:00
|
|
|
extern const char* ldlex_filename (void);
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
/* In lexsup.c. */
|
2003-06-28 05:28:54 +00:00
|
|
|
extern int lex_input (void);
|
|
|
|
extern void lex_unput (int);
|
1999-05-03 07:29:11 +00:00
|
|
|
#ifndef yywrap
|
2003-06-28 05:28:54 +00:00
|
|
|
extern int yywrap (void);
|
1999-05-03 07:29:11 +00:00
|
|
|
#endif
|
2003-06-28 05:28:54 +00:00
|
|
|
extern void parse_args (unsigned, char **);
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
#endif
|