xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
goomsl_yacc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "goomsl.h"
#include "goomsl_private.h"

Data Structures

union  YYSTYPE
 
union  yyalloc
 

Macros

#define YYBISON   1
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYPURE   0
 
#define YYLSP_NEEDED   0
 
#define YYTOKENTYPE
 
#define LTYPE_INTEGER   258
 
#define LTYPE_FLOAT   259
 
#define LTYPE_VAR   260
 
#define LTYPE_PTR   261
 
#define PTR_TK   262
 
#define INT_TK   263
 
#define FLOAT_TK   264
 
#define DECLARE   265
 
#define EXTERNAL   266
 
#define WHILE   267
 
#define DO   268
 
#define NOT   269
 
#define PLUS_EQ   270
 
#define SUB_EQ   271
 
#define DIV_EQ   272
 
#define MUL_EQ   273
 
#define SUP_EQ   274
 
#define LOW_EQ   275
 
#define NOT_EQ   276
 
#define STRUCT   277
 
#define FOR   278
 
#define IN   279
 
#define STRUCT_ALIGNMENT   16
 
#define ALIGN_ADDR(_addr, _align)
 
#define YYDEBUG   0
 
#define YYERROR_VERBOSE   0
 
#define yystype   YYSTYPE /* obsolescent; will be withdrawn */
 
#define YYSTYPE_IS_DECLARED   1
 
#define YYSTYPE_IS_TRIVIAL   1
 
#define YYSTACK_ALLOC   malloc
 
#define YYSTACK_FREE   free
 
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 
#define YYSTACK_BYTES(N)
 
#define YYCOPY(To, From, Count)
 
#define YYSTACK_RELOCATE(Stack)
 
#define YYFINAL   3
 
#define YYLAST   229
 
#define YYNTOKENS   42
 
#define YYNNTS   30
 
#define YYNRULES   89
 
#define YYNSTATES   217
 
#define YYUNDEFTOK   2
 
#define YYMAXUTOK   279
 
#define YYTRANSLATE(YYX)    ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYPACT_NINF   -116
 
#define YYTABLE_NINF   -1
 
#define YYSIZE_T   unsigned int
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYEMPTY   (-2)
 
#define YYEOF   0
 
#define YYACCEPT   goto yyacceptlab
 
#define YYABORT   goto yyabortlab
 
#define YYERROR   goto yyerrlab1
 
#define YYFAIL   goto yyerrlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYBACKUP(Token, Value)
 
#define YYTERROR   1
 
#define YYERRCODE   256
 
#define YYLLOC_DEFAULT(Current, Rhs, N)
 
#define YYLEX   yylex ()
 
#define YYDPRINTF(Args)
 
#define YYDSYMPRINT(Args)
 
#define YYDSYMPRINTF(Title, Token, Value, Location)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YYINITDEPTH   200
 
#define YYMAXDEPTH   10000
 
#define YYPOPSTACK   (yyvsp--, yyssp--)
 

Typedefs

typedef union YYSTYPE YYSTYPE
 
typedef short yysigned_char
 

Enumerations

enum  yytokentype {
  LTYPE_INTEGER = 258 , LTYPE_FLOAT = 259 , LTYPE_VAR = 260 , LTYPE_PTR = 261 ,
  PTR_TK = 262 , INT_TK = 263 , FLOAT_TK = 264 , DECLARE = 265 ,
  EXTERNAL = 266 , WHILE = 267 , DO = 268 , NOT = 269 ,
  PLUS_EQ = 270 , SUB_EQ = 271 , DIV_EQ = 272 , MUL_EQ = 273 ,
  SUP_EQ = 274 , LOW_EQ = 275 , NOT_EQ = 276 , STRUCT = 277 ,
  FOR = 278 , IN = 279
}
 

Functions

int yylex (void)
 
void yyerror (const char *)
 
static NodeTypenodeNew (const char *str, int type, int line_number)
 
static NodeTypenodeClone (NodeType *node)
 
static void nodeFreeInternals (NodeType *node)
 
static void nodeFree (NodeType *node)
 
static void commit_node (NodeType *node, int releaseIfTemp)
 
static void precommit_node (NodeType *node)
 
static NodeTypenew_constInt (const char *str, int line_number)
 
static NodeTypenew_constFloat (const char *str, int line_number)
 
static NodeTypenew_constPtr (const char *str, int line_number)
 
static NodeTypenew_var (const char *str, int line_number)
 
static NodeTypenew_nop (const char *str)
 
static NodeTypenew_op (const char *str, int type, int nbOp)
 
static int allocateLabel (void)
 
static int allocateTemp (void)
 
static void releaseTemp (int n)
 
static void releaseAllTemps (void)
 
static int is_tmp_expr (NodeType *node)
 
static int get_tmp_id (NodeType *node)
 
static int is_commutative_expr (int itype)
 
static void GSL_PUT_LABEL (char *name, int line_number)
 
static void GSL_PUT_JUMP (char *name, int line_number)
 
static void GSL_PUT_JXXX (const char *name, const char *iname, int instr_id, int line_number)
 
