PIPS
|
Go to the source code of this file.
Data Structures | |
struct | gen_binding |
union | domain |
A DOMAIN union describes the structure of a user type. More... | |
Macros | |
#define | UNIT_TYPE_NAME "unit" |
The UNIT_TYPE_NAME is the used to type expressions which only perform side-effects. More... | |
#define | DEFLIST(type, cartype, carname) |
A list type constructor. More... | |
#define | MAX_DOMAIN 300 |
MAX_DOMAIN is the maximum number of entries in the DOMAINS table. More... | |
#define | IS_INLINABLE(bp) ((bp)->inlined != NULL) |
Different kinds of BINDING structure pointers. More... | |
#define | IS_EXTERNAL(bp) ((bp)->domain->ba.type == EXTERNAL_DT) |
#define | IS_TABULATED(bp) ((bp)->tabulated!=NULL) |
#define | IS_IMPORT(bp) ((bp)->domain->ba.type == IMPORT_DT) |
#define | IS_NORMAL(bp) (!IS_INLINABLE(bp)&&!IS_EXTERNAL(bp)&&!IS_TABULATED(bp)) |
#define | NEW_BINDING 1 |
Action parameter to the LOOKUP() function in the symbol table. More... | |
#define | OLD_BINDING 2 |
#define | HASH_OFFSET 2 |
For tabulated objects, the offset HASH_OFFSET of the hashed subdomain. More... | |
#define | same_string_p(s1, s2) (strcmp((s1), (s2)) == 0) |
#define | IS_UNIT_TYPE(n) ((n)==unit_domain) |
#define | IS_BOOL_TYPE(n) ((n)==bool_domain) |
#define | IS_CHAR_TYPE(n) ((n)==char_domain) |
#define | IS_INT_TYPE(n) ((n)==int_domain) |
#define | IS_FLOAT_TYPE(n) ((n)==float_domain) |
#define | IS_STRING_TYPE(n) ((n)==string_domain) |
#define | check_domain(dom) |
#define | check_read_spec_performed() |
#define | NEWGEN_FREED ((void*)NULL) |
#define | newgen_free(p) (*((char*)(p))='\0',free(p)) /**just to hide bugs */ |
#define | quick_domain_index(obj) |
inlined version of domain_index. More... | |
Typedefs | |
typedef struct _gtp * | gen_tabulated_p |
actually defined in tabulated.c More... | |
Enumerations | |
enum | type_of_domain { UNDEF_DT = 0 , EXTERNAL_DT = 1 , BASIS_DT = 2 , LIST_DT = 3 , ARRAY_DT = 4 , CONSTRUCTED_DT = 5 , IMPORT_DT = 6 , SET_DT = 7 } |
Types of domain. More... | |
enum | domain_operator { UNDEF_OP = 0 , AND_OP = 1 , OR_OP = 2 , ARROW_OP = 3 } |
Operators for CONSTRUCTED domains. More... | |
Functions | |
DEFLIST (namelist, char *, name) | |
DEFLIST (intlist, int, val) | |
DEFLIST (domainlist, union domain *, domain) | |
struct gen_binding * | lookup () |
struct gen_binding * | new_binding () |
void | user (char *,...) |
External routines. More... | |
void | gencode (string) |
generate the code necessary to manipulate every internal non-inlinable type in the Domains table. More... | |
void | fatal (char *,...) |
char * | i2a (int) |
I2A (Integer TO Ascii) yields a string for a given Integer. More... | |
void | print_domains (FILE *) |
PRINT_DOMAINS prints on the OUT stream the Domains table. More... | |
void | init (void) |
INIT initializes global data structures. More... | |
void | compile (void) |
COMPILE reconnects the Domains table (for not compiled types – note that an inlined type is already compiled). More... | |
int | gen_size (int) |
GEN_SIZE returns the size (in gen_chunks) of an object of type defined by the BP type. More... | |
void | print_domain (FILE *, union domain *) |
PRINT_DOMAIN prints on the OUT stream a domain denoted by the DP pointer. More... | |
string | concatenate (const char *,...) |
Return the concatenation of the given strings. More... | |
int | genspec_parse (void) |
int | genspec_lex (void) |
int | genread_parse (void) |
int | genread_lex (void) |
gen_tabulated_p | gen_init_tabulated (int) |
gen_chunk * | gen_enter_tabulated (int, char *, gen_chunk *, bool) |
ENTER_TABULATED_DEF enters a new definition (previous refs are allowed if ALLOW_REF) in the INDEX tabulation table of the DOMAIN, with the unique ID and value CHUNKP. More... | |
gen_chunk * | gen_do_enter_tabulated (int, char *, gen_chunk *, bool) |
gen_chunk * | gen_tabulated_fake_object_hack (int) |
WARNING: it is not reentrant... More... | |
int | newgen_domain_index (gen_chunk *) |
DOMAIN_INDEX returns the index in the Domain table for object OBJ. More... | |
Variables | |
struct gen_binding | Domains [] |
The implementation of tabulated domains. More... | |
struct gen_binding * | Tabulated_bp |
hack to walk thru tabulateds... More... | |
gen_chunk * | Read_chunk |
The root of the gen_chunk read with READ_CHUNK. More... | |
int | Current_op |
Used to check, while parsing specs, that a constructed domain use only one operator type. More... | |
int | Number_imports |
To manage imported domains: More... | |
int | Current_start |
int | Read_spec_mode |
extern int Current_first ; More... | |
#define check_domain | ( | dom | ) |
Definition at line 212 of file newgen_include.h.
#define check_read_spec_performed | ( | ) |
Definition at line 216 of file newgen_include.h.
#define DEFLIST | ( | type, | |
cartype, | |||
carname | |||
) |
A list type constructor.
Definition at line 55 of file newgen_include.h.
#define HASH_OFFSET 2 |
For tabulated objects, the offset HASH_OFFSET of the hashed subdomain.
Definition at line 196 of file newgen_include.h.
#define IS_BOOL_TYPE | ( | n | ) | ((n)==bool_domain) |
Definition at line 201 of file newgen_include.h.
#define IS_CHAR_TYPE | ( | n | ) | ((n)==char_domain) |
Definition at line 202 of file newgen_include.h.
#define IS_EXTERNAL | ( | bp | ) | ((bp)->domain->ba.type == EXTERNAL_DT) |
Definition at line 155 of file newgen_include.h.
#define IS_FLOAT_TYPE | ( | n | ) | ((n)==float_domain) |
Definition at line 204 of file newgen_include.h.
Definition at line 157 of file newgen_include.h.
#define IS_INLINABLE | ( | bp | ) | ((bp)->inlined != NULL) |
Different kinds of BINDING structure pointers.
Definition at line 154 of file newgen_include.h.
#define IS_INT_TYPE | ( | n | ) | ((n)==int_domain) |
Definition at line 203 of file newgen_include.h.
#define IS_NORMAL | ( | bp | ) | (!IS_INLINABLE(bp)&&!IS_EXTERNAL(bp)&&!IS_TABULATED(bp)) |
Definition at line 158 of file newgen_include.h.
#define IS_STRING_TYPE | ( | n | ) | ((n)==string_domain) |
Definition at line 205 of file newgen_include.h.
#define IS_TABULATED | ( | bp | ) | ((bp)->tabulated!=NULL) |
Definition at line 156 of file newgen_include.h.
#define IS_UNIT_TYPE | ( | n | ) | ((n)==unit_domain) |
Definition at line 200 of file newgen_include.h.
#define MAX_DOMAIN 300 |
MAX_DOMAIN is the maximum number of entries in the DOMAINS table.
Definition at line 147 of file newgen_include.h.
#define NEW_BINDING 1 |
Action parameter to the LOOKUP() function in the symbol table.
Are looking for a new symbol or an old one ?
Definition at line 170 of file newgen_include.h.
#define newgen_free | ( | p | ) | (*((char*)(p))='\0',free(p)) /**just to hide bugs */ |
Definition at line 222 of file newgen_include.h.
#define NEWGEN_FREED ((void*)NULL) |
Definition at line 220 of file newgen_include.h.
#define OLD_BINDING 2 |
Definition at line 171 of file newgen_include.h.
#define quick_domain_index | ( | obj | ) |
inlined version of domain_index.
what is done by optimizing compilers?
Definition at line 226 of file newgen_include.h.
Definition at line 198 of file newgen_include.h.
#define UNIT_TYPE_NAME "unit" |
The UNIT_TYPE_NAME is the used to type expressions which only perform side-effects.
It is mainly used to build sets.
Definition at line 51 of file newgen_include.h.
typedef struct _gtp* gen_tabulated_p |
actually defined in tabulated.c
Definition at line 66 of file newgen_include.h.
enum domain_operator |
Operators for CONSTRUCTED domains.
Enumerator | |
---|---|
UNDEF_OP | |
AND_OP | |
OR_OP | |
ARROW_OP |
Definition at line 41 of file newgen_include.h.
enum type_of_domain |
Types of domain.
Enumerator | |
---|---|
UNDEF_DT | |
EXTERNAL_DT | |
BASIS_DT | |
LIST_DT | |
ARRAY_DT | |
CONSTRUCTED_DT | |
IMPORT_DT | |
SET_DT |
Definition at line 28 of file newgen_include.h.
void compile | ( | void | ) |
COMPILE reconnects the Domains table (for not compiled types – note that an inlined type is already compiled).
set size of domain.
Definition at line 422 of file build.c.
References ARRAY_DT, domain::ba, BASIS_DT, domain::co, gen_binding::compiled, domain::components, domain::constructand, CONSTRUCTED_DT, current_first, gen_binding::domain, Domains, EXTERNAL_DT, gen_size(), IS_TABULATED, LIST_DT, MAX_DOMAIN, gen_binding::name, print_domains(), reconnect(), SET_DT, gen_binding::size, Tabulated_bp, domain::type, and user().
Referenced by build(), gen_read_spec(), and opencl_compile_mergeable_dag().
string concatenate | ( | const char * | next, |
... | |||
) |
Return the concatenation of the given strings.
CAUTION! concatenation is based on a static dynamically allocated buffer which is shared from one call to another.
Note that if a string is string_undefined, it is just skiped.
FC.
else first argument is the buffer itself...
now gets the strings and concatenates them
skipping first argument if is buffer
should stop after some count?
returns the static '\0' terminated buffer.
next | ext |
Definition at line 183 of file string.c.
Referenced by str_append(), and str_prepend().
DEFLIST | ( | intlist | , |
int | , | ||
val | |||
) |
DEFLIST | ( | namelist | , |
char * | , | ||
name | |||
) |
void fatal | ( | char * | , |
... | |||
) |
Referenced by alloc(), allocated_memory_simple_in(), copy_hsearch(), copy_obj_out(), copy_obj_out_constructed(), copy_simple_in(), fopen_suffix(), gen_alloc(), gen_alloc_constructed(), gen_arg(), gen_delete_tabulated_name(), gen_domain(), gen_put_tabulated(), gen_size(), gen_trav_obj(), gen_trav_obj_constructed(), gen_trav_simple(), gen_type_translation_actual_to_old(), gen_type_translation_old_to_actual(), gencode(), generate_domain(), generate_make(), gtt_read(), hash_map_get(), init_member(), lookup(), newgen_argument_type_name(), newgen_domain_index(), newgen_type_name(), open_black_hole(), persistant_simple_in(), primitive_field(), print_domain(), print_domainlist(), quick_multi_recurse_simple_in(), read_external(), reconnect(), shared_simple_in(), write_leaf_in(), write_obj_in(), write_tabulated_leaf_in(), and yyerror().
stores - if ref
Definition at line 265 of file tabulated.c.
References cp, gen_put_tabulated(), gen_put_tabulated_name(), and message_assert.
Referenced by gen_enter_tabulated(), and make_ref().
ENTER_TABULATED_DEF enters a new definition (previous refs are allowed if ALLOW_REF) in the INDEX tabulation table of the DOMAIN, with the unique ID and value CHUNKP.
already in, redefine
Definition at line 279 of file tabulated.c.
References cp, fprintf(), free(), gen_chunk_undefined, gen_do_enter_tabulated(), gen_find_tabulated(), gen_size(), gen_chunk::i, message_assert, and same_string_p.
Referenced by gen_alloc(), and make_def().
gen_tabulated_p gen_init_tabulated | ( | int | domain | ) |
Definition at line 66 of file tabulated.c.
References alloc(), _gtp::domain, gen_chunk_undefined, hash_string, hash_table_make(), _gtp::names, _gtp::size, _gtp::table, TABULATED_ELEMENTS_SIZE, and _gtp::used.
GEN_SIZE returns the size (in gen_chunks) of an object of type defined by the BP type.
to avoid a gcc warning
OTREACHED
Definition at line 71 of file genC.c.
References AND_OP, ARRAY_DT, ARROW_OP, domain::ba, BASIS_DT, domain::co, domain::components, CONSTRUCTED_DT, gen_binding::domain, Domains, fatal(), GEN_HEADER, i2a(), IS_TABULATED, LIST_DT, domain::op, OR_OP, SET_DT, gen_binding::size, and domain::type.
Referenced by allocated_memory_obj_in(), compile(), copy_obj_in(), gen_enter_tabulated(), and generate_make().
WARNING: it is not reentrant...
max_tabulated_elements()
Definition at line 107 of file tabulated.c.
References domain::ar, domain::dimensions, gen_binding::domain, Domains, domain::element, get_tabulated_from_domain(), gen_chunk::i, gen_chunk::p, and Tabulated_bp.
Referenced by gen_write_tabulated().
void gencode | ( | string | file | ) |
generate the code necessary to manipulate every internal non-inlinable type in the Domains table.
header = fopen_suffix(file, ".h");
first generate protected forward declarations.
then generate actual declarations.
fclose(header);
Definition at line 928 of file genC.c.
References Domains, DONT_TOUCH, fatal(), fopen_suffix(), fprintf(), generate_domain(), generate_safe_definition(), IS_EXTERNAL, IS_IMPORT, IS_INLINABLE, IS_TAB, MAX_DOMAIN, gen_binding::name, sharp_else(), sharp_endif(), and sharp_ifopt().
Referenced by build().
int genread_lex | ( | void | ) |
int genread_parse | ( | void | ) |
int genspec_lex | ( | void | ) |
int genspec_parse | ( | void | ) |
char* i2a | ( | int | i | ) |
void init | ( | void | ) |
INIT initializes global data structures.
FC: formats are directly inlined in genClib...
Tabulated_bp hack is statically allocated here.
Definition at line 130 of file build.c.
References domain::ar, ARRAY_DT, domain::ba, gen_binding::compiled, domain::constructor, Current_op, Current_start, domain::dimensions, gen_binding::domain, Domains, domain::element, error_seen, gen_binding::inlined, MAX_DOMAIN, inlinable::name, gen_binding::name, gen_binding::size, gen_binding::tabulated, Tabulated_bp, domain::type, UNDEF_OP, and UNIT_TYPE_NAME.
Referenced by build().
struct gen_binding* lookup | ( | ) |
struct gen_binding* new_binding | ( | ) |
DOMAIN_INDEX returns the index in the Domain table for object OBJ.
Definition at line 105 of file genClib.c.
References fatal(), gen_chunk_undefined, gen_chunk::i, MAX_DOMAIN, and message_assert.
void print_domain | ( | FILE * | out, |
union domain * | dp | ||
) |
PRINT_DOMAIN prints on the OUT stream a domain denoted by the DP pointer.
This is done before the compilation so (STRUCT BINDING *) members are still strings.
Definition at line 294 of file build.c.
References domain::ar, ARRAY_DT, domain::ba, BASIS_DT, domain::co, domain::components, domain::constructand, CONSTRUCTED_DT, domain::constructor, domain::dimensions, Domains, domain::element, EXTERNAL_DT, fatal(), domain::filename, fprintf(), i2a(), domain::im, IMPORT_DT, domain::li, LIST_DT, gen_binding::name, domain::op, out, print_domainlist(), print_persistant(), domain::se, SET_DT, and domain::type.
Referenced by defined_null(), gen_trav_obj(), gen_trav_simple(), print_domainlist(), and print_domains().
void print_domains | ( | FILE * | out | ) |
PRINT_DOMAINS prints on the OUT stream the Domains table.
Inlined domains aren't printed.
if( (dp=bp->domain)->ba.type==CONSTRUCTED_DT && dp->co.op==OR_OP) (void)fprintf( out, "--NEWGEN-FIRST %d\n", dp->co.first ) ;
Definition at line 352 of file build.c.
References gen_binding::domain, Domains, fprintf(), IS_EXTERNAL, IS_IMPORT, IS_INLINABLE, IS_TABULATED, MAX_DOMAIN, gen_binding::name, out, print_domain(), and Tabulated_bp.
Referenced by compile(), and gen_write_spec().
void user | ( | char * | , |
... | |||
) |
External routines.
Referenced by allocated_memory_leaf_in(), build(), check_not_keyword(), check_sharing(), compile(), copy_leaf_out(), defined_null(), free_leaf_out(), gen_alloc_constructed(), gen_check(), gen_init_external(), gen_read_spec(), gen_write_spec(), genspec_error(), lookup(), make_ref(), new_binding(), read_external(), update_op(), write_leaf_in(), and write_string().
|
extern |
Used to check, while parsing specs, that a constructed domain use only one operator type.
Definition at line 62 of file build.c.
Referenced by init(), and update_op().
|
extern |
The implementation of tabulated domains.
Domains is the symbol table for user defined types.
COMPILED refers to inlined data types. INDEX is used whenever the type is used with refs and defs (ALLOC is the next place to allocate tabulated values).
The implementation of tabulated domains.
Domains is the symbol table for user defined types.
COMPILED refers to inlined data types. INDEX is used whenever the type is used with refs and defs (ALLOC is the next place to allocate tabulated values).
Definition at line 150 of file newgen_include.h.
Referenced by allocated_memory_obj_in(), chunk_for_domain(), compile(), copy_obj_in(), free_obj_in(), gen_alloc(), gen_check(), gen_domain_name(), gen_init_external(), gen_read_spec(), gen_size(), gen_tabulated_fake_object_hack(), gen_trav_leaf(), gen_trav_obj(), gen_write_tabulated(), gencode(), generate_make(), get_domain_number(), get_tabulated_from_domain(), gtt_read(), gtt_write(), init(), init_gen_quick_recurse_tables(), initialize_DirectDomainsTable(), initialize_domain_DecisionTables(), initialize_domain_DirectDomainsTable(), lookup(), make_ref(), new_binding(), print_decision_table(), print_domain(), print_domains(), quick_multi_recurse_obj_in(), quick_multi_recurse_simple_in(), read_external(), sharing_obj_in(), write_leaf_in(), and write_obj_in().
|
extern |
To manage imported domains:
Definition at line 115 of file genspec_yacc.c.
|
extern |
The root of the gen_chunk read with READ_CHUNK.
The root of the gen_chunk read with READ_CHUNK.
Definition at line 134 of file genread_yacc.c.
Referenced by gen_read(), and gen_read_tabulated().
|
extern |
extern int Current_first ;
Definition at line 60 of file genClib.c.
Referenced by gen_read_spec(), main(), new_binding(), and reconnect().
struct gen_binding* Tabulated_bp |
hack to walk thru tabulateds...
Definition at line 80 of file newgen_include.h.