sourcepawn/compiler/scvars.c
branchrefac-jit
changeset 2284 026da5437111
parent 2192 7602d7fb60d9
child 2288 15c77b21589a
     1.1 --- a/sourcepawn/compiler/scvars.c	Fri Jul 11 06:51:21 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,113 +0,0 @@
     1.4 -/*  Pawn compiler
     1.5 - *
     1.6 - *  Global (cross-module) variables.
     1.7 - *
     1.8 - *  Copyright (c) ITB CompuPhase, 1997-2006
     1.9 - *
    1.10 - *  This software is provided "as-is", without any express or implied warranty.
    1.11 - *  In no event will the authors be held liable for any damages arising from
    1.12 - *  the use of this software.
    1.13 - *
    1.14 - *  Permission is granted to anyone to use this software for any purpose,
    1.15 - *  including commercial applications, and to alter it and redistribute it
    1.16 - *  freely, subject to the following restrictions:
    1.17 - *
    1.18 - *  1.  The origin of this software must not be misrepresented; you must not
    1.19 - *      claim that you wrote the original software. If you use this software in
    1.20 - *      a product, an acknowledgment in the product documentation would be
    1.21 - *      appreciated but is not required.
    1.22 - *  2.  Altered source versions must be plainly marked as such, and must not be
    1.23 - *      misrepresented as being the original software.
    1.24 - *  3.  This notice may not be removed or altered from any source distribution.
    1.25 - *
    1.26 - *  Version: $Id$
    1.27 - */
    1.28 -#include <stdio.h>
    1.29 -#include <stdlib.h>     /* for _MAX_PATH */
    1.30 -#include "sc.h"
    1.31 -
    1.32 -/*  global variables
    1.33 - *
    1.34 - *  All global variables that are shared amongst the compiler files are
    1.35 - *  declared here.
    1.36 - */
    1.37 -SC_VDEFINE symbol loctab;                   /* local symbol table */
    1.38 -SC_VDEFINE symbol glbtab;                   /* global symbol table */
    1.39 -SC_VDEFINE cell *litq;                      /* the literal queue */
    1.40 -SC_VDEFINE unsigned char pline[sLINEMAX+1]; /* the line read from the input file */
    1.41 -SC_VDEFINE const unsigned char *lptr;       /* points to the current position in "pline" */
    1.42 -SC_VDEFINE constvalue tagname_tab = { NULL, "", 0, 0};  /* tagname table */
    1.43 -SC_VDEFINE constvalue libname_tab = { NULL, "", 0, 0};  /* library table (#pragma library "..." syntax) */
    1.44 -SC_VDEFINE constvalue *curlibrary = NULL;   /* current library */
    1.45 -SC_VDEFINE int pc_addlibtable = TRUE;       /* is the library table added to the AMX file? */
    1.46 -SC_VDEFINE symbol *curfunc;                 /* pointer to current function */
    1.47 -SC_VDEFINE char *inpfname;                  /* pointer to name of the file currently read from */
    1.48 -SC_VDEFINE char outfname[_MAX_PATH];        /* intermediate (assembler) file name */
    1.49 -SC_VDEFINE char binfname[_MAX_PATH];        /* binary file name */
    1.50 -SC_VDEFINE char errfname[_MAX_PATH];        /* error file name */
    1.51 -SC_VDEFINE char sc_ctrlchar = CTRL_CHAR;    /* the control character (or escape character)*/
    1.52 -SC_VDEFINE char sc_ctrlchar_org = CTRL_CHAR;/* the default control character */
    1.53 -SC_VDEFINE int litidx    = 0;               /* index to literal table */
    1.54 -SC_VDEFINE int litmax    = sDEF_LITMAX;     /* current size of the literal table */
    1.55 -SC_VDEFINE int stgidx    = 0;      /* index to the staging buffer */
    1.56 -SC_VDEFINE int sc_labnum = 0;      /* number of (internal) labels */
    1.57 -SC_VDEFINE int staging   = 0;      /* true if staging output */
    1.58 -SC_VDEFINE cell declared = 0;      /* number of local cells declared */
    1.59 -SC_VDEFINE cell glb_declared=0;    /* number of global cells declared */
    1.60 -SC_VDEFINE cell code_idx = 0;      /* number of bytes with generated code */
    1.61 -SC_VDEFINE int ntv_funcid= 0;      /* incremental number of native function */
    1.62 -SC_VDEFINE int errnum    = 0;      /* number of errors */
    1.63 -SC_VDEFINE int warnnum   = 0;      /* number of warnings */
    1.64 -SC_VDEFINE int sc_debug  = sCHKBOUNDS; /* by default: bounds checking+assertions */
    1.65 -SC_VDEFINE int sc_packstr= FALSE;  /* strings are packed by default? */
    1.66 -SC_VDEFINE int sc_asmfile= FALSE;  /* create .ASM file? */
    1.67 -SC_VDEFINE int sc_listing= FALSE;  /* create .LST file? */
    1.68 -SC_VDEFINE int sc_compress=TRUE;   /* compress bytecode? */
    1.69 -SC_VDEFINE int sc_needsemicolon=TRUE;/* semicolon required to terminate expressions? */
    1.70 -SC_VDEFINE int sc_dataalign=sizeof(cell);/* data alignment value */
    1.71 -SC_VDEFINE int sc_alignnext=FALSE; /* must frame of the next function be aligned? */
    1.72 -SC_VDEFINE int pc_docexpr=FALSE;   /* must expression be attached to documentation comment? */
    1.73 -SC_VDEFINE int curseg    = 0;      /* 1 if currently parsing CODE, 2 if parsing DATA */
    1.74 -SC_VDEFINE cell pc_stksize=sDEF_AMXSTACK;/* default stack size */
    1.75 -SC_VDEFINE cell pc_amxlimit=0;     /* default abstract machine size limit = none */
    1.76 -SC_VDEFINE cell pc_amxram=0;       /* default abstract machine data size limit = none */
    1.77 -SC_VDEFINE int freading  = FALSE;  /* Is there an input file ready for reading? */
    1.78 -SC_VDEFINE int fline     = 0;      /* the line number in the current file */
    1.79 -SC_VDEFINE short fnumber = 0;      /* the file number in the file table (debugging) */
    1.80 -SC_VDEFINE short fcurrent= 0;      /* current file being processed (debugging) */
    1.81 -SC_VDEFINE short sc_intest=FALSE;  /* true if inside a test */
    1.82 -SC_VDEFINE int sideeffect= 0;      /* true if an expression causes a side-effect */
    1.83 -SC_VDEFINE int stmtindent= 0;      /* current indent of the statement */
    1.84 -SC_VDEFINE int indent_nowarn=FALSE;/* skip warning "217 loose indentation" */
    1.85 -SC_VDEFINE int sc_tabsize=8;       /* number of spaces that a TAB represents */
    1.86 -SC_VDEFINE short sc_allowtags=TRUE;  /* allow/detect tagnames in lex() */
    1.87 -SC_VDEFINE int sc_status;          /* read/write status */
    1.88 -SC_VDEFINE int sc_rationaltag=0;   /* tag for rational numbers */
    1.89 -SC_VDEFINE int rational_digits=0;  /* number of fractional digits */
    1.90 -SC_VDEFINE int sc_allowproccall=0; /* allow/detect tagnames in lex() */
    1.91 -SC_VDEFINE short sc_is_utf8=FALSE; /* is this source file in UTF-8 encoding */
    1.92 -SC_VDEFINE char *pc_deprecate=NULL;/* if non-null, mark next declaration as deprecated */
    1.93 -SC_VDEFINE int sc_curstates=0;     /* ID of the current state list */
    1.94 -SC_VDEFINE int pc_optimize=sOPTIMIZE_NOMACRO; /* (peephole) optimization level */
    1.95 -SC_VDEFINE int pc_memflags=0;      /* special flags for the stack/heap usage */
    1.96 -
    1.97 -SC_VDEFINE constvalue sc_automaton_tab = { NULL, "", 0, 0}; /* automaton table */
    1.98 -SC_VDEFINE constvalue sc_state_tab = { NULL, "", 0, 0};   /* state table */
    1.99 -
   1.100 -SC_VDEFINE FILE *inpf    = NULL;   /* file read from (source or include) */
   1.101 -SC_VDEFINE FILE *inpf_org= NULL;   /* main source file */
   1.102 -SC_VDEFINE FILE *outf    = NULL;   /* (intermediate) text file written to */
   1.103 -
   1.104 -SC_VDEFINE jmp_buf errbuf;
   1.105 -
   1.106 -#if !defined SC_LIGHT
   1.107 -  SC_VDEFINE int sc_makereport=FALSE; /* generate a cross-reference report */
   1.108 -#endif
   1.109 -
   1.110 -#if defined __WATCOMC__ && !defined NDEBUG
   1.111 -  /* Watcom's CVPACK dislikes .OBJ files without functions */
   1.112 -  static int dummyfunc(void)
   1.113 -  {
   1.114 -    return 0;
   1.115 -  }
   1.116 -#endif