static void GSL_PUT_JZERO (const char *name, int line_number)
 
static void GSL_PUT_JNZERO (const char *name, int line_number)
 
static void gsl_prepare_struct (GSL_Struct *s, int s_align, int i_align, int f_align)
 
static int gsl_get_struct_id (const char *name)
 
static void gsl_add_struct (const char *name, GSL_Struct *gsl_struct)
 
static GSL_StructFieldgsl_new_struct_field (const char *name, int type)
 
static GSL_StructFieldgsl_new_struct_field_struct (const char *name, const char *type)
 
static GSL_Structgsl_new_struct (GSL_StructField *field)
 
static void gsl_add_struct_field (GSL_Struct *s, GSL_StructField *field)
 
int gsl_type_of_var (GoomHash *ns, const char *name)
 
static void gsl_declare_var (GoomHash *ns, const char *name, int type, void *space)
 
static void gsl_struct_decl (GoomHash *namespace, const char *struct_name, const char *name)
 
static void gsl_float_decl_global (const char *name)
 
static void gsl_int_decl_global (const char *name)
 
static void gsl_ptr_decl_global (const char *name)
 
static void gsl_struct_decl_global_from_id (const char *name, int id)
 
static void gsl_float_decl_local (const char *name)
 
static void gsl_int_decl_local (const char *name)
 
static void gsl_ptr_decl_local (const char *name)
 
static void gsl_struct_decl_local (const char *struct_name, const char *name)
 
static void commit_test2 (NodeType *set, const char *type, int instr)
 
static NodeTypenew_call (const char *name, NodeType *affect_list)
 
static NodeTypenew_set (NodeType *lvalue, NodeType *expression)
 
static void commit_set (NodeType *set)
 
static NodeTypenew_plus_eq (NodeType *lvalue, NodeType *expression)
 
static void commit_plus_eq (NodeType *set)
 
static NodeTypenew_sub_eq (NodeType *lvalue, NodeType *expression)
 
static void commit_sub_eq (NodeType *set)
 
static NodeTypenew_mul_eq (NodeType *lvalue, NodeType *expression)
 
static void commit_mul_eq (NodeType *set)
 
static NodeTypenew_div_eq (NodeType *lvalue, NodeType *expression)
 
static void commit_div_eq (NodeType *set)
 
static void precommit_expr (NodeType *expr, const char *type, int instr_id)
 
static NodeTypenew_expr1 (const char *name, int id, NodeType *expr1)
 
static NodeTypenew_expr2 (const char *name, int id, NodeType *expr1, NodeType *expr2)
 
static NodeTypenew_add (NodeType *expr1, NodeType *expr2)
 
static void precommit_add (NodeType *add)
 
static NodeTypenew_sub (NodeType *expr1, NodeType *expr2)
 
static void precommit_sub (NodeType *sub)
 
static NodeTypenew_neg (NodeType *expr)
 
static NodeTypenew_mul (NodeType *expr1, NodeType *expr2)
 
static void precommit_mul (NodeType *mul)
 
static NodeTypenew_div (NodeType *expr1, NodeType *expr2)
 
static void precommit_div (NodeType *mul)
 
static NodeTypenew_call_expr (const char *name, NodeType *affect_list)
 
static void precommit_call_expr (NodeType *call)
 
static NodeTypenew_not (NodeType *expr1)
 
static void commit_not (NodeType *set)
 
static NodeTypenew_equ (NodeType *expr1, NodeType *expr2)
 
static void commit_equ (NodeType *mul)
 
static NodeTypenew_low (NodeType *expr1, NodeType *expr2)
 
static void commit_low (NodeType *mul)
 
static NodeTypenew_while (NodeType *expression, NodeType *instr)
 
static void commit_while (NodeType *node)
 
static NodeTypenew_static_foreach (NodeType *var, NodeType *var_list, NodeType *instr)
 
static void commit_foreach (NodeType *node)
 
static NodeTypenew_if (NodeType *expression, NodeType *instr)
 
static void commit_if (NodeType *node)
 
static NodeTypenew_block (NodeType *lastNode)
 
static void commit_block (NodeType *node)
 
static NodeTypenew_function_intro (const char *name)
 
static void commit_function_intro (NodeType *node)
 
static NodeTypenew_function_outro ()
 
static void commit_function_outro (NodeType *node)
 
static NodeTypenew_affec_list (NodeType *set, NodeType *next)
 
static NodeTypenew_affect_list_after (NodeType *affect_list)
 
static void commit_affect_list (NodeType *node)
 
static NodeTypenew_var_list (NodeType *var, NodeType *next)
 
static void commit_var_list (NodeType *node)
 
static void commit_ext_call (NodeType *node)
 
static void commit_call (NodeType *node)
 
static NodeTypegsl_append (NodeType *curNode)
 
void gsl_commit_compilation ()
 
static void gsl_declare_global_variable (int type, char *name)
 
static void yydestruct (int yytype, YYSTYPE *yyvaluep)
 
int yyparse ()
 

Variables

