mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Fixed broken links
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
This header defines the structure of the nodes used in the Abstract Syntax Tree, known as `Toy_ASTNode`. Most of what is defined here is intended for internal use, so is not documented here.
|
||||
|
||||
This header doesn't need to be included directly, as it is included in [toy_parser.h](c-api/toy_parser_h.md).
|
||||
This header doesn't need to be included directly, as it is included in [toy_parser.h](toy_parser_h.md).
|
||||
|
||||
## Defined Functions
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ There are two steps to generating intermediate bytecode - the writing step, and
|
||||
|
||||
During the writing step, the core of the program is generated, along with a series of literals representing the values within the program; these values are compressed and flattened into semi-unrecognizable forms. If the same literal is used multiple times in a program, such as a variable name, the name itself is replaced by a reference to the flattened literals within the cache.
|
||||
|
||||
During the collation step, everything from the core program's execution instructions, the flattened literals, the functions (which have their own sections and protocols within the bytecode) and version information (such as the macros defined in [toy_common.h](c-api/toy_common_h.md)) are all combined into a single buffer of bytes, known as bytecode. This bytecode can then be safely saved to a file or immediately executed.
|
||||
During the collation step, everything from the core program's execution instructions, the flattened literals, the functions (which have their own sections and protocols within the bytecode) and version information (such as the macros defined in [toy_common.h](toy_common_h.md)) are all combined into a single buffer of bytes, known as bytecode. This bytecode can then be safely saved to a file or immediately executed.
|
||||
|
||||
Executing these functions out-of-order causes undefiend behaviour.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# toy_parser.h
|
||||
|
||||
This header defines the structure `Toy_Parser` which, after being initialized with a `Toy_Lexer` produces a series of abstract syntax trees to be passed to the `Toy_Compiler`. The following is a utility function provided by [repl_tools.h](c-api/repl_tools_h.md), demonstrating how to use the parser.
|
||||
This header defines the structure `Toy_Parser` which, after being initialized with a `Toy_Lexer` produces a series of abstract syntax trees to be passed to the `Toy_Compiler`. The following is a utility function provided by [repl_tools.h](repl_tools_h.md), demonstrating how to use the parser.
|
||||
|
||||
```c
|
||||
//generate bytecode from a given string
|
||||
@@ -48,7 +48,7 @@ const unsigned char* Toy_compileString(const char* source, size_t* size) {
|
||||
}
|
||||
```
|
||||
|
||||
This header also includes [toy_ast_node.h](c-api/toy_ast_node_h.md), so the `Toy_freeASTNode` function can also be used.
|
||||
This header also includes [toy_ast_node.h](toy_ast_node_h.md), so the `Toy_freeASTNode` function can also be used.
|
||||
|
||||
## Defined Functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user