3 * Global (cross-module) variables.
5 * Copyright (c) ITB CompuPhase, 1997-2003
7 * This software is provided "as-is", without any express or implied warranty.
8 * In no event will the authors be held liable for any damages arising from
9 * the use of this software.
11 * Permission is granted to anyone to use this software for any purpose,
12 * including commercial applications, and to alter it and redistribute it
13 * freely, subject to the following restrictions:
15 * 1. The origin of this software must not be misrepresented; you must not
16 * claim that you wrote the original software. If you use this software in
17 * a product, an acknowledgment in the product documentation would be
18 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
21 * 3. This notice may not be removed or altered from any source distribution.
28 # include <config.h> /* for PATH_MAX */
31 #include "embryo_cc_sc.h"
35 * All global variables that are shared amongst the compiler files are
38 symbol loctab; /* local symbol table */
39 symbol glbtab; /* global symbol table */
40 cell *litq; /* the literal queue */
41 char pline[sLINEMAX + 1]; /* the line read from the input file */
42 char *lptr; /* points to the current position in "pline" */
43 constvalue tagname_tab = { NULL, "", 0, 0 }; /* tagname table */
44 constvalue libname_tab = { NULL, "", 0, 0 }; /* library table (#pragma library "..." syntax) */
45 constvalue *curlibrary = NULL; /* current library */
46 symbol *curfunc; /* pointer to current function */
47 char *inpfname; /* pointer to name of the file currently read from */
48 char outfname[PATH_MAX]; /* output file name */
49 char sc_ctrlchar = CTRL_CHAR; /* the control character (or escape character) */
50 int litidx = 0; /* index to literal table */
51 int litmax = sDEF_LITMAX; /* current size of the literal table */
52 int stgidx = 0; /* index to the staging buffer */
53 int labnum = 0; /* number of (internal) labels */
54 int staging = 0; /* true if staging output */
55 cell declared = 0; /* number of local cells declared */
56 cell glb_declared = 0; /* number of global cells declared */
57 cell code_idx = 0; /* number of bytes with generated code */
58 int ntv_funcid = 0; /* incremental number of native function */
59 int errnum = 0; /* number of errors */
60 int warnnum = 0; /* number of warnings */
61 int sc_debug = sCHKBOUNDS; /* by default: bounds checking+assertions */
62 int charbits = 8; /* a "char" is 8 bits */
63 int sc_packstr = FALSE; /* strings are packed by default? */
64 int sc_compress = TRUE; /* compress bytecode? */
65 int sc_needsemicolon = TRUE; /* semicolon required to terminate expressions? */
66 int sc_dataalign = sizeof(cell); /* data alignment value */
67 int sc_alignnext = FALSE; /* must frame of the next function be aligned? */
68 int curseg = 0; /* 1 if currently parsing CODE, 2 if parsing DATA */
69 cell sc_stksize = sDEF_AMXSTACK; /* default stack size */
70 int freading = FALSE; /* Is there an input file ready for reading? */
71 int fline = 0; /* the line number in the current file */
72 int fnumber = 0; /* the file number in the file table (debugging) */
73 int fcurrent = 0; /* current file being processed (debugging) */
74 int intest = 0; /* true if inside a test */
75 int sideeffect = 0; /* true if an expression causes a side-effect */
76 int stmtindent = 0; /* current indent of the statement */
77 int indent_nowarn = TRUE; /* skip warning "217 loose indentation" */
78 int sc_tabsize = 8; /* number of spaces that a TAB represents */
79 int sc_allowtags = TRUE; /* allow/detect tagnames in lex() */
80 int sc_status; /* read/write status */
81 int sc_rationaltag = 0; /* tag for rational numbers */
82 int rational_digits = 0; /* number of fractional digits */
84 FILE *inpf = NULL; /* file read from (source or include) */
85 FILE *inpf_org = NULL; /* main source file */
86 FILE *outf = NULL; /* file written to */