xine-lib: xine-lib-1.2.12/src/post/goom/goomsl.c File Reference

xine-lib 1.2.12

Macros | Functions | Variables
goomsl.c File Reference
`#include <math.h>`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <string.h>`
`#include "goomsl.h"`
`#include "goomsl_private.h"`
`#include "goomsl_yacc.h"`

## Macros
#define | INSTR_SETI_VAR_INTEGER 1
#define | INSTR_SETI_VAR_VAR 2
#define | INSTR_SETF_VAR_FLOAT 3
#define | INSTR_SETF_VAR_VAR 4
#define | INSTR_NOP 5
#define | INSTR_SETP_VAR_PTR 7
#define | INSTR_SETP_VAR_VAR 8
#define | INSTR_SUBI_VAR_INTEGER 9
#define | INSTR_SUBI_VAR_VAR 10
#define | INSTR_SUBF_VAR_FLOAT 11
#define | INSTR_SUBF_VAR_VAR 12
#define | INSTR_ISLOWERF_VAR_VAR 13
#define | INSTR_ISLOWERF_VAR_FLOAT 14
#define | INSTR_ISLOWERI_VAR_VAR 15
#define | INSTR_ISLOWERI_VAR_INTEGER 16
#define | INSTR_ADDI_VAR_INTEGER 17
#define | INSTR_ADDI_VAR_VAR 18
#define | INSTR_ADDF_VAR_FLOAT 19
#define | INSTR_ADDF_VAR_VAR 20
#define | INSTR_MULI_VAR_INTEGER 21
#define | INSTR_MULI_VAR_VAR 22
#define | INSTR_MULF_VAR_FLOAT 23
#define | INSTR_MULF_VAR_VAR 24
#define | INSTR_DIVI_VAR_INTEGER 25
#define | INSTR_DIVI_VAR_VAR 26
#define | INSTR_DIVF_VAR_FLOAT 27
#define | INSTR_DIVF_VAR_VAR 28
#define | INSTR_ISEQUALP_VAR_VAR 30
#define | INSTR_ISEQUALP_VAR_PTR 31
#define | INSTR_ISEQUALI_VAR_VAR 32
#define | INSTR_ISEQUALI_VAR_INTEGER 33
#define | INSTR_ISEQUALF_VAR_VAR 34
#define | INSTR_ISEQUALF_VAR_FLOAT 35
#define | INSTR_NOT_VAR 39
#define | INSTR_SETS_VAR_VAR 41
#define | INSTR_ISEQUALS_VAR_VAR 42
#define | INSTR_ADDS_VAR_VAR 43
#define | INSTR_SUBS_VAR_VAR 44
#define | INSTR_MULS_VAR_VAR 45
#define | INSTR_DIVS_VAR_VAR 46
#define | VALIDATE_ERROR "error while validating "
#define | VALIDATE_TODO "todo"
#define | VALIDATE_SYNTHAX_ERROR "synthax error"
#define | VALIDATE_NO_SUCH_INT "no such integer variable"
#define | VALIDATE_NO_SUCH_VAR "no such variable"
#define | VALIDATE_NO_SUCH_DEST_VAR "no such destination variable"
#define | VALIDATE_NO_SUCH_SRC_VAR "no such src variable"
#define | pSRC_VAR instr[ip].data.usrc.var
#define | SRC_VAR_INT *instr[ip].data.usrc.var_int
#define | SRC_VAR_FLOAT *instr[ip].data.usrc.var_float
#define | SRC_VAR_PTR *instr[ip].data.usrc.var_ptr
#define | pDEST_VAR instr[ip].data.udest.var
#define | DEST_VAR_INT *instr[ip].data.udest.var_int
#define | DEST_VAR_FLOAT *instr[ip].data.udest.var_float
#define | DEST_VAR_PTR *instr[ip].data.udest.var_ptr
#define | VALUE_INT instr[ip].data.usrc.value_int
#define | VALUE_FLOAT instr[ip].data.usrc.value_float
#define | VALUE_PTR instr[ip].data.usrc.value_ptr
#define | JUMP_OFFSET instr[ip].data.udest.jump_offset
#define | SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1]
#define | DEST_STRUCT_ID instr[ip].data.udest.var_int[-1]
#define | SRC_STRUCT_IBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i]
#define | SRC_STRUCT_FBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i]
#define | DEST_STRUCT_IBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i]
#define | DEST_STRUCT_FBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i]
#define | DEST_STRUCT_IBLOCK_VAR(i, j) ((int*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j]
#define | DEST_STRUCT_FBLOCK_VAR(i, j) ((float*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j]
#define | SRC_STRUCT_IBLOCK_VAR(i, j) ((int*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j]
#define | SRC_STRUCT_FBLOCK_VAR(i, j) ((float*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j]
#define | DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size

