00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _H_conscomp
00024 #define _H_conscomp
00025
00026 #define ArbitraryPrefix(codeItem,i) (codeItem)->arrayNames[(i)]
00027
00028 #define ModulePrefix(codeItem) (codeItem)->arrayNames[0]
00029 #define ConstructPrefix(codeItem) (codeItem)->arrayNames[1]
00030
00031 #ifndef _H_constrct
00032 #include "constrct.h"
00033 #endif
00034 #ifndef _H_extnfunc
00035 #include "extnfunc.h"
00036 #endif
00037 #ifndef _H_symblcmp
00038 #include "symblcmp.h"
00039 #endif
00040 #ifndef _H_moduldef
00041 #include "moduldef.h"
00042 #endif
00043
00044 #define CONSTRUCT_COMPILER_DATA 41
00045
00046 struct CodeGeneratorItem
00047 {
00048 char *name;
00049 void (*beforeFunction)(void *);
00050 void (*initFunction)(void *,FILE *,int,int);
00051 int (*generateFunction)(void *,char *,char *,char *,int,FILE *,int,int);
00052 int priority;
00053 char **arrayNames;
00054 int arrayCount;
00055 struct CodeGeneratorItem *next;
00056 };
00057
00058 struct constructCompilerData
00059 {
00060 int ImageID;
00061 FILE *HeaderFP;
00062 int MaxIndices;
00063 FILE *ExpressionFP;
00064 FILE *FixupFP;
00065 char *FilePrefix;
00066 char *PathName;
00067 char *FileNameBuffer;
00068 intBool ExpressionHeader;
00069 long ExpressionCount;
00070 int ExpressionVersion;
00071 int CodeGeneratorCount;
00072 struct CodeGeneratorItem *ListOfCodeGeneratorItems;
00073 };
00074
00075 #define ConstructCompilerData(theEnv) ((struct constructCompilerData *) GetEnvironmentData(theEnv,CONSTRUCT_COMPILER_DATA))
00076
00077 #ifdef LOCALE
00078 #undef LOCALE
00079 #endif
00080
00081 #ifndef _STDIO_INCLUDED_
00082 #define _STDIO_INCLUDED_
00083 #include <stdio.h>
00084 #endif
00085
00086 struct CodeGeneratorFile
00087 {
00088 char *filePrefix;
00089 char *pathName;
00090 char *fileNameBuffer;
00091 int id,version;
00092 };
00093
00094 #ifdef _CONSCOMP_SOURCE_
00095 #define LOCALE
00096 #else
00097 #define LOCALE extern
00098 #endif
00099
00100 LOCALE void InitializeConstructCompilerData(void *);
00101 LOCALE void ConstructsToCCommandDefinition(void *);
00102 LOCALE FILE *NewCFile(void *,char *,char *,char *,int,int,int);
00103 LOCALE int ExpressionToCode(void *,FILE *,struct expr *);
00104 LOCALE void PrintFunctionReference(void *,FILE *,struct FunctionDefinition *);
00105 LOCALE struct CodeGeneratorItem *AddCodeGeneratorItem(void *,char *,int,
00106 void (*)(void *),
00107 void (*)(void *,FILE *,int,int),
00108 int (*)(void *,char *,char *,char *,int,FILE *,int,int),int);
00109 LOCALE FILE *CloseFileIfNeeded(void *,FILE *,int *,int *,int,int *,struct CodeGeneratorFile *);
00110 LOCALE FILE *OpenFileIfNeeded(void *,FILE *,char *,char *,char *,int,int,int *,int,FILE *,
00111 char *,char *,int,struct CodeGeneratorFile *);
00112 LOCALE void MarkConstructBsaveIDs(void *,int);
00113 LOCALE void ConstructHeaderToCode(void *,FILE *,struct constructHeader *,int,int,
00114 int,char *,char *);
00115 LOCALE void ConstructModuleToCode(void *,FILE *,struct defmodule *,int,int,
00116 int,char *);
00117 LOCALE void PrintHashedExpressionReference(void *,FILE *,struct expr *,int,int);
00118
00119 #endif
00120
00121
00122
00123