GoomSLcurrentGoomSL
 
static NodeTyperootNode = 0
 
static NodeTypelastNode = 0
 
static int lastLabel = 0
 
static const unsigned char yytranslate []
 
static const unsigned char yyr1 []
 
static const unsigned char yyr2 []
 
static const unsigned char yydefact []
 
static const short yydefgoto []
 
static const short yypact []
 
static const yysigned_char yypgoto []
 
static const unsigned char yytable []
 
static const short yycheck []
 
static const unsigned char yystos []
 
int yychar
 
YYSTYPE yylval
 
int yynerrs
 

Macro Definition Documentation

◆ ALIGN_ADDR

#define ALIGN_ADDR ( _addr,
_align )
Value:
{\
if (_align>1) {\
int _dec = (_addr%_align);\
if (_dec != 0) _addr += _align - _dec;\
}}

Referenced by gsl_prepare_struct().

◆ DECLARE

#define DECLARE   265

Referenced by yylex().

◆ DIV_EQ

#define DIV_EQ   272

Referenced by yylex().

◆ DO

#define DO   268

Referenced by yylex().

◆ EXTERNAL

#define EXTERNAL   266

Referenced by yylex().

◆ FLOAT_TK

#define FLOAT_TK   264

◆ FOR

#define FOR   278

Referenced by yylex().

◆ IN

#define IN   279

Referenced by yylex().

◆ INT_TK

#define INT_TK   263

◆ LOW_EQ

#define LOW_EQ   275

Referenced by yylex().

◆ LTYPE_FLOAT

#define LTYPE_FLOAT   259

Referenced by yylex().

◆ LTYPE_INTEGER

#define LTYPE_INTEGER   258

Referenced by yylex().

◆ LTYPE_PTR

#define LTYPE_PTR   261

Referenced by yylex().

◆ LTYPE_VAR

#define LTYPE_VAR   260

Referenced by yylex().

◆ MUL_EQ

#define MUL_EQ   273

Referenced by yylex().

◆ NOT

#define NOT   269

Referenced by yylex().

◆ NOT_EQ

#define NOT_EQ   276

Referenced by yylex().

◆ PLUS_EQ

#define PLUS_EQ   270

Referenced by yylex().

◆ PTR_TK

#define PTR_TK   262

◆ STRUCT

#define STRUCT   277

Referenced by yylex().

◆ STRUCT_ALIGNMENT

#define STRUCT_ALIGNMENT   16

Referenced by gsl_add_struct(), and gsl_declare_var().

◆ SUB_EQ

#define SUB_EQ   271

Referenced by yylex().

◆ SUP_EQ

#define SUP_EQ   274

Referenced by yylex().

◆ WHILE

#define WHILE   267

Referenced by yylex().

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT ( Rule)

Referenced by yyparse().

◆ YY_STACK_PRINT

#define YY_STACK_PRINT ( Bottom,
Top )

Referenced by yyparse().

◆ YYABORT

#define YYABORT   goto yyabortlab

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Referenced by yyparse().

◆ YYBACKUP

#define YYBACKUP ( Token,
Value )
Value:
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up");\
} \
while (0)
YYSTYPE yylval
Definition goomsl_yacc.c:2118
int yychar
Definition goomsl_yacc.c:2115
#define YYTRANSLATE(YYX)
Definition goomsl_yacc.c:1452
#define YYPOPSTACK
#define YYEMPTY
Definition goomsl_yacc.c:1800
#define YYERROR
Definition goomsl_yacc.c:1805

◆ YYBISON

#define YYBISON   1

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

◆ YYCOPY

#define YYCOPY ( To,
From,
Count )
Value:
do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
#define YYSIZE_T
Definition goomsl_yacc.c:1795

◆ YYDEBUG

#define YYDEBUG   0

◆ YYDPRINTF

#define YYDPRINTF ( Args)

Referenced by yyparse().

◆ YYDSYMPRINT

#define YYDSYMPRINT ( Args)

◆ YYDSYMPRINTF

#define YYDSYMPRINTF ( Title,
Token,
Value,
Location )

Referenced by yyparse().

◆ YYEMPTY

#define YYEMPTY   (-2)

Referenced by yyparse().

◆ YYEOF

#define YYEOF   0

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   256

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

◆ YYERROR

#define YYERROR   goto yyerrlab1

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE   0

◆ YYFAIL

#define YYFAIL   goto yyerrlab

◆ YYFINAL

#define YYFINAL   3

Referenced by yyparse().

◆ YYINITDEPTH

#define YYINITDEPTH   200

Referenced by yyparse().

◆ YYLAST

#define YYLAST   229

Referenced by yyparse().

◆ YYLEX

#define YYLEX   yylex ()

Referenced by yyparse().

◆ YYLLOC_DEFAULT

#define YYLLOC_DEFAULT ( Current,
Rhs,
N )
Value:
Current.first_line = Rhs[1].first_line; \
Current.first_column = Rhs[1].first_column; \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;

◆ YYLSP_NEEDED

#define YYLSP_NEEDED   0

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   279

