1 /* macro.h - header file for macro support for gas
2 Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006,
3 2007, 2012 Free Software Foundation, Inc.
5 Written by Steve and Judy Chamberlain of Cygnus Support,
8 This file is part of GAS, the GNU Assembler.
10 GAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 GAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GAS; see the file COPYING. If not, write to the Free
22 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
29 /* Structures used to store macros.
31 Each macro knows its name and included text. It gets built with a
32 list of formal arguments, and also keeps a hash table which points
33 into the list to speed up formal search. Each formal knows its
34 name and its default value. Each time the macro is expanded, the
35 formals get the actual values attached to them. */
44 /* Describe the formal arguments to a macro. */
46 typedef struct formal_struct
{
47 struct formal_struct
*next
; /* Next formal in list. */
48 sb name
; /* Name of the formal. */
49 sb def
; /* The default value. */
50 sb actual
; /* The actual argument (changed on each expansion). */
51 int index
; /* The index of the formal 0..formal_count - 1. */
52 enum formal_type type
; /* The kind of the formal. */
55 /* Other values found in the index field of a formal_entry. */
56 #define QUAL_INDEX (-1)
57 #define NARG_INDEX (-2)
58 #define LOCAL_INDEX (-3)
60 /* Describe the macro. */
62 typedef struct macro_struct
64 sb sub
; /* Substitution text. */
65 int formal_count
; /* Number of formal args. */
66 formal_entry
*formals
; /* Pointer to list of formal_structs. */
67 struct hash_control
*formal_hash
; /* Hash table of formals. */
68 const char *name
; /* Macro name. */
69 char *file
; /* File the macro was defined in. */
70 unsigned int line
; /* Line number of definition. */
73 /* Whether any macros have been defined. */
75 extern int macro_defined
;
77 /* The macro nesting level. */
79 extern int macro_nest
;
81 /* The macro hash table. */
83 extern struct hash_control
*macro_hash
;
85 extern int buffer_and_nest (const char *, const char *, sb
*,
87 extern void macro_init (int, int, int,
88 size_t (*) (const char *, size_t, sb
*, offsetT
*));
89 extern void macro_set_alternate (int);
90 extern void macro_mri_mode (int);
91 extern const char *define_macro (size_t, sb
*, sb
*, size_t (*) (sb
*),
92 char *, unsigned int, const char **);
93 extern int check_macro (const char *, sb
*, const char **, macro_entry
**);
94 extern void delete_macro (const char *);
95 extern const char *expand_irp (int, size_t, sb
*, sb
*, size_t (*) (sb
*));
This page took 0.030799 seconds and 4 git commands to generate.