1991-04-04 20:19:53 +02:00
|
|
|
/* read.h - of read.c
|
1992-11-23 21:39:57 +01:00
|
|
|
|
|
|
|
Copyright (C) 1986, 1990, 1992 Free Software Foundation, Inc.
|
|
|
|
|
1992-02-13 09:33:54 +01:00
|
|
|
This file is part of GAS, the GNU Assembler.
|
1992-11-23 21:39:57 +01:00
|
|
|
|
1992-02-13 09:33:54 +01:00
|
|
|
GAS is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
1992-11-23 21:39:57 +01:00
|
|
|
|
1992-02-13 09:33:54 +01:00
|
|
|
GAS is distributed in the hope that it will be useful,
|
|
|
|
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.
|
1992-11-23 21:39:57 +01:00
|
|
|
|
1992-02-13 09:33:54 +01:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GAS; see the file COPYING. If not, write to
|
1995-08-08 23:41:30 +02:00
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1991-04-04 20:19:53 +02:00
|
|
|
|
1992-11-23 21:39:57 +01:00
|
|
|
extern char *input_line_pointer;/* -> char we are parsing now. */
|
1991-04-04 20:19:53 +02:00
|
|
|
|
|
|
|
#define PERMIT_WHITESPACE /* Define to make whitespace be allowed in */
|
1992-02-13 09:33:54 +01:00
|
|
|
/* many syntactically unnecessary places. */
|
|
|
|
/* Normally undefined. For compatibility */
|
|
|
|
/* with ancient GNU cc. */
|
|
|
|
/* #undef PERMIT_WHITESPACE */
|
1991-04-04 20:19:53 +02:00
|
|
|
|
|
|
|
#ifdef PERMIT_WHITESPACE
|
|
|
|
#define SKIP_WHITESPACE() {if (* input_line_pointer == ' ') ++ input_line_pointer;}
|
|
|
|
#else
|
|
|
|
#define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1992-11-23 21:39:57 +01:00
|
|
|
#define LEX_NAME (1) /* may continue a name */
|
|
|
|
#define LEX_BEGIN_NAME (2) /* may begin a name */
|
1992-02-13 09:33:54 +01:00
|
|
|
|
1993-09-10 18:01:07 +02:00
|
|
|
#define is_name_beginner(c) \
|
|
|
|
( lex_type[(unsigned char) (c)] & LEX_BEGIN_NAME )
|
|
|
|
#define is_part_of_name(c) \
|
|
|
|
( lex_type[(unsigned char) (c)] & LEX_NAME )
|
1991-04-04 20:19:53 +02:00
|
|
|
|
|
|
|
#ifndef is_a_char
|
|
|
|
#define CHAR_MASK (0xff)
|
|
|
|
#define NOT_A_CHAR (CHAR_MASK+1)
|
|
|
|
#define is_a_char(c) (((unsigned)(c)) <= CHAR_MASK)
|
|
|
|
#endif /* is_a_char() */
|
|
|
|
|
1995-08-08 23:41:30 +02:00
|
|
|
extern char lex_type[];
|
1991-04-04 20:19:53 +02:00
|
|
|
extern char is_end_of_line[];
|
|
|
|
|
1995-08-08 23:41:30 +02:00
|
|
|
extern int target_big_endian;
|
|
|
|
|
1992-11-23 21:39:57 +01:00
|
|
|
/* These are initialized by the CPU specific target files (tc-*.c). */
|
|
|
|
extern const char comment_chars[];
|
|
|
|
extern const char line_comment_chars[];
|
|
|
|
extern const char line_separator_chars[];
|
|
|
|
|
1995-05-05 01:44:28 +02:00
|
|
|
/* This flag whether to generate line info for asm file */
|
|
|
|
extern int generate_asm_lineno;
|
|
|
|
|
* read.c (abs_section_offset): New global variable.
(potable): Add offset, struct.
(do_org): New static function; handle changing the origin in the
absolute section.
(s_org): Use do_org.
(s_set): Likewise.
(equals): Likewise.
(s_space): In absolute_section, just increase abs_section_offset.
(s_struct): New function.
(emit_expr): Handle absolute_section specially.
* read.h (abs_section_offset): Declare.
(s_struct): Declare.
* read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne.
Change if to pass O_ne to s_if.
(read_a_source_file): Don't define an label without a colon if
ignore_input returns true.
* read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w,
dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen,
noformat.
(read_a_source_file): If pseudo-op handler is s_end, quit
immediately.
(s_end): New function.
(s_fail): New function.
(s_float_space): New function.
(hex_float): New static function.
(float_cons): Use hex_float.
* read.h (s_fail): Declare.
(s_float_space): Declare.
1995-08-09 21:36:25 +02:00
|
|
|
/* The offset in the absolute section. */
|
|
|
|
extern addressT abs_section_offset;
|
|
|
|
|
1995-08-10 01:16:06 +02:00
|
|
|
/* The MRI label on a line, used by some of the MRI pseudo-ops. */
|
|
|
|
extern symbolS *mri_line_label;
|
|
|
|
|
1995-08-08 23:41:30 +02:00
|
|
|
/* This is used to support MRI common sections. */
|
|
|
|
extern symbolS *mri_common_symbol;
|
|
|
|
|
1995-05-05 01:44:28 +02:00
|
|
|
unsigned int get_stab_string_offset PARAMS ((const char *string,
|
|
|
|
const char *stabstr_secname));
|
|
|
|
|
1993-09-07 19:39:56 +02:00
|
|
|
char *demand_copy_C_string PARAMS ((int *len_pointer));
|
|
|
|
char get_absolute_expression_and_terminator PARAMS ((long *val_pointer));
|
1993-09-10 18:01:07 +02:00
|
|
|
offsetT get_absolute_expression PARAMS ((void));
|
|
|
|
unsigned int next_char_of_string PARAMS ((void));
|
1993-09-07 19:39:56 +02:00
|
|
|
void add_include_dir PARAMS ((char *path));
|
1995-05-05 01:44:28 +02:00
|
|
|
void cons PARAMS ((int nbytes));
|
1993-09-07 19:39:56 +02:00
|
|
|
void demand_empty_rest_of_line PARAMS ((void));
|
|
|
|
void emit_expr PARAMS ((expressionS *exp, unsigned int nbytes));
|
|
|
|
void equals PARAMS ((char *sym_name));
|
|
|
|
void float_cons PARAMS ((int float_type));
|
|
|
|
void ignore_rest_of_line PARAMS ((void));
|
|
|
|
void pseudo_set PARAMS ((symbolS * symbolP));
|
|
|
|
void read_a_source_file PARAMS ((char *name));
|
|
|
|
void read_begin PARAMS ((void));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_abort PARAMS ((int));
|
1993-09-07 19:39:56 +02:00
|
|
|
void s_align_bytes PARAMS ((int arg));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_align_ptwo PARAMS ((int));
|
1993-09-07 19:39:56 +02:00
|
|
|
void s_app_file PARAMS ((int));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_app_line PARAMS ((int));
|
|
|
|
void s_comm PARAMS ((int));
|
|
|
|
void s_data PARAMS ((int));
|
|
|
|
void s_desc PARAMS ((int));
|
1993-09-07 19:39:56 +02:00
|
|
|
void s_else PARAMS ((int arg));
|
|
|
|
void s_end PARAMS ((int arg));
|
|
|
|
void s_endif PARAMS ((int arg));
|
* read.c (abs_section_offset): New global variable.
(potable): Add offset, struct.
(do_org): New static function; handle changing the origin in the
absolute section.
(s_org): Use do_org.
(s_set): Likewise.
(equals): Likewise.
(s_space): In absolute_section, just increase abs_section_offset.
(s_struct): New function.
(emit_expr): Handle absolute_section specially.
* read.h (abs_section_offset): Declare.
(s_struct): Declare.
* read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne.
Change if to pass O_ne to s_if.
(read_a_source_file): Don't define an label without a colon if
ignore_input returns true.
* read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w,
dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen,
noformat.
(read_a_source_file): If pseudo-op handler is s_end, quit
immediately.
(s_end): New function.
(s_fail): New function.
(s_float_space): New function.
(hex_float): New static function.
(float_cons): Use hex_float.
* read.h (s_fail): Declare.
(s_float_space): Declare.
1995-08-09 21:36:25 +02:00
|
|
|
void s_fail PARAMS ((int));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_fill PARAMS ((int));
|
* read.c (abs_section_offset): New global variable.
(potable): Add offset, struct.
(do_org): New static function; handle changing the origin in the
absolute section.
(s_org): Use do_org.
(s_set): Likewise.
(equals): Likewise.
(s_space): In absolute_section, just increase abs_section_offset.
(s_struct): New function.
(emit_expr): Handle absolute_section specially.
* read.h (abs_section_offset): Declare.
(s_struct): Declare.
* read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne.
Change if to pass O_ne to s_if.
(read_a_source_file): Don't define an label without a colon if
ignore_input returns true.
* read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w,
dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen,
noformat.
(read_a_source_file): If pseudo-op handler is s_end, quit
immediately.
(s_end): New function.
(s_fail): New function.
(s_float_space): New function.
(hex_float): New static function.
(float_cons): Use hex_float.
* read.h (s_fail): Declare.
(s_float_space): Declare.
1995-08-09 21:36:25 +02:00
|
|
|
void s_float_space PARAMS ((int mult));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_globl PARAMS ((int arg));
|
1993-09-07 19:39:56 +02:00
|
|
|
void s_if PARAMS ((int arg));
|
|
|
|
void s_ifdef PARAMS ((int arg));
|
|
|
|
void s_ifeqs PARAMS ((int arg));
|
|
|
|
void s_ignore PARAMS ((int arg));
|
|
|
|
void s_include PARAMS ((int arg));
|
|
|
|
void s_lcomm PARAMS ((int needs_align));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_lsym PARAMS ((int));
|
* read.c (abs_section_offset): New global variable.
(potable): Add offset, struct.
(do_org): New static function; handle changing the origin in the
absolute section.
(s_org): Use do_org.
(s_set): Likewise.
(equals): Likewise.
(s_space): In absolute_section, just increase abs_section_offset.
(s_struct): New function.
(emit_expr): Handle absolute_section specially.
* read.h (abs_section_offset): Declare.
(s_struct): Declare.
* read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne.
Change if to pass O_ne to s_if.
(read_a_source_file): Don't define an label without a colon if
ignore_input returns true.
* read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w,
dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen,
noformat.
(read_a_source_file): If pseudo-op handler is s_end, quit
immediately.
(s_end): New function.
(s_fail): New function.
(s_float_space): New function.
(hex_float): New static function.
(float_cons): Use hex_float.
* read.h (s_fail): Declare.
(s_float_space): Declare.
1995-08-09 21:36:25 +02:00
|
|
|
void s_mri_common PARAMS ((int));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_org PARAMS ((int));
|
|
|
|
void s_set PARAMS ((int));
|
1993-09-07 19:39:56 +02:00
|
|
|
void s_space PARAMS ((int mult));
|
|
|
|
void s_stab PARAMS ((int what));
|
* read.c (abs_section_offset): New global variable.
(potable): Add offset, struct.
(do_org): New static function; handle changing the origin in the
absolute section.
(s_org): Use do_org.
(s_set): Likewise.
(equals): Likewise.
(s_space): In absolute_section, just increase abs_section_offset.
(s_struct): New function.
(emit_expr): Handle absolute_section specially.
* read.h (abs_section_offset): Declare.
(s_struct): Declare.
* read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne.
Change if to pass O_ne to s_if.
(read_a_source_file): Don't define an label without a colon if
ignore_input returns true.
* read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w,
dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen,
noformat.
(read_a_source_file): If pseudo-op handler is s_end, quit
immediately.
(s_end): New function.
(s_fail): New function.
(s_float_space): New function.
(hex_float): New static function.
(float_cons): Use hex_float.
* read.h (s_fail): Declare.
(s_float_space): Declare.
1995-08-09 21:36:25 +02:00
|
|
|
void s_struct PARAMS ((int));
|
1995-05-05 01:44:28 +02:00
|
|
|
void s_text PARAMS ((int));
|
1993-09-07 19:39:56 +02:00
|
|
|
void stringer PARAMS ((int append_zero));
|
|
|
|
void s_xstab PARAMS ((int what));
|
1991-04-04 20:19:53 +02:00
|
|
|
|
1992-02-13 10:13:54 +01:00
|
|
|
/* end of read.h */
|