◆ YYNNTS

#define YYNNTS   30

◆ YYNRULES

#define YYNRULES   89

◆ YYNSTATES

#define YYNSTATES   217

◆ YYNTOKENS

#define YYNTOKENS   42

Referenced by yyparse().

◆ YYPACT_NINF

#define YYPACT_NINF   -116

Referenced by yyparse().

◆ YYPOPSTACK

#define YYPOPSTACK   (yyvsp--, yyssp--)

◆ YYPURE

#define YYPURE   0

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

◆ YYSIZE_T

#define YYSIZE_T   unsigned int

Referenced by yyparse().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   malloc

Referenced by yyparse().

◆ YYSTACK_BYTES

#define YYSTACK_BYTES ( N)
Value:
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
union YYSTYPE YYSTYPE
#define YYSTACK_GAP_MAXIMUM
Definition goomsl_yacc.c:1384

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   free

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE ( Stack)
Value:
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)

Referenced by yyparse().

◆ yystype

#define yystype   YYSTYPE /* obsolescent; will be withdrawn */

◆ YYSTYPE_IS_DECLARED

#define YYSTYPE_IS_DECLARED   1

◆ YYSTYPE_IS_TRIVIAL

#define YYSTYPE_IS_TRIVIAL   1

◆ YYTABLE_NINF

#define YYTABLE_NINF   -1

Referenced by yyparse().

◆ YYTERROR

#define YYTERROR   1

Referenced by yyparse().

◆ YYTOKENTYPE

#define YYTOKENTYPE

◆ YYTRANSLATE

#define YYTRANSLATE ( YYX)     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Referenced by yyparse().

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

Typedef Documentation

◆ yysigned_char

typedef short yysigned_char

◆ YYSTYPE

typedef union YYSTYPE YYSTYPE

Enumeration Type Documentation

◆ yytokentype

Enumerator
LTYPE_INTEGER 
LTYPE_FLOAT 
LTYPE_VAR 
LTYPE_PTR 
PTR_TK 
INT_TK 
FLOAT_TK 
DECLARE 
EXTERNAL 
WHILE 
DO 
NOT 
PLUS_EQ 
SUB_EQ 
DIV_EQ 
MUL_EQ 
SUP_EQ 
LOW_EQ 
NOT_EQ 
STRUCT 
FOR 
IN 

Function Documentation

◆ allocateLabel()

int allocateLabel ( void )
static

◆ allocateTemp()

int allocateTemp ( void )
static

◆ commit_affect_list()

static void commit_affect_list ( NodeType * node)
static

◆ commit_block()

static void commit_block ( NodeType * node)
static

◆ commit_call()

static void commit_call ( NodeType * node)
static

◆ commit_div_eq()

static void commit_div_eq ( NodeType * set)
static

◆ commit_equ()

static void commit_equ ( NodeType * mul)
static

References commit_test2(), and INSTR_ISEQUAL.

Referenced by commit_node().

◆ commit_ext_call()

static void commit_ext_call ( NodeType * node)
static

◆ commit_foreach()

static void commit_foreach ( NodeType * node)
static

◆ commit_function_intro()

static void commit_function_intro ( NodeType * node)
static

◆ commit_function_outro()

static void commit_function_outro ( NodeType * node)
static

◆ commit_if()

static void commit_if ( NodeType * node)
static

◆ commit_low()

static void commit_low ( NodeType * mul)
static

References commit_test2(), and INSTR_ISLOWER.

Referenced by commit_node().

◆ commit_mul_eq()

static void commit_mul_eq ( NodeType * set)
static

◆ commit_node()

void commit_node ( NodeType * node,
int releaseIfTemp )
static

◆ commit_not()

static void commit_not ( NodeType * set)
static

◆ commit_plus_eq()

static void commit_plus_eq ( NodeType * set)
static

◆ commit_set()

static void commit_set ( NodeType * set)
static

References commit_test2(), and INSTR_SET.

Referenced by commit_node().

◆ commit_sub_eq()

static void commit_sub_eq ( NodeType * set)
static

◆ commit_test2()

static void commit_test2 ( NodeType * set,
const char * type,
int instr )
static

◆ commit_var_list()

static void commit_var_list ( NodeType * node)
static

Referenced by commit_node().

◆ commit_while()

static void commit_while ( NodeType * node)
static

◆ get_tmp_id()

static int get_tmp_id ( NodeType * node)
static

References _NODE_TYPE::str.

Referenced by commit_node().

◆ gsl_add_struct()

static void gsl_add_struct ( const char * name,
GSL_Struct * gsl_struct )
static

◆ gsl_add_struct_field()

static void gsl_add_struct_field ( GSL_Struct * s,
GSL_StructField * field )
static

References field, _GSL_Struct::fields, and _GSL_Struct::nbFields.

Referenced by yyparse().

◆ gsl_append()

static NodeType * gsl_append ( NodeType * curNode)
static

◆ gsl_commit_compilation()

void gsl_commit_compilation ( void )

References commit_node(), lastNode, and rootNode.

