pike.git / src / pike_compiler.h

version» Context lines:

pike.git/src/pike_compiler.h:3:   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      #ifndef PIKE_COMPILER_H   #define PIKE_COMPILER_H      #include "lex.h"   #include "program.h"    + /* #define SUPPORT_COMPILER_HANDLERS */ +    extern struct program *reporter_program;   extern struct program *compilation_env_program;   extern struct program *compilation_program;   extern struct object *compilation_environment; -  + extern struct program *Annotation_program; + extern struct object *Inherited_annotation;      typedef int supporter_callback (void *, int);      struct Supporter   {   #ifdef PIKE_DEBUG    int magic;   #endif       struct Supporter *previous;
pike.git/src/pike_compiler.h:35:    * that this one depends on. When it gets unlinked from that list,    * this becomes a back pointer for the dependants linked list    * below. */       struct Supporter *dependants, *next_dependant;    /* dependants points to a linked list of supporters that depends on    * this one, and next_dependant makes up the links between those    * supporters. A supporter is linked onto this list when it is    * unlinked from the current_supporter list. */    -  struct object *self; +  struct svalue self; +  /* CompilerEnvironment object for this supporter. +  * NB: NOT reference counted! +  * NB: Subtyped to the CompilerEnvironment inherit. +  */ +     supporter_callback *fun;    void *data;       struct program *prog;    /* The top level program in the compilation unit. */   };    -  + /** +  * This is the storage for CompilationEnvironment.PikeCompiler. +  * +  * There is one of these for each translation unit being compiled. +  */   struct compilation   {    struct Supporter supporter;    struct pike_string *prog; /* String to compile. */ -  + #ifdef SUPPORT_COMPILER_HANDLERS    struct object *handler; /* error_handler */    struct object *compat_handler; /* compat_handler */ -  + #endif /* SUPPORT_COMPILER_HANDLERS */    int major, minor; /* Base compat version */    struct program *target; /* Program being compiled. */    struct object *placeholder;    int flags;       struct program *p; /* Compiled program or NULL. */    struct lex lex; -  int compilation_inherit; /* Inherit in supporter->self containing -  * compilation_program. */ +        struct svalue default_module; /* predef:: */    struct byte_buffer used_modules; /* Stack of svalues with imported    * modules. */    INT32 num_used_modules; /* Number of entries on the stack. */       int compilation_depth; /* Current class nesting depth. */      #ifdef PIKE_THREADS    int saved_lock_depth;   #endif    struct mapping *resolve_cache;   };    -  + /* +  * The next level is struct program_state, which are held in +  * a linked list stack rooted in the Pike_compiler variable. +  * There is one such struct for each class being compiled, +  * with the current class being in Pike_compiler. +  * +  * Cf compilation.h for its definition. +  */ +  + /* +  * The next level is struct compiler_frame, which are held in +  * a linked list stack rooted in the field of the same name in +  * struct program_state. They keep track of state for the +  * current function. +  * +  * Cf las.h for its definition. +  */ +    #ifdef PIKE_DEBUG   #define CHECK_COMPILER() do { \    if (!Pike_fp || !compilation_program || \    Pike_fp->context->prog != compilation_program) { \    Pike_fatal("Invalid compilation context!\n"); \    } \    } while(0)   #else   #define CHECK_COMPILER()   #endif
pike.git/src/pike_compiler.h:168:    INT32 args, const char *fmt, ...);   void yytype_error(const char *msg, struct pike_type *expected_t,    struct pike_type *got_t, unsigned int flags);   struct pike_string *format_exception_for_error_msg (struct svalue *thrown);   void handle_compile_exception (const char *yyerror_fmt, ...);   void push_compiler_frame(int lexical_scope);   node *low_pop_local_variables(int level, node *block);   node *pop_local_variables(int level, node *block);   void pop_compiler_frame(void);   PMOD_EXPORT void change_compiler_compatibility(int major, int minor); + PMOD_EXPORT struct program *Annotation_program; + PMOD_EXPORT struct program *Implements_program; + PMOD_EXPORT struct object *Inherited_annotation; + void low_init_pike_compiler(void);   void init_pike_compiler(void);   void cleanup_pike_compiler(void); -  + void low_cleanup_pike_compiler(void);   /* Prototypes end here */      #endif /* !PIKE_COMPILER_H */