as - Make it possible to allow 64b LEB values on a 32b target.
[darwin-xtools.git] / cctools / as / read.h
blob0051846a1645f49e888ddf0e1d2b18fe44d4123b
1 #ifndef _READ_H_
2 #define _READ_H_
3 /* read.h - of read.c
4 Copyright (C) 1986 Free Software Foundation, Inc.
6 This file is part of GAS, the GNU Assembler.
8 GAS is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 1, or (at your option)
11 any later version.
13 GAS is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GAS; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 #include <stdint.h>
23 #import "expr.h"
25 /* Define to make whitespace be allowed in many syntactically
26 unnecessary places. Normally undefined. For compatibility with
27 ancient GNU cc. */
28 /* #undef PERMIT_WHITESPACE */
29 #define PERMIT_WHITESPACE
31 #ifdef PERMIT_WHITESPACE
32 #define SKIP_WHITESPACE() \
33 (void)((*input_line_pointer == ' ') ? ++input_line_pointer : 0)
34 #else
35 #define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
36 #endif
39 #define LEX_NAME (1) /* may continue a name */
40 #define LEX_BEGIN_NAME (2) /* may begin a name */
42 #define is_name_beginner(c) ( lex_type[(c) & 0xff] & LEX_BEGIN_NAME )
43 #define is_part_of_name(c) ( lex_type[(c) & 0xff] & LEX_NAME )
46 * A pseudo opcode table entry.
48 typedef struct {
49 char *poc_name; /* assembler mnemonic, lower case, no '.' */
50 void (*poc_handler)(uintptr_t poc_val); /* Do the work */
51 uintptr_t poc_val; /* Value to pass to handler */
52 } pseudo_typeS;
54 extern char *input_line_pointer; /* -> char we are parsing now. */
55 extern char *buffer_limit; /* -> 1 + last char in buffer. */
57 /* FROM line 60 */
58 extern int target_big_endian;
60 extern
61 #ifndef PPC
62 const
63 #endif /* PPC */
64 char lex_type[];
65 extern char is_end_of_line(
66 int c);
67 extern uint32_t text_nsect;
70 * These variable are set with .inlineasmstart and used when reporting errors
71 * for the properties of GCC function-scope inline asms.
73 extern int inlineasm_checks;
74 extern char *inlineasm_file_name;
75 extern int inlineasm_line_number;
76 extern int inlineasm_column_number;
78 extern void read_begin(
79 void);
80 #ifdef PPC
81 extern void ppcasm_read_begin(
82 void);
83 #endif /* PPC */
84 void read_a_source_file(
85 char *buffer);
86 extern signed_target_addr_t get_absolute_expression(
87 void);
88 extern char *demand_copy_C_string(
89 int *len_pointer);
90 extern void demand_empty_rest_of_line(
91 void);
92 extern void ignore_rest_of_line(
93 void);
94 extern void add_to_macro_definition(
95 char *char_pointer);
96 extern segT get_known_segmented_expression(
97 expressionS *expP);
98 extern void totally_ignore_line(
99 void);
101 /* globally known pseudo-op functions (used by some assemblers in MACHINE.c) */
102 extern void stringer(
103 uintptr_t append_zero);
104 extern void s_space(
105 uintptr_t value);
106 extern void s_abs(
107 uintptr_t value);
108 extern void float_cons(
109 uintptr_t float_type);
110 extern void cons(
111 uintptr_t nbytes);
112 extern void s_globl(
113 uintptr_t value);
114 void s_app_file(
115 uintptr_t value);
116 extern void s_ignore(
117 uintptr_t arg);
118 extern void s_line(
119 uintptr_t value);
120 extern void s_macro(
121 uintptr_t value);
122 extern void s_endmacro(
123 uintptr_t value);
124 extern void big_cons(
125 uintptr_t nbytes);
126 extern void pseudo_set(
127 symbolS *symbolP);
128 #if ALLOW_64BIT_LEB_ON_32B_TARGET
129 extern int output_leb128(
130 char *p,
131 uint64_t value,
132 int sign);
133 extern int sizeof_leb128(
134 uint64_t value,
135 int sign);
136 #else
137 extern int output_leb128(
138 char *p,
139 valueT value,
140 int sign);
141 extern int sizeof_leb128(
142 valueT value,
143 int sign);
144 #endif
145 #endif /* _READ_H_ */