Referenced by gsl_compile().

◆ gsl_declare_global_variable()

static void gsl_declare_global_variable ( int type,
char * name )
static

◆ gsl_declare_var()

static void gsl_declare_var ( GoomHash * ns,
const char * name,
int type,
void * space )
static

◆ gsl_float_decl_global()

static void gsl_float_decl_global ( const char * name)
static

◆ gsl_float_decl_local()

static void gsl_float_decl_local ( const char * name)
static

◆ gsl_get_struct_id()

static int gsl_get_struct_id ( const char * name)
static

◆ gsl_int_decl_global()

static void gsl_int_decl_global ( const char * name)
static

◆ gsl_int_decl_local()

static void gsl_int_decl_local ( const char * name)
static

◆ gsl_new_struct()

static GSL_Struct * gsl_new_struct ( GSL_StructField * field)
static

References field, _GSL_Struct::fields, and _GSL_Struct::nbFields.

Referenced by yyparse().

◆ gsl_new_struct_field()

static GSL_StructField * gsl_new_struct_field ( const char * name,
int type )
static

References field, name, and type.

Referenced by gsl_new_struct_field_struct(), and yyparse().

◆ gsl_new_struct_field_struct()

static GSL_StructField * gsl_new_struct_field_struct ( const char * name,
const char * type )
static

◆ gsl_prepare_struct()

static void gsl_prepare_struct ( GSL_Struct * s,
int s_align,
int i_align,
int f_align )
static

◆ gsl_ptr_decl_global()

static void gsl_ptr_decl_global ( const char * name)
static

◆ gsl_ptr_decl_local()

static void gsl_ptr_decl_local ( const char * name)
static

◆ GSL_PUT_JNZERO()

static void GSL_PUT_JNZERO ( const char * name,
int line_number )
static

References GSL_PUT_JXXX(), INSTR_JNZERO, and name.

Referenced by commit_while().

◆ GSL_PUT_JUMP()

static void GSL_PUT_JUMP ( char * name,
int line_number )
static

◆ GSL_PUT_JXXX()

static void GSL_PUT_JXXX ( const char * name,
const char * iname,
int instr_id,
int line_number )
static

◆ GSL_PUT_JZERO()

static void GSL_PUT_JZERO ( const char * name,
int line_number )
static

References GSL_PUT_JXXX(), INSTR_JZERO, and name.

Referenced by commit_if().

◆ GSL_PUT_LABEL()

static void GSL_PUT_LABEL ( char * name,
int line_number )
static

◆ gsl_struct_decl()

static void gsl_struct_decl ( GoomHash * namespace,
const char * struct_name,
const char * name )
static

◆ gsl_struct_decl_global_from_id()

static void gsl_struct_decl_global_from_id ( const char * name,
int id )
static

◆ gsl_struct_decl_local()

static void gsl_struct_decl_local ( const char * struct_name,
const char * name )
static

◆ gsl_type_of_var()

int gsl_type_of_var ( GoomHash * ns,
const char * name )

◆ is_commutative_expr()

static int is_commutative_expr ( int itype)
static

References INSTR_ADD, INSTR_ISEQUAL, and INSTR_MUL.

Referenced by precommit_expr().

◆ is_tmp_expr()

static int is_tmp_expr ( NodeType * node)
static

References _NODE_TYPE::str.

Referenced by commit_node(), and precommit_expr().

◆ new_add()

static NodeType * new_add ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_ADD.

Referenced by yyparse().

◆ new_affec_list()

static NodeType * new_affec_list ( NodeType * set,
NodeType * next )
static

◆ new_affect_list_after()

static NodeType * new_affect_list_after ( NodeType * affect_list)
static

◆ new_block()

static NodeType * new_block ( NodeType * lastNode)
static

◆ new_call()

static NodeType * new_call ( const char * name,
NodeType * affect_list )
static

◆ new_call_expr()

static NodeType * new_call_expr ( const char * name,
NodeType * affect_list )
static

◆ new_constFloat()

NodeType * new_constFloat ( const char * str,
int line_number )
static

◆ new_constInt()

NodeType * new_constInt ( const char * str,
int line_number )
static

◆ new_constPtr()

NodeType * new_constPtr ( const char * str,
int line_number )
static

◆ new_div()

static NodeType * new_div ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_DIV.

Referenced by yyparse().

◆ new_div_eq()

static NodeType * new_div_eq ( NodeType * lvalue,
NodeType * expression )
static

◆ new_equ()

static NodeType * new_equ ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_EQU.

Referenced by yyparse().

◆ new_expr1()

static NodeType * new_expr1 ( const char * name,
int id,
NodeType * expr1 )
static

◆ new_expr2()

static NodeType * new_expr2 ( const char * name,
int id,
NodeType * expr1,
NodeType * expr2 )
static

◆ new_function_intro()

static NodeType * new_function_intro ( const char * name)
static

References name, new_op(), and OPR_FUNC_INTRO.

Referenced by yyparse().

◆ new_function_outro()

static NodeType * new_function_outro ( )
static

