My Project
Loading...
Searching...
No Matches
pparg.h
Go to the documentation of this file.
1
4#ifndef __PPARG
5#define __PPARG
6
7typedef struct PPArg_ {
8 struct Vector_ path;
9 struct Hash_ hash;
12
13ANN void pparg_ini(MemPool, PPArg *);
14ANN void pparg_end(PPArg *);
15
16ANN static inline struct Macro_ *ppa_has_macro(PPArg *ppa,
17 const Symbol sym) {
18 if (!ppa->hash.table) return NULL;
19 return macro_has(&ppa->hash, s_name(sym));
20}
21
22ANN static inline bool ppa_rem_macro(PPArg *ppa, const Symbol sym) {
23 if (!ppa->hash.table) return false;
24 return macro_has(&ppa->hash, s_name(sym)) ? true : false;
25}
26
27ANN2(1) bool pparg_add(PPArg *ppa, const m_str str);
28ANN2(1) static inline bool pparg_rem(PPArg *ppa, const m_str str) {
29 if (!ppa->hash.table) return false;
30 return macro_rem(&ppa->hash, str);
31}
32ANN static inline void pparg_inc(PPArg *ppa, const m_str str) {
33 return vector_add(&ppa->path, (vtype)str);
34}
35#endif
struct SectionList * Ast
Definition absyn.h:23
const Symbol
Definition absyn.h:347
return NULL
Definition macro.c:41
Macro macro_has(const Hash, m_str)
bool macro_rem(const Hash, m_str)
const m_str str
Definition pparg.h:27
ANN2(1) bool pparg_add(PPArg *ppa
ANN void pparg_end(PPArg *)
Definition pparg.c:62
ANN void pparg_ini(MemPool, PPArg *)
Definition pparg.c:57
return macro_rem & ppa
Definition pparg.h:30
static ANN bool ppa_rem_macro(PPArg *ppa, const Symbol sym)
Definition pparg.h:22
static ANN struct Macro_ * ppa_has_macro(PPArg *ppa, const Symbol sym)
Definition pparg.h:16
static ANN void pparg_inc(PPArg *ppa, const m_str str)
Definition pparg.h:32
struct PPArg_ PPArg
Definition macro.h:22
Definition pparg.h:7
Ast ast
Definition pparg.h:10
struct Vector_ path
Definition pparg.h:8
struct Hash_ hash
Definition pparg.h:9