2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
compile.h
|
|
|
|
|
|
|
|
Compiler initialization, reserved keywords table and subroutines table.
|
|
|
|
|
|
|
|
(c) 2000-2007 Benoit Minisini <gambas@users.sourceforge.net>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2008-08-14 21:42:27 +02:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-12-30 17:41:49 +01:00
|
|
|
the Free Software Foundation; either version 1, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2008-08-14 21:42:27 +02:00
|
|
|
GNU General Public License for more details.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-08-14 21:42:27 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
2007-12-30 17:41:49 +01:00
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _COMPILE_H
|
|
|
|
#define _COMPILE_H
|
|
|
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
#include "gb_array.h"
|
|
|
|
#include "gb_buffer.h"
|
|
|
|
#include "gb_table.h"
|
|
|
|
#include "gb_alloc.h"
|
|
|
|
|
|
|
|
#include "gb_limit.h"
|
|
|
|
#include "gb_reserved.h"
|
|
|
|
#include "gbc_read.h"
|
|
|
|
|
|
|
|
#include "gbc_class.h"
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
2009-01-04 19:55:25 +01:00
|
|
|
char *name; /* source file name */
|
2008-01-06 19:49:23 +01:00
|
|
|
int line; /* current line number */
|
2007-12-30 17:41:49 +01:00
|
|
|
char *source; /* source file contents */
|
|
|
|
unsigned verbose : 1; /* verbose compilation */
|
|
|
|
unsigned debug : 1; /* if debugging information must be generated */
|
|
|
|
unsigned trans : 1; /* if translation files must be generated */
|
|
|
|
unsigned is_module : 1; /* if the source file is a module */
|
|
|
|
unsigned is_form : 1; /* if the source is a class form */
|
|
|
|
unsigned declared : 1; /* ? */
|
|
|
|
unsigned nobreak : 1; /* no breakpoint */
|
|
|
|
unsigned exported : 1; /* there are some exported class */
|
|
|
|
unsigned all : 1; /* compile everything */
|
|
|
|
unsigned swap : 1; /* endianness must be swapped */
|
2009-05-01 18:27:45 +02:00
|
|
|
unsigned public_module : 1; /* modules symbols are public by default */
|
2007-12-30 17:41:49 +01:00
|
|
|
unsigned _reserved : 22; /* reserved*/
|
2009-01-04 19:55:25 +01:00
|
|
|
char *output; /* output file */
|
2008-05-11 20:07:16 +02:00
|
|
|
PATTERN *pattern; /* lexical analyze */
|
2008-01-06 19:49:23 +01:00
|
|
|
int pattern_count; /* number of patterns */
|
2007-12-30 17:41:49 +01:00
|
|
|
PATTERN *current; /* position de traduction courante */
|
|
|
|
PATTERN *end; /* fin de traduction */
|
|
|
|
FUNCTION *func; /* fonction en cours de compilation */
|
|
|
|
CLASS *class; /* classe en cours de compilation */
|
2009-01-04 19:55:25 +01:00
|
|
|
char *form; /* nom du fichier formulaire */
|
|
|
|
char *tname; /* nom du fichier *.pot */
|
2008-01-06 19:49:23 +01:00
|
|
|
int default_library; /* default library name for extern declarations */
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
COMPILE;
|
|
|
|
|
|
|
|
#ifndef __GBC_COMPILE_C
|
|
|
|
|
|
|
|
EXTERN COMPILE COMP_current;
|
|
|
|
EXTERN char *COMP_root;
|
|
|
|
EXTERN char *COMP_project;
|
|
|
|
EXTERN char *COMP_info_path;
|
|
|
|
EXTERN char *COMP_classes;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define JOB (&COMP_current)
|
|
|
|
|
2008-05-11 20:07:16 +02:00
|
|
|
void COMPILE_init(void);
|
|
|
|
void COMPILE_load(void);
|
|
|
|
void COMPILE_exit(void);
|
|
|
|
void COMPILE_begin(const char *file, bool trans);
|
|
|
|
void COMPILE_end(void);
|
|
|
|
void COMPILE_export_class(char *name);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#endif
|