References new_op(), and OPR_FUNC_OUTRO.

Referenced by yyparse().

◆ new_if()

static NodeType * new_if ( NodeType * expression,
NodeType * instr )
static

◆ new_low()

static NodeType * new_low ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_LOW.

Referenced by yyparse().

◆ new_mul()

static NodeType * new_mul ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_MUL.

Referenced by yyparse().

◆ new_mul_eq()

static NodeType * new_mul_eq ( NodeType * lvalue,
NodeType * expression )
static

◆ new_neg()

static NodeType * new_neg ( NodeType * expr)
static

◆ new_nop()

NodeType * new_nop ( const char * str)
static

References EMPTY_NODE, and new_op().

Referenced by new_block().

◆ new_not()

static NodeType * new_not ( NodeType * expr1)
static

References new_expr1(), and OPR_NOT.

Referenced by yyparse().

◆ new_op()

NodeType * new_op ( const char * str,
int type,
int nbOp )
static

◆ new_plus_eq()

static NodeType * new_plus_eq ( NodeType * lvalue,
NodeType * expression )
static

◆ new_set()

static NodeType * new_set ( NodeType * lvalue,
NodeType * expression )
static

◆ new_static_foreach()

static NodeType * new_static_foreach ( NodeType * var,
NodeType * var_list,
NodeType * instr )
static

◆ new_sub()

static NodeType * new_sub ( NodeType * expr1,
NodeType * expr2 )
static

References new_expr2(), and OPR_SUB.

Referenced by yyparse().

◆ new_sub_eq()

static NodeType * new_sub_eq ( NodeType * lvalue,
NodeType * expression )
static

◆ new_var()

NodeType * new_var ( const char * str,
int line_number )
static

◆ new_var_list()

static NodeType * new_var_list ( NodeType * var,
NodeType * next )
static

◆ new_while()

static NodeType * new_while ( NodeType * expression,
NodeType * instr )
static

◆ nodeClone()

static NodeType * nodeClone ( NodeType * node)
static

◆ nodeFree()

void nodeFree ( NodeType * node)
static

References nodeFreeInternals().

Referenced by commit_foreach(), and commit_node().

◆ nodeFreeInternals()

void nodeFreeInternals ( NodeType * node)
static

◆ nodeNew()

NodeType * nodeNew ( const char * str,
int type,
int line_number )
static

◆ precommit_add()

static void precommit_add ( NodeType * add)
static

References INSTR_ADD, and precommit_expr().

Referenced by precommit_node().

◆ precommit_call_expr()

static void precommit_call_expr ( NodeType * call)
static

◆ precommit_div()

static void precommit_div ( NodeType * mul)
static

References INSTR_DIV, and precommit_expr().

Referenced by precommit_node().

◆ precommit_expr()

static void precommit_expr ( NodeType * expr,
const char * type,
int instr_id )
static

◆ precommit_mul()

static void precommit_mul ( NodeType * mul)
static

References INSTR_MUL, and precommit_expr().

Referenced by precommit_node().

◆ precommit_node()

void precommit_node ( NodeType * node)
static

◆ precommit_sub()

static void precommit_sub ( NodeType * sub)
static

References INSTR_SUB, and precommit_expr().

Referenced by precommit_node().

◆ releaseAllTemps()

void releaseAllTemps ( void )
static

Referenced by commit_function_outro().

◆ releaseTemp()

void releaseTemp ( int n)
static

Referenced by commit_node().

◆ yydestruct()

static void yydestruct ( int yytype,
YYSTYPE * yyvaluep )
static

Referenced by yyparse().

◆ yyerror()

void yyerror ( const char * str)

◆ yylex()

int yylex ( void )

◆ 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

◆ currentGoomSL

GoomSL* currentGoomSL
extern

◆ lastLabel

int lastLabel = 0
static

Referenced by allocateLabel().

◆ lastNode

NodeType* lastNode = 0
static

◆ rootNode

NodeType* rootNode = 0
static

◆ yychar

int yychar

Referenced by yyparse().

◆ yycheck

const short yycheck[]
static
Initial value:
=
{
74, 16, 5, 107, 3, 4, 5, 6, 14, 33,
26, 27, 28, 29, 30, 14, 108, 41, 106, 34,
108, 95, 90, 122, 123, 41, 42, 126, 43, 91,
33, 30, 100, 148, 40, 97, 35, 25, 153, 154,
0, 40, 28, 59, 5, 33, 28, 33, 110, 65,
66, 67, 34, 31, 32, 129, 130, 161, 132, 75,
76, 77, 78, 79, 80, 81, 82, 83, 84, 173,
162, 5, 176, 5, 162, 3, 4, 5, 6, 28,
28, 180, 174, 98, 33, 33, 174, 5, 27, 7,
8, 9, 27, 5, 168, 7, 8, 9, 10, 11,
12, 175, 30, 177, 27, 209, 5, 35, 5, 25,
22, 23, 40, 25, 5, 131, 25, 191, 15, 16,
17, 18, 25, 35, 26, 26, 38, 39, 40, 26,
26, 29, 30, 31, 32, 5, 210, 211, 36, 26,
25, 5, 158, 7, 8, 9, 10, 11, 12, 5,
5, 7, 8, 9, 36, 24, 12, 33, 22, 23,
5, 25, 7, 8, 9, 27, 5, 23, 7, 8,
9, 35, 33, 13, 38, 35, 40, 25, 37, 35,
26, 25, 38, 33, 40, 19, 20, 21, 29, 30,
31, 32, 26, 27, 28, 29, 30, 31, 32, 41,
5, 13, 25, 41, 5, 5, 5, 5, 28, 34,
25, 28, 41, 5, 36, 25, 25, 25, 5, 5,
5, 25, 28, 25, 135, 202, 151, -1, 25, 25
}

