Erythro/include/Data.h

65 lines
1.9 KiB
C

/*************/
/*GEMWIRE */
/* ERYTHRO*/
/*************/
#pragma once
#include <stdio.h>
#include <Defs.h>
#include <stdbool.h>
#ifndef extern_
#define extern_ extern
#endif
#define TEXTLEN 512
#define SYMBOLS 1024
// All currently open source files.
extern_ struct FileData** Files;
// The source file currently being operated on.
extern_ struct FileData* CurrentFile;
// The file we are writing into; CurrentFile -> OutputFile
extern_ FILE* OutputFile;
// Symbol tables.
extern_ struct SymbolTableEntry* Globals, * GlobalsEnd;
extern_ struct SymbolTableEntry* Locals, * LocalsEnd;
extern_ struct SymbolTableEntry* Params, * ParamsEnd;
extern_ struct SymbolTableEntry* Structs, * StructsEnd;
extern_ struct SymbolTableEntry* CompositeMembers, * CompositeMembersEnd;
extern_ struct SymbolTableEntry* EnumMembers, * EnumMembersEnd;
extern_ struct SymbolTableEntry* Unions, * UnionsEnd;
extern_ struct SymbolTableEntry* Enums, * EnumsEnd;
extern_ struct SymbolTableEntry* Types, * TypesEnd;
// Whether we should dump the syntax tree before starting to assemble the file.
extern_ bool OptDumpTree;
// Whether we should keep the assembly files after successfully linking.
extern_ bool OptKeepAssembly;
// Whether to stop at compilation and dumping - skip assembly and binary creation altogether.
extern_ bool OptAssembleFiles;
// Whether to stop at assembly - skip linking into a binary.
extern_ bool OptLinkFiles;
// Whether to output extended debugging information.
extern_ bool OptVerboseOutput;
// The name of the binary we want to create.
extern_ char* OutputFileName;
// The sizes of each of the core types, in bytes.
extern_ int TypeSizes[5];
// The names of each token in the language, synchronized to the TokenTypes enum.
extern_ char* TokenNames[];
// The names of the storage scopes.
extern_ char* ScopeNames[];
extern_ int Overread;
extern_ char CurrentIdentifier[TEXTLEN + 1];
extern_ int CurrentGlobal;
extern_ int CurrentLocal;