## Functions
static void | gsl_instr_free (Instruction *_this)
static const char * | gsl_instr_validate (Instruction *_this)
static void | gsl_instr_display (Instruction *_this)
static InstructionFlow * | iflow_new (void)
static void | iflow_add_instr (InstructionFlow *_this, Instruction *instr)
static void | iflow_clean (InstructionFlow *_this)
static void | iflow_free (InstructionFlow *_this)
static void | iflow_execute (FastInstructionFlow *_this, GoomSL *gsl)
void | gsl_instr_set_namespace (Instruction *_this, GoomHash *ns)
void | gsl_instr_add_param (Instruction *instr, const char *param, int type)
Instruction * | gsl_instr_init (GoomSL *parent, const char *name, int id, int nb_param, int line_number)
static const char * | validate_v_v (Instruction *_this)
static const char * | validate_v_i (Instruction *_this)
static const char * | validate_v_p (Instruction *_this)
static const char * | validate_v_f (Instruction *_this)
static const char * | validate (Instruction *_this, int vf_f_id, int vf_v_id, int vi_i_id, int vi_v_id, int vp_p_id, int vp_v_id, int vs_v_id)
int | gsl_malloc (GoomSL *_this, int size)
void * | gsl_get_ptr (GoomSL *_this, int id)
void | gsl_free_ptr (GoomSL *_this, int id)
void | gsl_enternamespace (const char *name)
void | gsl_reenternamespace (GoomHash *nsinfo)
GoomHash * | gsl_leavenamespace (void)
GoomHash * | gsl_find_namespace (const char *name)
void | gsl_declare_task (const char *name)
void | gsl_declare_external_task (const char *name)
static void | reset_scanner (GoomSL *gss)
static void | calculate_labels (InstructionFlow *iflow)
static void | gsl_create_fast_iflow (void)
void | yy_scan_string (const char *str)
void | yyparse (void)
GoomHash * | gsl_globals (GoomSL *_this)
static void | ext_charAt (GoomSL *gsl, GoomHash *global, GoomHash *local)
static void | ext_i2f (GoomSL *gsl, GoomHash *global, GoomHash *local)
static void | ext_f2i (GoomSL *gsl, GoomHash *global, GoomHash *local)
void | gsl_compile (GoomSL *_currentGoomSL, const char *script)
void | gsl_execute (GoomSL *scanner)
GoomSL * | gsl_new (void)
void | gsl_bind_function (GoomSL *gss, const char *fname, GoomSL_ExternalFunction func)
int | gsl_is_compiled (GoomSL *gss)
void | gsl_free (GoomSL *gss)
char * | gsl_init_buffer (const char *fname)
static char * | gsl_read_file (const char *fname)
void | gsl_append_file_to_buffer (const char *fname, char **buffer)

## Variables
static const char * | VALIDATE_OK = "ok"
static int | gsl_nb_import
static char | gsl_already_imported [256][256]

## Macro Definition Documentation

## ◆ DEST_STRUCT_FBLOCK

#define DEST_STRUCT_FBLOCK | ( |  | i | ) | gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i]

## ◆ DEST_STRUCT_FBLOCK_VAR