Referenced by yyparse().

◆ yydefact

const unsigned char yydefact[]
static
Initial value:
=
{
10, 0, 32, 1, 19, 0, 0, 0, 0, 0,
0, 0, 0, 9, 0, 0, 0, 8, 0, 28,
0, 38, 3, 0, 48, 42, 0, 0, 0, 0,
0, 41, 40, 39, 0, 0, 76, 75, 59, 77,
0, 0, 0, 0, 0, 89, 60, 67, 0, 0,
0, 58, 19, 0, 33, 0, 2, 44, 43, 0,
49, 50, 52, 51, 57, 0, 0, 0, 0, 18,
0, 74, 65, 0, 33, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 88, 0, 0, 0, 0,
10, 0, 0, 78, 0, 33, 0, 85, 0, 27,
10, 37, 36, 35, 34, 20, 0, 20, 0, 66,
0, 0, 71, 72, 73, 68, 69, 70, 63, 64,
62, 61, 89, 89, 0, 0, 89, 0, 0, 33,
33, 0, 33, 84, 0, 32, 0, 0, 0, 0,
0, 0, 0, 25, 0, 0, 0, 82, 0, 0,
0, 55, 0, 0, 0, 0, 0, 80, 0, 87,
79, 20, 0, 29, 24, 23, 21, 22, 33, 42,
41, 40, 39, 20, 0, 33, 20, 33, 46, 0,
89, 0, 0, 0, 0, 12, 56, 54, 53, 45,
47, 33, 86, 0, 0, 6, 0, 26, 4, 0,
83, 11, 0, 17, 16, 14, 15, 81, 30, 20,
33, 33, 13, 0, 7, 5, 31
}

Referenced by yyparse().

◆ yydefgoto

const short yydefgoto[]
static
Initial value:
=
{
-1, 1, 2, 17, 149, 185, 70, 18, 137, 142,
56, 99, 100, 19, 93, 20, 21, 22, 125, 152,
23, 90, 44, 45, 46, 24, 47, 96, 97, 86
}

Referenced by yyparse().

◆ yylval

YYSTYPE yylval

Referenced by yylex(), and yyparse().

◆ yynerrs

int yynerrs

Referenced by yyparse().

◆ yypact

const short yypact[]
static
Initial value:
=
{
-116, 40, 136, -116, 103, 39, 66, 68, 61, 65,
1, 77, 101, -116, 1, 84, 109, -116, 12, -116,
91, -116, -116, 97, -116, 98, 72, 72, 72, 72,
72, 99, 104, 113, 109, 130, -116, -116, -116, -116,
1, 72, 72, 109, 166, 115, -116, -116, 145, 131,
118, -116, -116, -24, -116, -3, 138, -116, -116, 72,
159, 159, 159, 159, 159, 72, 72, 72, 14, -116,
51, -116, 22, 102, 124, 72, 72, 72, 72, 72,
72, 72, 72, 72, 72, -116, 160, 139, 140, 141,
-116, -3, 152, -116, 154, -116, 156, -3, 109, -116,
-116, 159, 159, 159, 159, 150, 82, 150, 82, -116,
-3, 158, 159, 159, 159, 159, 159, 159, 22, 22,
-116, -116, 115, 115, 195, 188, 115, 88, 162, -116,
-116, 72, -116, -116, 52, 136, 155, 177, 199, 200,
201, 202, 180, 175, 185, 183, 171, -116, 144, 18,
161, 195, 178, 144, 144, 190, 191, -116, 72, 159,
-116, 150, 82, -116, -116, -116, -116, -116, -116, -116,
-116, -116, -116, 150, 82, -116, 150, -116, -116, 192,
115, 208, 213, 214, 215, -116, -116, -116, -116, -116,
-116, -116, 159, 196, 194, -116, 198, -116, -116, 203,
-116, -116, 161, -116, -116, -116, -116, -116, -116, 150,
-116, -116, -116, 204, -116, -116, -116
}

Referenced by yyparse().

◆ yypgoto

const yysigned_char yypgoto[]
static
Initial value:
=
{
-116, -116, -68, -116, -116, 23, -116, -15, -104, -92,
-116, -116, -116, 89, -74, -116, -88, -115, -116, 75,
-116, -116, -16, -6, -116, -116, -116, -62, -116, -99
}

