2020-09-10 00:56:16 +00:00
|
|
|
/*************/
|
|
|
|
/*GEMWIRE */
|
|
|
|
/* ERYTHRO*/
|
|
|
|
/*************/
|
|
|
|
|
|
|
|
#pragma once
|
2022-03-03 00:05:10 +00:00
|
|
|
|
2020-09-10 00:56:16 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <Defs.h>
|
2021-01-18 01:47:42 +00:00
|
|
|
#include <stdbool.h>
|
2020-09-10 00:56:16 +00:00
|
|
|
|
|
|
|
#ifndef extern_
|
|
|
|
#define extern_ extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define TEXTLEN 512
|
|
|
|
|
2022-03-05 01:13:45 +00:00
|
|
|
// 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.
|
2022-03-03 00:05:10 +00:00
|
|
|
extern_ struct SymbolTableEntry* Globals, * GlobalsEnd;
|
|
|
|
extern_ struct SymbolTableEntry* Locals, * LocalsEnd;
|
|
|
|
extern_ struct SymbolTableEntry* Params, * ParamsEnd;
|
|
|
|
extern_ struct SymbolTableEntry* Structs, * StructsEnd;
|
2022-03-03 02:44:07 +00:00
|
|
|
extern_ struct SymbolTableEntry* CompositeMembers, * CompositeMembersEnd;
|
2022-03-04 01:11:04 +00:00
|
|
|
extern_ struct SymbolTableEntry* EnumMembers, * EnumMembersEnd;
|
2022-03-03 00:05:10 +00:00
|
|
|
extern_ struct SymbolTableEntry* Unions, * UnionsEnd;
|
|
|
|
extern_ struct SymbolTableEntry* Enums, * EnumsEnd;
|
2022-03-04 01:11:04 +00:00
|
|
|
extern_ struct SymbolTableEntry* Types, * TypesEnd;
|
2020-09-10 00:56:16 +00:00
|
|
|
|
2022-03-05 01:13:45 +00:00
|
|
|
// Whether we should dump the syntax tree before starting to assemble the file.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ bool OptDumpTree;
|
2022-03-05 01:13:45 +00:00
|
|
|
// Whether we should keep the assembly files after successfully linking.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ bool OptKeepAssembly;
|
2022-03-05 01:13:45 +00:00
|
|
|
// Whether to stop at compilation and dumping - skip assembly and binary creation altogether.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ bool OptAssembleFiles;
|
2022-03-05 01:13:45 +00:00
|
|
|
// Whether to stop at assembly - skip linking into a binary.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ bool OptLinkFiles;
|
2022-03-05 01:13:45 +00:00
|
|
|
// Whether to output extended debugging information.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ bool OptVerboseOutput;
|
|
|
|
|
2022-03-05 01:13:45 +00:00
|
|
|
// The name of the binary we want to create.
|
2021-01-18 01:47:42 +00:00
|
|
|
extern_ char* OutputFileName;
|
2022-03-05 01:13:45 +00:00
|
|
|
// The sizes of each of the core types, in bytes.
|
2022-03-03 00:05:10 +00:00
|
|
|
extern_ int TypeSizes[5];
|
2023-04-23 16:32:02 +00:00
|
|
|
// The name of the Assembler Module that we should use.
|
|
|
|
extern_ char* OptAssemblerName;
|
|
|
|
// The Assembler Module to call to when performing generation operations.
|
|
|
|
extern_ struct AssemblerModule* Assembler;
|
2020-09-13 01:26:49 +00:00
|
|
|
|
2022-03-05 01:13:45 +00:00
|
|
|
// The names of each token in the language, synchronized to the TokenTypes enum.
|
2020-09-10 00:56:16 +00:00
|
|
|
extern_ char* TokenNames[];
|
2023-04-24 19:41:49 +00:00
|
|
|
extern_ char* OperationNames[];
|
2020-09-10 00:56:16 +00:00
|
|
|
|
2022-03-05 01:13:45 +00:00
|
|
|
// The names of the storage scopes.
|
2021-03-15 01:22:47 +00:00
|
|
|
extern_ char* ScopeNames[];
|
|
|
|
|
2020-09-10 00:56:16 +00:00
|
|
|
extern_ int Overread;
|
|
|
|
|
2020-11-25 02:11:09 +00:00
|
|
|
extern_ char CurrentIdentifier[TEXTLEN + 1];
|
|
|
|
|