#define DEST_STRUCT_FBLOCK_VAR | ( |  | i,
|  |  | j
| ) |  | ((float*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j]

## ◆ DEST_STRUCT_IBLOCK

#define DEST_STRUCT_IBLOCK | ( |  | i | ) | gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i]

## ◆ DEST_STRUCT_IBLOCK_VAR

#define DEST_STRUCT_IBLOCK_VAR | ( |  | i,
|  |  | j
| ) |  | ((int*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j]

## ◆ DEST_STRUCT_ID

#define DEST_STRUCT_ID instr[ip].data.udest.var_int[-1]

## ◆ DEST_STRUCT_SIZE

#define DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size

## ◆ DEST_VAR_FLOAT

#define DEST_VAR_FLOAT *instr[ip].data.udest.var_float

## ◆ DEST_VAR_INT

#define DEST_VAR_INT *instr[ip].data.udest.var_int

## ◆ DEST_VAR_PTR

#define DEST_VAR_PTR *instr[ip].data.udest.var_ptr

## ◆ INSTR_ADDF_VAR_FLOAT

#define INSTR_ADDF_VAR_FLOAT 19

## ◆ INSTR_ADDF_VAR_VAR

#define INSTR_ADDF_VAR_VAR 20

## ◆ INSTR_ADDI_VAR_INTEGER

#define INSTR_ADDI_VAR_INTEGER 17

## ◆ INSTR_ADDI_VAR_VAR

#define INSTR_ADDI_VAR_VAR 18

## ◆ INSTR_ADDS_VAR_VAR

#define INSTR_ADDS_VAR_VAR 43

## ◆ INSTR_DIVF_VAR_FLOAT

#define INSTR_DIVF_VAR_FLOAT 27

## ◆ INSTR_DIVF_VAR_VAR

#define INSTR_DIVF_VAR_VAR 28

## ◆ INSTR_DIVI_VAR_INTEGER

#define INSTR_DIVI_VAR_INTEGER 25

## ◆ INSTR_DIVI_VAR_VAR

#define INSTR_DIVI_VAR_VAR 26

## ◆ INSTR_DIVS_VAR_VAR

#define INSTR_DIVS_VAR_VAR 46

## ◆ INSTR_ISEQUALF_VAR_FLOAT

#define INSTR_ISEQUALF_VAR_FLOAT 35

## ◆ INSTR_ISEQUALF_VAR_VAR

#define INSTR_ISEQUALF_VAR_VAR 34

## ◆ INSTR_ISEQUALI_VAR_INTEGER

#define INSTR_ISEQUALI_VAR_INTEGER 33

## ◆ INSTR_ISEQUALI_VAR_VAR

#define INSTR_ISEQUALI_VAR_VAR 32

## ◆ INSTR_ISEQUALP_VAR_PTR

#define INSTR_ISEQUALP_VAR_PTR 31

## ◆ INSTR_ISEQUALP_VAR_VAR

#define INSTR_ISEQUALP_VAR_VAR 30

## ◆ INSTR_ISEQUALS_VAR_VAR

#define INSTR_ISEQUALS_VAR_VAR 42

## ◆ INSTR_ISLOWERF_VAR_FLOAT

#define INSTR_ISLOWERF_VAR_FLOAT 14

## ◆ INSTR_ISLOWERF_VAR_VAR

#define INSTR_ISLOWERF_VAR_VAR 13

## ◆ INSTR_ISLOWERI_VAR_INTEGER

#define INSTR_ISLOWERI_VAR_INTEGER 16

## ◆ INSTR_ISLOWERI_VAR_VAR

#define INSTR_ISLOWERI_VAR_VAR 15

## ◆ INSTR_MULF_VAR_FLOAT

#define INSTR_MULF_VAR_FLOAT 23

## ◆ INSTR_MULF_VAR_VAR

#define INSTR_MULF_VAR_VAR 24

## ◆ INSTR_MULI_VAR_INTEGER

#define INSTR_MULI_VAR_INTEGER 21

## ◆ INSTR_MULI_VAR_VAR

#define INSTR_MULI_VAR_VAR 22

## ◆ INSTR_MULS_VAR_VAR

#define INSTR_MULS_VAR_VAR 45

## ◆ INSTR_NOP

#define INSTR_NOP 5

## ◆ INSTR_NOT_VAR

#define INSTR_NOT_VAR 39

## ◆ INSTR_SETF_VAR_FLOAT

#define INSTR_SETF_VAR_FLOAT 3

## ◆ INSTR_SETF_VAR_VAR

#define INSTR_SETF_VAR_VAR 4

## ◆ INSTR_SETI_VAR_INTEGER

#define INSTR_SETI_VAR_INTEGER 1

## ◆ INSTR_SETI_VAR_VAR

#define INSTR_SETI_VAR_VAR 2

## ◆ INSTR_SETP_VAR_PTR

#define INSTR_SETP_VAR_PTR 7

## ◆ INSTR_SETP_VAR_VAR

#define INSTR_SETP_VAR_VAR 8

## ◆ INSTR_SETS_VAR_VAR

#define INSTR_SETS_VAR_VAR 41

## ◆ INSTR_SUBF_VAR_FLOAT

#define INSTR_SUBF_VAR_FLOAT 11

## ◆ INSTR_SUBF_VAR_VAR

#define INSTR_SUBF_VAR_VAR 12

## ◆ INSTR_SUBI_VAR_INTEGER

#define INSTR_SUBI_VAR_INTEGER 9

## ◆ INSTR_SUBI_VAR_VAR

#define INSTR_SUBI_VAR_VAR 10

## ◆ INSTR_SUBS_VAR_VAR

#define INSTR_SUBS_VAR_VAR 44

## ◆ JUMP_OFFSET

#define JUMP_OFFSET instr[ip].data.udest.jump_offset

## ◆ pDEST_VAR

#define pDEST_VAR instr[ip].data.udest.var

## ◆ pSRC_VAR

#define pSRC_VAR instr[ip].data.usrc.var

## ◆ SRC_STRUCT_FBLOCK

#define SRC_STRUCT_FBLOCK | ( |  | i | ) | gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i]

## ◆ SRC_STRUCT_FBLOCK_VAR

#define SRC_STRUCT_FBLOCK_VAR | ( |  | i,
|  |  | j
| ) |  | ((float*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j]

## ◆ SRC_STRUCT_IBLOCK

#define SRC_STRUCT_IBLOCK | ( |  | i | ) | gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i]

## ◆ SRC_STRUCT_IBLOCK_VAR

#define SRC_STRUCT_IBLOCK_VAR | ( |  | i,
|  |  | j
| ) |  | ((int*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j]

## ◆ SRC_STRUCT_ID

#define SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1]

## ◆ SRC_VAR_FLOAT

#define SRC_VAR_FLOAT *instr[ip].data.usrc.var_float

## ◆ SRC_VAR_INT

#define SRC_VAR_INT *instr[ip].data.usrc.var_int

## ◆ SRC_VAR_PTR

#define SRC_VAR_PTR *instr[ip].data.usrc.var_ptr

## ◆ VALIDATE_ERROR

#define VALIDATE_ERROR "error while validating "

## ◆ VALIDATE_NO_SUCH_DEST_VAR

#define VALIDATE_NO_SUCH_DEST_VAR "no such destination variable"

## ◆ VALIDATE_NO_SUCH_INT

#define VALIDATE_NO_SUCH_INT "no such integer variable"

## ◆ VALIDATE_NO_SUCH_SRC_VAR

#define VALIDATE_NO_SUCH_SRC_VAR "no such src variable"

## ◆ VALIDATE_NO_SUCH_VAR

#define VALIDATE_NO_SUCH_VAR "no such variable"

## ◆ VALIDATE_SYNTHAX_ERROR

#define VALIDATE_SYNTHAX_ERROR "synthax error"

## ◆ VALIDATE_TODO

#define VALIDATE_TODO "todo"

## ◆ VALUE_FLOAT

#define VALUE_FLOAT instr[ip].data.usrc.value_float

## ◆ VALUE_INT

#define VALUE_INT instr[ip].data.usrc.value_int

## ◆ VALUE_PTR

#define VALUE_PTR instr[ip].data.usrc.value_ptr

## Function Documentation

## ◆ calculate_labels()

static void calculate_labels | ( | InstructionFlow * | iflow | ) |
| static

References _INSTRUCTION::address, _INSTRUCTION::data, goom_hash_get(), HashValue::i, _INSTRUCTION::id, _INSTRUCTION_FLOW::instr, INSTR_NOP, _INSTRUCTION::jump_label, _INSTRUCTION_DATA::jump_offset, _INSTRUCTION_FLOW::labels, _INSTRUCTION::line_number, _INSTRUCTION::nop_label, and _INSTRUCTION_DATA::udest.

Referenced by gsl_compile().

## ◆ ext_charAt()

static void ext_charAt | ( | GoomSL * | gsl,
|  | GoomHash * | global,
|  | GoomHash * | local
| ) |  |
| static

Some native external functions

References GSL_GLOBAL_INT, GSL_LOCAL_INT, GSL_LOCAL_PTR, and NULL.

Referenced by gsl_compile().

## ◆ ext_f2i()

static void ext_f2i | ( | GoomSL * | gsl,
|  | GoomHash * | global,
|  | GoomHash * | local
| ) |  |
| static

References GSL_GLOBAL_INT, and GSL_LOCAL_FLOAT.

Referenced by gsl_compile().

## ◆ ext_i2f()

static void ext_i2f | ( | GoomSL * | gsl,
|  | GoomHash * | global,
|  | GoomHash * | local
| ) |  |
| static

References GSL_GLOBAL_FLOAT, and GSL_LOCAL_INT.

Referenced by gsl_compile().

## ◆ gsl_append_file_to_buffer()

void gsl_append_file_to_buffer | ( | const char * | fname,
|  | char ** | buffer
| ) |  |

References gsl_already_imported, gsl_append_file_to_buffer(), gsl_nb_import, and gsl_read_file().

Referenced by gsl_append_file_to_buffer(), and gsl_init_buffer().

## ◆ gsl_bind_function()

void gsl_bind_function | ( | GoomSL * | gss,
|  | const char * | fname,
|  | GoomSL_ExternalFunction | func
| ) |  |

References _ExternalFunctionStruct::function, _GoomSL::functions, goom_hash_get(), and HashValue::ptr.

Referenced by gsl_compile().

## ◆ gsl_compile()

void gsl_compile | ( | GoomSL * | _currentGoomSL,
|  | const char * | script
| ) |  |

References calculate_labels(), currentGoomSL, ext_charAt(), ext_f2i(), ext_i2f(), gsl_bind_function(), gsl_commit_compilation(), gsl_create_fast_iflow(), _GoomSL::iflow, _GoomSL::num_lines, _INSTRUCTION_FLOW::number, reset_scanner(), yy_scan_string(), and yyparse().

## ◆ gsl_create_fast_iflow()

static void gsl_create_fast_iflow | ( | void |  | ) |
| static

References currentGoomSL, _INSTRUCTION::data, _FAST_INSTRUCTION::data, DEST_STRUCT_FBLOCK, DEST_STRUCT_IBLOCK, DEST_STRUCT_IBLOCK_VAR, DEST_STRUCT_SIZE, _INSTRUCTION_DATA::external_function, _GoomSL::fastiflow, _INSTRUCTION::id, _FAST_INSTRUCTION::id, _GoomSL::iflow, _INSTRUCTION_FLOW::instr, _FastInstructionFlow::instr, INSTR_ADDF_VAR_FLOAT, INSTR_ADDF_VAR_VAR, INSTR_ADDI_VAR_INTEGER, INSTR_ADDI_VAR_VAR, INSTR_ADDS_VAR_VAR, INSTR_CALL, INSTR_DIVF_VAR_FLOAT, INSTR_DIVF_VAR_VAR, INSTR_DIVI_VAR_INTEGER, INSTR_DIVI_VAR_VAR, INSTR_DIVS_VAR_VAR, INSTR_EXT_CALL, INSTR_ISEQUALF_VAR_FLOAT, INSTR_ISEQUALF_VAR_VAR, INSTR_ISEQUALI_VAR_INTEGER, INSTR_ISEQUALI_VAR_VAR, INSTR_ISEQUALP_VAR_PTR, INSTR_ISEQUALP_VAR_VAR, INSTR_ISEQUALS_VAR_VAR, INSTR_ISLOWERF_VAR_FLOAT, INSTR_ISLOWERF_VAR_VAR, INSTR_ISLOWERI_VAR_INTEGER, INSTR_ISLOWERI_VAR_VAR, INSTR_JNZERO, INSTR_JUMP, INSTR_JZERO, INSTR_MULF_VAR_FLOAT, INSTR_MULF_VAR_VAR, INSTR_MULI_VAR_INTEGER, INSTR_MULI_VAR_VAR, INSTR_MULS_VAR_VAR, INSTR_NOP, INSTR_NOT_VAR, INSTR_RET, INSTR_SETF_VAR_FLOAT, INSTR_SETF_VAR_VAR, INSTR_SETI_VAR_INTEGER, INSTR_SETI_VAR_VAR, INSTR_SETP_VAR_PTR, INSTR_SETP_VAR_VAR, INSTR_SETS_VAR_VAR, INSTR_SUBF_VAR_FLOAT, INSTR_SUBF_VAR_VAR, INSTR_SUBI_VAR_INTEGER, INSTR_SUBI_VAR_VAR, INSTR_SUBS_VAR_VAR, _INSTRUCTION::jump_label, _FastInstructionFlow::mallocedInstr, _INSTRUCTION::nop_label, NULL, _INSTRUCTION_FLOW::number, _FastInstructionFlow::number, pDEST_VAR, _FAST_INSTRUCTION::proto, pSRC_VAR, SRC_STRUCT_IBLOCK_VAR, _INSTRUCTION_DATA::udest, _INSTRUCTION_DATA::usrc, _INSTRUCTION_DATA::value_float, _INSTRUCTION_DATA::value_int, _INSTRUCTION_DATA::value_ptr, _INSTRUCTION_DATA::var_float, _INSTRUCTION_DATA::var_int, _INSTRUCTION_DATA::var_ptr, _ExternalFunctionStruct::vars, and _GoomSL::vars.

Referenced by gsl_compile().

## ◆ gsl_declare_external_task()

void gsl_declare_external_task | ( | const char * | name | ) |

References currentGoomSL, _ExternalFunctionStruct::function, _GoomSL::functions, goom_hash_get(), goom_hash_new(), goom_hash_put_ptr(), _ExternalFunctionStruct::is_extern, name, _GoomSL::num_lines, and _ExternalFunctionStruct::vars.

Referenced by yyparse().

## ◆ gsl_declare_task()

void gsl_declare_task | ( | const char * | name | ) |

References currentGoomSL, _ExternalFunctionStruct::function, _GoomSL::functions, goom_hash_get(), goom_hash_new(), goom_hash_put_ptr(), _ExternalFunctionStruct::is_extern, name, and _ExternalFunctionStruct::vars.

Referenced by new_call(), and yyparse().

## ◆ gsl_enternamespace()

void gsl_enternamespace | ( | const char * | name | ) |

References currentGoomSL, _GoomSL::currentNS, function, _GoomSL::functions, goom_hash_get(), name, _GoomSL::namespaces, _GoomSL::num_lines, and HashValue::ptr.

Referenced by yyparse().

## ◆ gsl_execute()

void gsl_execute | ( | GoomSL * | scanner | ) |

References _GoomSL::compilationOK, _GoomSL::fastiflow, and iflow_execute().

## ◆ gsl_find_namespace()

GoomHash * gsl_find_namespace | ( | const char * | name | ) |

References currentGoomSL, _GoomSL::currentNS, goom_hash_get(), name, _GoomSL::namespaces, and NULL.

Referenced by new_call_expr(), and new_var().

## ◆ gsl_free()

void gsl_free | ( | GoomSL * | gss | ) |

References _GoomSL::data_heap, _GoomSL::functions, goom_hash_free(), goom_heap_delete(), _GoomSL::gsl_struct, _GoomSL::iflow, iflow_free(), _GoomSL::ptrArray, _GoomSL::structIDS, and _GoomSL::vars.

## ◆ gsl_free_ptr()

void gsl_free_ptr | ( | GoomSL * | _this,
|  | int | id
| ) |  |

References _GoomSL::ptrArray.

## ◆ gsl_get_ptr()

void * gsl_get_ptr | ( | GoomSL * | _this,
|  | int | id
| ) |  |

References NULL, and _GoomSL::ptrArray.

## ◆ gsl_globals()

GoomHash * gsl_globals | ( | GoomSL * | _this | ) |

References _GoomSL::vars.

## ◆ gsl_init_buffer()

char * gsl_init_buffer | ( | const char * | fname | ) |

References gsl_append_file_to_buffer(), and gsl_nb_import.

## ◆ gsl_instr_add_param()

void gsl_instr_add_param | ( | Instruction * | instr,
|  | const char * | param,
|  | int | type
| ) |  |

References _GoomSL::compilationOK, _INSTRUCTION::cur_param, gsl_instr_display(), gsl_instr_free(), gsl_instr_validate(), _INSTRUCTION::id, _GoomSL::iflow, iflow_add_instr(), INSTR_NOP, NULL, _GoomSL::num_lines, _INSTRUCTION::params, _INSTRUCTION::parent, type, _INSTRUCTION::types, and VALIDATE_OK.

Referenced by commit_call(), commit_ext_call(), commit_foreach(), commit_function_intro(), commit_function_outro(), commit_node(), commit_not(), GSL_PUT_JUMP(), GSL_PUT_JXXX(), and GSL_PUT_LABEL().

## ◆ gsl_instr_display()

void gsl_instr_display | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::cur_param, _INSTRUCTION::name, _INSTRUCTION::nb_param, and _INSTRUCTION::params.

Referenced by gsl_instr_add_param(), and iflow_execute().

## ◆ gsl_instr_free()

void gsl_instr_free | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::cur_param, _INSTRUCTION::params, and _INSTRUCTION::types.

Referenced by gsl_instr_add_param().

## ◆ gsl_instr_init()

Instruction * gsl_instr_init | ( | GoomSL * | parent,
|  | const char * | name,
|  | int | id,
|  | int | nb_param,
|  | int | line_number
| ) |  |

References _INSTRUCTION::cur_param, _INSTRUCTION::id, _INSTRUCTION::jump_label, _INSTRUCTION::line_number, _INSTRUCTION::name, name, _INSTRUCTION::nb_param, NULL, _INSTRUCTION::params, _INSTRUCTION::parent, _INSTRUCTION::types, and _INSTRUCTION::vnamespace.

Referenced by commit_call(), commit_div_eq(), commit_ext_call(), commit_foreach(), commit_function_intro(), commit_function_outro(), commit_mul_eq(), commit_not(), commit_plus_eq(), commit_sub_eq(), commit_test2(), GSL_PUT_JUMP(), GSL_PUT_JXXX(), GSL_PUT_LABEL(), and precommit_expr().

## ◆ gsl_instr_set_namespace()

void gsl_instr_set_namespace | ( | Instruction * | _this,
|  | GoomHash * | ns
| ) |  |

References _INSTRUCTION::cur_param, _INSTRUCTION::line_number, and _INSTRUCTION::vnamespace.

Referenced by commit_node().

## ◆ gsl_instr_validate()

const char * gsl_instr_validate | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::data, _INSTRUCTION_DATA::external_function, FIRST_RESERVED, _GoomSL::functions, goom_hash_get(), goom_hash_put_int(), gsl_type_of_var(), _INSTRUCTION::id, _GoomSL::iflow, INSTR_ADD, INSTR_ADDF_VAR_FLOAT, INSTR_ADDF_VAR_VAR, INSTR_ADDI_VAR_INTEGER, INSTR_ADDI_VAR_VAR, INSTR_ADDS_VAR_VAR, INSTR_CALL, INSTR_DIV, INSTR_DIVF_VAR_FLOAT, INSTR_DIVF_VAR_VAR, INSTR_DIVI_VAR_INTEGER, INSTR_DIVI_VAR_VAR, INSTR_DIVS_VAR_VAR, INSTR_EXT_CALL, INSTR_FLOAT, INSTR_INT, INSTR_ISEQUAL, INSTR_ISEQUALF_VAR_FLOAT, INSTR_ISEQUALF_VAR_VAR, INSTR_ISEQUALI_VAR_INTEGER, INSTR_ISEQUALI_VAR_VAR, INSTR_ISEQUALP_VAR_PTR, INSTR_ISEQUALP_VAR_VAR, INSTR_ISEQUALS_VAR_VAR, INSTR_ISLOWER, INSTR_ISLOWERF_VAR_FLOAT, INSTR_ISLOWERF_VAR_VAR, INSTR_ISLOWERI_VAR_INTEGER, INSTR_ISLOWERI_VAR_VAR, INSTR_JNZERO, INSTR_JUMP, INSTR_JZERO, INSTR_LABEL, INSTR_MUL, INSTR_MULF_VAR_FLOAT, INSTR_MULF_VAR_VAR, INSTR_MULI_VAR_INTEGER, INSTR_MULI_VAR_VAR, INSTR_MULS_VAR_VAR, INSTR_NOP, INSTR_NOT, INSTR_NOT_VAR, INSTR_PTR, INSTR_RET, INSTR_SET, INSTR_SETF_VAR_FLOAT, INSTR_SETF_VAR_VAR, INSTR_SETI_VAR_INTEGER, INSTR_SETI_VAR_VAR, INSTR_SETP_VAR_PTR, INSTR_SETP_VAR_VAR, INSTR_SETS_VAR_VAR, INSTR_SUB, INSTR_SUBF_VAR_FLOAT, INSTR_SUBF_VAR_VAR, INSTR_SUBI_VAR_INTEGER, INSTR_SUBI_VAR_VAR, INSTR_SUBS_VAR_VAR, _INSTRUCTION::jump_label, _INSTRUCTION_FLOW::labels, _INSTRUCTION::line_number, _INSTRUCTION::nb_param, _INSTRUCTION::nop_label, _INSTRUCTION_FLOW::number, _INSTRUCTION::params, _INSTRUCTION::parent, HashValue::ptr, type, TYPE_FVAR, TYPE_IVAR, TYPE_LABEL, TYPE_PVAR, TYPE_VAR, _INSTRUCTION::types, _INSTRUCTION_DATA::udest, validate(), VALIDATE_ERROR, VALIDATE_OK, VALIDATE_TODO, and _INSTRUCTION::vnamespace.

Referenced by gsl_instr_add_param().

## ◆ gsl_is_compiled()

int gsl_is_compiled | ( | GoomSL * | gss | ) |

References _GoomSL::compilationOK.

## ◆ gsl_leavenamespace()

GoomHash * gsl_leavenamespace | ( | void |  | ) |

References currentGoomSL, _GoomSL::currentNS, and _GoomSL::namespaces.

Referenced by yyparse().

## ◆ gsl_malloc()

int gsl_malloc | ( | GoomSL * | _this,
|  | int | size
| ) |  |

References _GoomSL::nbPtr, _GoomSL::ptrArray, and _GoomSL::ptrArraySize.

Referenced by yylex().

## ◆ gsl_new()

GoomSL * gsl_new | ( | void |  | ) |

References _GoomSL::compilationOK, _GoomSL::currentNS, _GoomSL::data_heap, _GoomSL::functions, goom_hash_new(), goom_heap_new(), _GoomSL::gsl_struct, _GoomSL::gsl_struct_size, _GoomSL::iflow, iflow_new(), _GoomSL::namespaces, _GoomSL::nbPtr, _GoomSL::nbStructID, NULL, _GoomSL::ptrArray, _GoomSL::ptrArraySize, reset_scanner(), _GoomSL::structIDS, and _GoomSL::vars.

## ◆ gsl_read_file()

static char * gsl_read_file | ( | const char * | fname | ) |
| static

Referenced by gsl_append_file_to_buffer().

## ◆ gsl_reenternamespace()

void gsl_reenternamespace | ( | GoomHash * | nsinfo | ) |

References currentGoomSL, _GoomSL::currentNS, and _GoomSL::namespaces.

Referenced by yyparse().

## ◆ iflow_add_instr()

void iflow_add_instr | ( | InstructionFlow * | _this,
|  | Instruction * | instr
| ) |  |
| static

References _INSTRUCTION::address, _INSTRUCTION_FLOW::instr, _INSTRUCTION_FLOW::number, and _INSTRUCTION_FLOW::tabsize.

Referenced by gsl_instr_add_param().

## ◆ iflow_clean()

void iflow_clean | ( | InstructionFlow * | _this | ) |
| static

References goom_hash_free(), goom_hash_new(), _INSTRUCTION_FLOW::labels, and _INSTRUCTION_FLOW::number.

Referenced by reset_scanner().

## ◆ iflow_execute()

void iflow_execute | ( | FastInstructionFlow * | _this,
|  | GoomSL * | gsl
| ) |  |
| static

References _FAST_INSTRUCTION::data, DEST_STRUCT_FBLOCK, DEST_STRUCT_FBLOCK_VAR, DEST_STRUCT_IBLOCK, DEST_STRUCT_IBLOCK_VAR, DEST_STRUCT_SIZE, DEST_VAR_FLOAT, DEST_VAR_INT, DEST_VAR_PTR, _INSTRUCTION_DATA::external_function, _ExternalFunctionStruct::function, gsl_instr_display(), _FastInstructionFlow::instr, INSTR_ADDF_VAR_FLOAT, INSTR_ADDF_VAR_VAR, INSTR_ADDI_VAR_INTEGER, INSTR_ADDI_VAR_VAR, INSTR_ADDS_VAR_VAR, INSTR_CALL, INSTR_DIVF_VAR_FLOAT, INSTR_DIVF_VAR_VAR, INSTR_DIVI_VAR_INTEGER, INSTR_DIVI_VAR_VAR, INSTR_DIVS_VAR_VAR, INSTR_EXT_CALL, INSTR_ISEQUALF_VAR_FLOAT, INSTR_ISEQUALF_VAR_VAR, INSTR_ISEQUALI_VAR_INTEGER, INSTR_ISEQUALI_VAR_VAR, INSTR_ISEQUALP_VAR_PTR, INSTR_ISEQUALP_VAR_VAR, INSTR_ISEQUALS_VAR_VAR, INSTR_ISLOWERF_VAR_FLOAT, INSTR_ISLOWERF_VAR_VAR, INSTR_ISLOWERI_VAR_INTEGER, INSTR_ISLOWERI_VAR_VAR, INSTR_JNZERO, INSTR_JUMP, INSTR_JZERO, INSTR_MULF_VAR_FLOAT, INSTR_MULF_VAR_VAR, INSTR_MULI_VAR_INTEGER, INSTR_MULI_VAR_VAR, INSTR_MULS_VAR_VAR, INSTR_NOP, INSTR_NOT_VAR, INSTR_RET, INSTR_SETF_VAR_FLOAT, INSTR_SETF_VAR_VAR, INSTR_SETI_VAR_INTEGER, INSTR_SETI_VAR_VAR, INSTR_SETP_VAR_PTR, INSTR_SETP_VAR_VAR, INSTR_SETS_VAR_VAR, INSTR_SUBF_VAR_FLOAT, INSTR_SUBF_VAR_VAR, INSTR_SUBI_VAR_INTEGER, INSTR_SUBI_VAR_VAR, INSTR_SUBS_VAR_VAR, JUMP_OFFSET, pDEST_VAR, pSRC_VAR, SRC_STRUCT_FBLOCK_VAR, SRC_STRUCT_IBLOCK_VAR, SRC_VAR_FLOAT, SRC_VAR_INT, SRC_VAR_PTR, _INSTRUCTION_DATA::udest, VALUE_FLOAT, VALUE_INT, VALUE_PTR, _ExternalFunctionStruct::vars, and _GoomSL::vars.

Referenced by gsl_execute().

## ◆ iflow_free()

void iflow_free | ( | InstructionFlow * | _this | ) |
| static

References goom_hash_free(), _INSTRUCTION_FLOW::instr, and _INSTRUCTION_FLOW::labels.

Referenced by gsl_free().

## ◆ iflow_new()

InstructionFlow * iflow_new | ( | void |  | ) |
| static

References goom_hash_new(), _INSTRUCTION_FLOW::instr, _INSTRUCTION_FLOW::labels, _INSTRUCTION_FLOW::number, and _INSTRUCTION_FLOW::tabsize.

Referenced by gsl_new().

## ◆ reset_scanner()

static void reset_scanner | ( | GoomSL * | gss | ) |
| static

References _GoomSL::compilationOK, _GoomSL::currentNS, _GoomSL::data_heap, _GSL_Struct::fields, goom_hash_free(), goom_hash_new(), goom_heap_delete(), goom_heap_new(), _GoomSL::gsl_struct, _GoomSL::iflow, iflow_clean(), _GoomSL::instr, _GoomSL::namespaces, _GSL_Struct::nbFields, _GoomSL::nbStructID, NULL, _GoomSL::num_lines, _GoomSL::structIDS, and _GoomSL::vars.

Referenced by gsl_compile(), and gsl_new().

## ◆ validate()

static const char * validate | ( | Instruction * | _this,
|  | int | vf_f_id,
|  | int | vf_v_id,
|  | int | vi_i_id,
|  | int | vi_v_id,
|  | int | vp_p_id,
|  | int | vp_v_id,
|  | int | vs_v_id
| ) |  |
| static

References FIRST_RESERVED, _INSTRUCTION::id, INSTR_NOP, TYPE_FLOAT, TYPE_FVAR, TYPE_INTEGER, TYPE_IVAR, TYPE_PTR, TYPE_PVAR, _INSTRUCTION::types, VALIDATE_ERROR, validate_v_f(), validate_v_i(), validate_v_p(), and validate_v_v().

Referenced by gsl_instr_validate().

## ◆ validate_v_f()

static const char * validate_v_f | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::data, goom_hash_get(), NULL, _INSTRUCTION::params, HashValue::ptr, _INSTRUCTION_DATA::udest, _INSTRUCTION_DATA::usrc, VALIDATE_NO_SUCH_VAR, VALIDATE_OK, _INSTRUCTION_DATA::value_float, _INSTRUCTION_DATA::var, and _INSTRUCTION::vnamespace.

Referenced by validate().

## ◆ validate_v_i()

static const char * validate_v_i | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::data, goom_hash_get(), NULL, _INSTRUCTION::params, HashValue::ptr, _INSTRUCTION_DATA::udest, _INSTRUCTION_DATA::usrc, VALIDATE_NO_SUCH_INT, VALIDATE_OK, _INSTRUCTION_DATA::value_int, _INSTRUCTION_DATA::var, and _INSTRUCTION::vnamespace.

Referenced by validate().

## ◆ validate_v_p()

static const char * validate_v_p | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::data, goom_hash_get(), NULL, _INSTRUCTION::params, HashValue::ptr, _INSTRUCTION_DATA::udest, _INSTRUCTION_DATA::usrc, VALIDATE_NO_SUCH_INT, VALIDATE_OK, _INSTRUCTION_DATA::value_ptr, _INSTRUCTION_DATA::var, and _INSTRUCTION::vnamespace.

Referenced by validate().

## ◆ validate_v_v()

static const char * validate_v_v | ( | Instruction * | _this | ) |
| static

References _INSTRUCTION::data, goom_hash_get(), NULL, _INSTRUCTION::params, HashValue::ptr, _INSTRUCTION_DATA::udest, _INSTRUCTION_DATA::usrc, VALIDATE_NO_SUCH_DEST_VAR, VALIDATE_NO_SUCH_SRC_VAR, VALIDATE_OK, _INSTRUCTION_DATA::var, and _INSTRUCTION::vnamespace.

Referenced by validate().

## ◆ yy_scan_string()

void yy_scan_string | ( | const char * | str | ) |

Referenced by gsl_compile().

## ◆ yyparse()

int yyparse | ( | void |  | ) |

References currentGoomSL, FLOAT_TK, gsl_add_struct(), gsl_add_struct_field(), gsl_append(), gsl_declare_external_task(), gsl_declare_global_variable(), gsl_declare_task(), gsl_enternamespace(), gsl_float_decl_local(), gsl_get_struct_id(), gsl_int_decl_local(), gsl_leavenamespace(), gsl_new_struct(), gsl_new_struct_field(), gsl_new_struct_field_struct(), gsl_ptr_decl_local(), gsl_reenternamespace(), YYSTYPE::gsl_struct, gsl_struct_decl_local(), YYSTYPE::gsl_struct_field, INSTR_FLOAT, INSTR_INT, INSTR_PTR, INT_TK, YYSTYPE::intValue, lastNode, new_add(), new_affec_list(), new_block(), new_call(), new_call_expr(), new_constFloat(), new_constInt(), new_constPtr(), new_div(), new_div_eq(), new_equ(), new_function_intro(), new_function_outro(), new_if(), new_low(), new_mul(), new_mul_eq(), new_neg(), new_not(), new_plus_eq(), new_set(), new_static_foreach(), new_sub(), new_sub_eq(), new_var(), new_var_list(), new_while(), YYSTYPE::nPtr, NULL, _GoomSL::num_lines, _OprNodeType::op, _NODE_TYPE::opr, PTR_TK, YYSTYPE::strValue, _NODE_TYPE::unode, YY_REDUCE_PRINT, YY_STACK_PRINT, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYDSYMPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYINITDEPTH, YYLAST, YYLEX, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact, YYPACT_NINF, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, yytable, YYTABLE_NINF, YYTERROR, YYTRANSLATE, and yyalloc::yyvs.

Referenced by gsl_compile().

## Variable Documentation

## ◆ gsl_already_imported

char gsl_already_imported[256][256]
| static

Referenced by gsl_append_file_to_buffer().

## ◆ gsl_nb_import

int gsl_nb_import
| static

Referenced by gsl_append_file_to_buffer(), and gsl_init_buffer().

## ◆ VALIDATE_OK

const char* VALIDATE_OK = "ok"
| static

Referenced by gsl_instr_add_param(), gsl_instr_validate(), validate_v_f(), validate_v_i(), validate_v_p(), and validate_v_v().