Referenced by yyparse().

◆ yyr1

const unsigned char yyr1[]
static
Initial value:
=
{
0, 42, 43, 44, 44, 44, 44, 44, 44, 44,
44, 45, 46, 46, 47, 47, 47, 47, 48, 49,
50, 50, 50, 50, 50, 51, 51, 52, 52, 53,
54, 54, 55, 56, 57, 57, 57, 57, 57, 58,
58, 58, 58, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 60, 61, 61, 62, 63, 64,
64, 64, 64, 64, 64, 64, 64, 64, 65, 65,
65, 65, 65, 65, 65, 66, 66, 66, 67, 67,
67, 67, 68, 68, 69, 69, 70, 70, 71, 71
}

Referenced by yyparse().

◆ yyr2

const unsigned char yyr2[]
static
Initial value:
=
{
0, 2, 3, 2, 8, 10, 8, 10, 2, 2,
0, 7, 2, 4, 2, 2, 2, 2, 1, 1,
0, 2, 2, 2, 2, 1, 3, 2, 0, 3,
5, 7, 0, 0, 4, 4, 4, 4, 1, 2,
2, 2, 2, 2, 2, 6, 6, 6, 1, 3,
3, 3, 3, 6, 3, 1, 2, 3, 0, 1,
1, 3, 3, 3, 3, 2, 3, 1, 3, 3,
3, 3, 3, 3, 2, 1, 1, 1, 3, 5,
5, 7, 4, 6, 2, 1, 4, 3, 1, 0
}

Referenced by yyparse().

◆ yystos

const unsigned char yystos[]
static
Initial value:
=
{
0, 43, 44, 0, 5, 7, 8, 9, 10, 11,
12, 22, 23, 25, 35, 38, 40, 45, 49, 55,
57, 58, 59, 62, 67, 5, 15, 16, 17, 18,
26, 5, 5, 5, 27, 27, 3, 4, 5, 6,
14, 30, 35, 40, 64, 65, 66, 68, 27, 5,
65, 25, 5, 49, 25, 33, 52, 25, 25, 26,
64, 64, 64, 64, 64, 26, 26, 26, 49, 5,
48, 65, 64, 64, 49, 19, 20, 21, 26, 27,
28, 29, 30, 31, 32, 25, 71, 5, 24, 36,
63, 33, 41, 56, 5, 33, 69, 70, 27, 53,
54, 64, 64, 64, 64, 28, 33, 28, 33, 36,
33, 56, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 13, 33, 35, 60, 37, 44, 69, 25,
26, 56, 25, 69, 49, 44, 33, 50, 5, 7,
8, 9, 51, 58, 50, 51, 69, 41, 71, 46,
71, 5, 61, 13, 71, 39, 41, 56, 56, 64,
56, 28, 33, 55, 5, 7, 8, 9, 25, 5,
5, 5, 5, 28, 34, 25, 28, 41, 59, 28,
34, 5, 7, 8, 9, 47, 61, 36, 59, 59,
25, 25, 64, 50, 51, 56, 50, 51, 56, 50,
56, 25, 71, 5, 5, 5, 5, 56, 25, 28,
25, 25, 47, 50, 56, 56, 25
}

Referenced by yyparse().

◆ yytable

const unsigned char yytable[]
static
Initial value:
=
{
111, 53, 94, 144, 36, 37, 38, 39, 50, 91,
60, 61, 62, 63, 64, 40, 145, 92, 143, 68,
143, 131, 127, 148, 150, 72, 73, 154, 74, 128,
95, 41, 135, 178, 71, 133, 42, 54, 188, 189,
3, 43, 105, 101, 31, 55, 179, 106, 146, 102,
103, 104, 180, 83, 84, 157, 158, 193, 160, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 196,
194, 32, 199, 33, 143, 36, 37, 38, 39, 107,
161, 202, 197, 134, 108, 162, 143, 138, 34, 139,
140, 141, 35, 4, 195, 5, 6, 7, 8, 9,
10, 198, 41, 200, 48, 213, 49, 42, 25, 51,
11, 12, 43, 13, 52, 159, 57, 207, 26, 27,
28, 29, 58, 14, 59, 65, 15, 155, 16, 30,
66, 81, 82, 83, 84, 69, 214, 215, 109, 67,
85, 4, 192, 5, 6, 7, 8, 9, 10, 4,
87, 5, 6, 7, 89, 88, 10, 110, 11, 12,
164, 13, 165, 166, 167, 98, 181, 12, 182, 183,
184, 14, 123, 122, 15, 124, 16, 129, 126, 14,
130, 132, 15, 136, 16, 75, 76, 77, 81, 82,
83, 84, 78, 79, 80, 81, 82, 83, 84, 147,
151, 153, 168, 156, 169, 170, 171, 172, 173, 174,
175, 176, 177, 203, 187, 190, 191, 201, 204, 205,
206, 208, 209, 210, 163, 212, 186, 0, 211, 216
}

Referenced by yyparse().

◆ yytranslate

const unsigned char yytranslate[]
static