pike.git / src / las.h

version» Context lines:

pike.git/src/las.h:2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      #ifndef LAS_H   #define LAS_H      #include "global.h"   #include "svalue.h" - #include "dynamic_buffer.h" + #include "buffer.h"   #include "block_allocator.h"      #define MAX_GLOBAL_VARIABLES 1000   typedef void (*c_fun)(INT32);         /* Flags used by yytype_error() */   #define YYTE_IS_WARNING 1      struct compiler_frame; /* Avoid gcc warning. */      int islocal(struct pike_string *str);   int low_add_local_name(struct compiler_frame *frame,    struct pike_string *str,    struct pike_type *type,    node *def);   int add_local_name(struct pike_string *str,    struct pike_type *type,    node *def);   int verify_declared(struct pike_string *str); - void cleanup_compiler(void); +          extern int cumulative_parse_error;         #ifndef STRUCT_NODE_S_DECLARED   #define STRUCT_NODE_S_DECLARED   struct node_s;   typedef struct node_s node;   #endif      /* local variable flags */   #define LOCAL_VAR_IS_USED 1    -  + /* var used in subscope -- needs to be saved when function returns */ + #define LOCAL_VAR_USED_IN_SCOPE 2 +    struct local_variable   {    struct pike_string *name;    struct pike_type *type;    node *def;    /* FIXME: Consider moving these two to the def node above? */    struct pike_string *file;    int line;    unsigned int flags;   };    -  + /* Keeps track of local variables and similar for the current function. */   struct compiler_frame   {    struct compiler_frame *previous;       struct pike_type *current_type;    struct pike_type *current_return_type;    int current_number_of_locals;    int max_number_of_locals;    int min_number_of_locals;    int last_block_level; /* used to detect variables declared in same block */
pike.git/src/las.h:80:   {    struct    {    int number;    struct program *prog;    } id;    struct    {    int ident;    struct compiler_frame *frame; - #ifdef SHARED_NODES +     struct program *prog; - #endif +     } trampoline;    struct svalue sval;    struct    {    struct node_s *a, *b;    } node;    struct    {    struct node_identifier *a, *b;    } node_id;    struct    {    int a, b;    } integer;   };    -  + #ifdef PIKE_DEBUG + #include "opcodes.h" + #endif +    struct node_s   {    unsigned INT32 refs;    struct pike_string *current_file;    struct pike_type *type;    struct pike_string *name;    struct node_s *parent;    INT_TYPE line_number;    unsigned INT16 node_info;    unsigned INT16 tree_info;    unsigned INT16 pad;    /* The stuff from this point on is hashed. */ -  + #ifdef PIKE_DEBUG +  enum Pike_opcodes token : 16; + #else    unsigned INT16 token; -  + #endif    union node_data u;   };    - #define OPT_OPTIMIZED 0x1 /* has been processed by optimize(), -  * only used in node_info -  */ - #define OPT_NOT_CONST 0x2 /* isn't constant */ - #define OPT_SIDE_EFFECT 0x4 /* has side effects */ - #define OPT_ASSIGNMENT 0x8 /* does assignments */ - #define OPT_TRY_OPTIMIZE 0x10 /* might be worth optimizing */ - #define OPT_EXTERNAL_DEPEND 0x20 /* the value depends on external -  * influences (such as read_file or so) -  */ - #define OPT_CASE 0x40 /* contains case(s) */ - #define OPT_CONTINUE 0x80 /* contains continue(s) */ - #define OPT_BREAK 0x100 /* contains break(s) */ - #define OPT_RETURN 0x200 /* contains return(s) */ - #define OPT_TYPE_NOT_FIXED 0x400 /* type-field might be wrong */ - #define OPT_WEAK_TYPE 0x800 /* don't warn even if strict types */ - #define OPT_APPLY 0x1000 /* contains apply */ - #define OPT_FLAG_NODE 0x2000 /* don't optimize away unless the -  * parent also is optimized away */ - #define OPT_SAFE 0x4000 /* Known to not throw error (which normally -  * isn't counted as side effect). Only used -  * in tree_info. */ -  -  - /* This is a statement which got custom break/continue label handling. -  * Set in compiler_frame. Beware: This is not a node flag! -Hubbe */ - #define OPT_CUSTOM_LABELS 0x10000 -  +    #define SCOPE_LOCAL 1   #define SCOPE_SCOPED 2   #define SCOPE_SCOPE_USED 4      void count_memory_in_node_ss(size_t *num, size_t *size);      /* Prototypes begin here */   int car_is_node(node *n);   int cdr_is_node(node *n);   void check_tree(node *n, int depth);
pike.git/src/las.h:205:   node **is_call_to(node *n, c_fun f);   void print_tree(node *n);   struct used_vars;   void fix_type_field(node *n);   struct timer_oflo;   ptrdiff_t eval_low(node *n,int print_error);   int dooptcode(struct pike_string *name,    node *n,    struct pike_type *type,    int modifiers); - void resolv_program(node *n); + void resolv_type(node *n); + void fix_foreach_type(node *lval_lval);   /* Prototypes end here */      /* Handling of nodes */   #define free_node(n) debug_free_node(dmalloc_touch(node *,n))      #define mknode(token, a, b) dmalloc_touch(node *, debug_mknode(token, dmalloc_touch(node *, a), dmalloc_touch(node *, b)))   #define mkstrnode(str) dmalloc_touch(node *, debug_mkstrnode(str))   #define mkintnode(nr) dmalloc_touch(node *, debug_mkintnode(nr))   #define mknewintnode(nr) dmalloc_touch(node *, debug_mknewintnode(nr))   #define mkfloatnode(foo) dmalloc_touch(node *, debug_mkfloatnode(foo))
pike.git/src/las.h:251:         /* lvalue variants of CAR(n) & CDR(n) */   #define _CAR(n) (dmalloc_touch(node *,(n))->u.node.a)   #define _CDR(n) (dmalloc_touch(node *,(n))->u.node.b)   #define _CAAR(n) _CAR(_CAR(n))   #define _CADR(n) _CAR(_CDR(n))   #define _CDAR(n) _CDR(_CAR(n))   #define _CDDR(n) _CDR(_CDR(n))    - #ifdef SHARED_NODES +    #define ADD_NODE_REF(n) do { if (n) add_ref(n); } while(0)   #define ADD_NODE_REF2(n, code) do { ADD_NODE_REF(n); code; } while(0) - #else /* !SHARED_NODES */ - #define ADD_NODE_REF(n) (n = 0) - #define ADD_NODE_REF2(n, code) do { code; n = 0;} while(0) - #endif /* SHARED_NODES */ +       #define CAR(n) _CAR(n)   #define CDR(n) _CDR(n)   #define CAAR(n) CAR(CAR(n))   #define CADR(n) CAR(CDR(n))   #define CDAR(n) CDR(CAR(n))   #define CDDR(n) CDR(CDR(n))   #define CAAAR(n) CAR(CAR(CAR(n)))   #define CAADR(n) CAR(CAR(CDR(n)))   #define CADAR(n) CAR(CDR(CAR(n)))
pike.git/src/las.h:388:   #define CDDDAADR(n) CDR(CDR(CDR(CAR(CAR(CDR(n))))))   #define CDDDADAR(n) CDR(CDR(CDR(CAR(CDR(CAR(n))))))   #define CDDDADDR(n) CDR(CDR(CDR(CAR(CDR(CDR(n))))))   #define CDDDDAAR(n) CDR(CDR(CDR(CDR(CAR(CAR(n))))))   #define CDDDDADR(n) CDR(CDR(CDR(CDR(CAR(CDR(n))))))   #define CDDDDDAR(n) CDR(CDR(CDR(CDR(CDR(CAR(n))))))   #define CDDDDDDR(n) CDR(CDR(CDR(CDR(CDR(CDR(n))))))      #define GAUGE_RUSAGE_INDEX 0    - #define add_to_mem_block(N,Data,Size) low_my_binary_strcat(Data,Size,areas+N) + #define add_to_mem_block(N,Data,Size) buffer_memcpy(areas+N, Data,Size)   #define IDENTIFIERP(i) (Pike_compiler->new_program->identifier_references+(i))   #define INHERIT(i) (Pike_compiler->new_program->inherits+(i))   #define PIKE_PC (Pike_compiler->new_program->num_program)      #ifndef PIKE_DEBUG   #define check_tree(X,Y)   #endif      #endif