pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || 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. - || $Id: program.c,v 1.667 2008/04/18 19:56:01 grubba Exp $ + || $Id: program.c,v 1.668 2008/04/19 10:11:20 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:7102:    verify_supporters();    return ret;   }         /*! @class CompilerEnviroment    *!    *! The compiler environment.    */    + /*! @decl enum SeverityLevel +  *! Message severity level. +  *! { NOTICE, WARNING, ERROR, FATAL } +  *! +  *! @constant NOTICE +  *! @constant WARNING +  *! @constant ERROR +  *! @constant FATAL +  *! +  *! @seealso +  *! @[report()] +  */ +    /*! @decl void report(SeverityLevel severity, @    *! string filename, int linenumber, @    *! string subsystem, @    *! string message, mixed ... extra_args)    *!    *! Report a diagnostic from the compiler. -  +  *! +  *! @seealso +  *! @[PikeCompiler()->report()]    */   static void f_compilation_env_report(INT32 args)   {    int level;    struct pike_string *filename;    INT_TYPE linenumber;    struct pike_string *subsystem;    struct pike_string *message;    if (args > 5) {    f_sprintf(args - 4);
pike.git/src/program.c:7647:    }       CDFPRINTF((stderr, "th(%ld) %p delayed compile %s.\n",    (long) th_self(), cc->target, ok ? "done" : "failed"));       verify_supporters();       return ok;   }    - /*! @class PikeCompiler -  *! -  *! The Pike compiler. -  */ -  +    static void compilation_event_handler(int e)   {    struct compilation *c = THIS_COMPILATION;       switch (e) {    case PROG_EVENT_INIT:    CDFPRINTF((stderr, "th(%ld) compilation: INIT(%p).\n",    (long) th_self(), c));    MEMSET(c, 0, sizeof(*c));    c->supporter.self = Pike_fp->current_object; /* NOTE: Not ref-counted! */
pike.git/src/program.c:8090: Inside #if defined(PIKE_DEBUG)
   if ((Pike_fp->current_program != compilation_program) ||    (Pike_fp->fun != PC_COMPILE_FUN_NUM)) {    Pike_fatal("exit_compiler(): Frame stack out of whack!\n");    }   #endif /* PIKE_DEBUG */    POP_PIKE_FRAME();   }      /*! @class CompilerState    *! +  *! Keeps the state of a single program/class during compilation. +  *!    *! @note    *! Not in use yet!    */      #define THIS_PROGRAM_STATE ((struct program_state *)(Pike_fp->current_storage))      static void program_state_event_handler(int event)   {   #if 0    struct program_state *c = THIS_PROGRAM_STATE;
pike.git/src/program.c:8278:    * Remove the one we added above, so that we don't get it double.    */    p2->xstorage = 0;       end_class("PikeCompiler", 0);    /* end_class()/end_program() has zapped the inherit once again,    * so we need to repair the frame pointer.    */    Pike_fp->context = compilation_program->inherits;    +  { +  struct pike_string *type_name; +  struct svalue type_value; +  +  /* enum SeverityLevel { NOTICE, WARNING, ERROR, FATAL } */ +  type_value.type = PIKE_T_TYPE; +  type_value.subtype = 0; +  type_value.u.type = CONSTTYPE(tName("SeverityLevel", tInt03)); +  simple_add_constant("SeverityLevel", &type_value, 0); +  free_svalue(&type_value); +  +  add_integer_constant("NOTICE", REPORT_NOTICE, 0); +  add_integer_constant("WARNING", REPORT_WARNING, 0); +  add_integer_constant("ERROR", REPORT_ERROR, 0); +  add_integer_constant("FATAL", REPORT_FATAL, 0); +  } +     compilation_env_program = end_program();       add_global_program("CompilerEnvironment", compilation_env_program);       exit_compiler();       ref_push_object(compilation_environment);    low_add_constant("DefaultCompilerEnvironment", Pike_sp-1);    pop_stack();   }