Expand description
The Hexicon compiler.
compile_program turns the source files of a program into a
program image, and compile does the same for a program that is
one file. The preprocessor (pp) can also be used on its own.
read_project reads what to build from the command line of
hexicon build and the manifests (hexicon.toml) it names.
The compiler has no access to files, to a clock, or to a console of
its own; whoever uses it supplies the files through
pp::SourceFiles and decides what to do with what comes out.
Modules§
- builtin
- The libraries built into the compiler: Hexicon’s system library (the
program’s entry point, the classes every program is built on, and the
headers that declare the virtual machine’s built-in functions and
classes) and Hexad. Their files are in
lib/systemandlib/hexad, and are read from there when the compiler is built, with thebuilt-in-librariesfeature, which is on unless turned off. (The virtual machine, which compiles code while a program runs but builds no games, turns it off.) - dynamic
- The dynamic compiler: code compiled while a program runs, as
CompiledCodeand the system library’sCompilerobject ask, against the names of the program that is running. - english
- Hexicon’s English: a game, or a part of one, written in sentences.
- ifid
- A game’s IFID: the identifier the Treaty of Babel gives every game, the same in all its versions. A new one is a random UUID; the build checks the one a game gives.
- pp
- The preprocessor: source files in, lines of preprocessed text out.
Structs§
- Compile
Options - What to compile, and how.
- Compiled
- What came of compiling.
- DirEntry
- What is in a folder, as
expand_resourcesis told it. - DocEnum
- The values of an enumeration, as one
enumdeclares them. - DocFile
- A source file, and its text.
- DocFunction
- A function.
- DocMacro
- A macro:
#define TWICE(x) ((x) * 2). - DocMember
- A property or method of a class or object.
- DocMessage
- A message a game can give text of its own for: the id of a
msgText()or ashowMsg(), and its text. - DocObject
- A class or a named object.
- DocPlace
- A place in a source file.
- DocTemplate
- A template, which says what values written without names stand for:
Room template 'roomTitle' "desc"?;. - DocUse
- A name used in code, in a source of the game’s own: a class’s, an object’s, a property’s, a function’s, or anything else that is not a local’s. Each place a name is written is one, its definition’s too.
- DocVerb
- A rule of the grammar for an action:
verb Toll 'toll' singleDobj. - Documented
- What
documentfound. - Project
- A program to build.
- Project
Paths - Where libraries are looked for, besides the folders
--library-pathnames and the libraries built into the compiler. - Resource
- A file bundled as a resource, and its name in the image.
- Resource
Spec - A file or a folder to bundle as resources.
- Runtime
Symbol - A global symbol, and its value in the image.
- Shown
- The problems of a build that are shown, as
hexicon buildand the language server show them, and those that are only counted.
Enums§
- Project
Error - Why there is nothing to build.
- Runtime
Value - What a global symbol means.
- Tok
- The kinds of token. They are in the order the reference compiler has them in, so that a kind’s number here is its number there, which is what lets the two tokenizers’ output be compared.
Constants§
- MANIFEST
- The name a manifest has.
Functions§
- compile
- Compile a program that is a single source file.
- compile_
and_ document - Compile a program, as
compile_programdoes, and say what its sources define, ascrate::documentdoes, from the same reading: the second reading of each source, which both need, is done once. If the compile stops before every source is read, what was found is said with the problems that stopped it (itsdiagnostics), ascrate::documentsays what stopped it. - compile_
program - Compile a program from its source files, which are put together in the order given.
- document
- Read a program’s sources, as a build would, and say what they define.
- expand_
resources - The files the resources name, each folder replaced by the files in
it, in the order the system lists them, as the reference does. A
file in a folder is named by the folder’s name, a
/, and its own.list_dirgives what is in a folder, or nothing for a path that is not one. - read_
project - Read what to build from the command line of
hexicon build, and from the manifest it names. - shown
- Which of a build’s problems are shown. In a Hexicon source, a message is shown once, and what follows a string with no end in the same file is only counted: it follows from that. Whether warnings are shown is the caller’s to decide.
- with_
preprocessor - Do something with a source’s preprocessor, set up as a build of the
program
sourcessets it up: its macros, include paths, character set, and imports, with the libraries built into the compiler, and an English source read as the Hexicon it means. It gives preprocessed text;set_compile_modemakes it give tokens.