ArkScript
A small, fast, functional and scripting language for video games
|
Namespaces | |
namespace | Builtins |
namespace | IR |
namespace | Language |
Classes | |
class | BaseParser |
struct | CharPred |
class | Closure |
Closure management. More... | |
class | Compiler |
The ArkScript bytecode compiler. More... | |
class | ConditionalExecutor |
Handles Conditional macros. More... | |
struct | Declaration |
struct | EntityWithOffset |
struct | ExecutionContext |
struct | FilePosition |
Describe a position in a given file ; handled by the BaseParser. More... | |
class | FunctionExecutor |
Handles function macros. More... | |
class | Future |
struct | Import |
class | ImportSolver |
class | IRCompiler |
class | IROptimizer |
struct | IsAlnum |
struct | IsAlpha |
struct | IsChar |
struct | IsDigit |
struct | IsEither |
struct | IsHex |
struct | IsInlineSpace |
struct | IsNot |
struct | IsSpace |
struct | IsSymbol |
class | Logger |
class | MacroExecutor |
A class that applies macros in a Node. More... | |
class | MacroProcessor |
The class handling the macros definitions and calls, given an AST. More... | |
class | MacroScope |
class | NameResolutionPass |
struct | Namespace |
class | NamespaceScope |
class | Node |
A node of an Abstract Syntax Tree for ArkScript. More... | |
class | Optimizer |
The ArkScript AST optimizer. More... | |
struct | Package |
class | Parser |
class | Pass |
An interface to describe compiler passes. More... | |
class | Scope |
A class to handle the VM scope more efficiently. More... | |
class | ScopeResolver |
class | SharedLibrary |
Handling a shared library as an ArkScript plugin. More... | |
class | StaticScope |
class | SymbolExecutor |
Handles Symbol macros. More... | |
struct | type_uid |
struct | type_uid_impl |
class | utf8_char_t |
struct | ValTableElem |
A Compiler Value class helper to handle multiple types. More... | |
struct | Word |
Typedefs | |
using | PageAddr_t = uint16_t |
Enumerations | |
enum class | NodeType { Symbol , Capture , Keyword , String , Number , List , Spread , Field , Macro , Namespace , Unused } |
The different node types available. More... | |
enum class | Keyword { Fun , Let , Mut , Set , If , While , Begin , Import , Del } |
The different keywords available. More... | |
enum | Instruction : uint8_t { NOP = 0x00 , SYM_TABLE_START = 0x01 , VAL_TABLE_START = 0x02 , NUMBER_TYPE = 0x01 , STRING_TYPE = 0x02 , FUNC_TYPE = 0x03 , CODE_SEGMENT_START = 0x03 , LOAD_SYMBOL = 0x01 , LOAD_CONST = 0x02 , POP_JUMP_IF_TRUE = 0x03 , STORE = 0x04 , SET_VAL = 0x05 , POP_JUMP_IF_FALSE = 0x06 , JUMP = 0x07 , RET = 0x08 , HALT = 0x09 , CALL = 0x0a , CAPTURE = 0x0b , BUILTIN = 0x0c , DEL = 0x0d , MAKE_CLOSURE = 0x0e , GET_FIELD = 0x0f , PLUGIN = 0x10 , LIST = 0x11 , APPEND = 0x12 , CONCAT = 0x13 , APPEND_IN_PLACE = 0x14 , CONCAT_IN_PLACE = 0x15 , POP_LIST = 0x16 , POP_LIST_IN_PLACE = 0x17 , SET_AT_INDEX = 0x18 , SET_AT_2_INDEX = 0x19 , POP = 0x1a , DUP = 0x1b , CREATE_SCOPE = 0x1c , POP_SCOPE = 0x1d , FIRST_OPERATOR = 0x1e , ADD = 0x1e , SUB = 0x1f , MUL = 0x20 , DIV = 0x21 , GT = 0x22 , LT = 0x23 , LE = 0x24 , GE = 0x25 , NEQ = 0x26 , EQ = 0x27 , LEN = 0x28 , EMPTY = 0x29 , TAIL = 0x2a , HEAD = 0x2b , ISNIL = 0x2c , ASSERT = 0x2d , TO_NUM = 0x2e , TO_STR = 0x2f , AT = 0x30 , AT_AT = 0x31 , MOD = 0x32 , TYPE = 0x33 , HASFIELD = 0x34 , NOT = 0x35 , LOAD_CONST_LOAD_CONST = 0x36 , LOAD_CONST_STORE = 0x37 , LOAD_CONST_SET_VAL = 0x38 , STORE_FROM = 0x39 , SET_VAL_FROM = 0x3a , INCREMENT = 0x3b , DECREMENT = 0x3c , STORE_TAIL = 0x3d , STORE_HEAD = 0x3e , SET_VAL_TAIL = 0x3f , SET_VAL_HEAD = 0x40 , CALL_BUILTIN = 0x41 } |
The different bytecodes are stored here. More... | |
enum class | ValTableElemType { Number , String , PageAddr } |
Enumeration to keep track of the type of a Compiler Value. More... | |
enum class | ErrorKind { VM , Module , Scope , Type , Index , Arity , DivisionByZero } |
Functions | |
bool | operator== (const Namespace &A, const Namespace &B) |
bool | operator< (const Namespace &, const Namespace &) |
const Node & | getTrueNode () |
const Node & | getFalseNode () |
const Node & | getNilNode () |
const Node & | getListNode () |
std::string | typeToString (const Node &node) noexcept |
bool | operator< (const Closure &A, const Closure &B) |
long | countOpenEnclosures (const std::string &line, char open, char close) |
Count the open enclosure and its counterpart: (), {}, []. | |
void | trimWhitespace (std::string &line) |
Remove whitespaces at the start and end of a string. | |
replxx::Replxx::completions_t | hookCompletion (const std::vector< std::string > &words, const std::string &context, int &length) |
void | hookColor (const std::vector< std::pair< std::string, replxx::Replxx::Color > > &words_colors, const std::string &context, replxx::Replxx::colors_t &colors) |
replxx::Replxx::hints_t | hookHint (const std::vector< std::string > &words, const std::string &context, int &length, replxx::Replxx::Color &color) |
bool | operator== (const Node &A, const Node &B) |
bool | operator< (const Node &A, const Node &B) |
std::optional< std::filesystem::path > | testExtensions (const std::filesystem::path &folder, const std::string &package_path) |
bool | operator== (const Scope &A, const Scope &B) |
bool | operator== (const Closure &A, const Closure &B) |
std::size_t | codepointLength (const std::string &str) |
std::size_t | contextLen (const std::string &prefix) |
Variables | |
Ark::internal::IsSpace | IsSpace |
Ark::internal::IsInlineSpace | IsInlineSpace |
Ark::internal::IsDigit | IsDigit |
Ark::internal::IsHex | IsHex |
Ark::internal::IsAlpha | IsAlpha |
Ark::internal::IsAlnum | IsAlnum |
Ark::internal::IsSymbol | IsSymbol |
const IsChar | IsMinus ('-') |
constexpr std::array< std::string_view, 11 > | nodeTypes |
Node types as string, in the same order as the enum NodeType. | |
constexpr std::array< std::string_view, 9 > | keywords |
List of available keywords in ArkScript. | |
constexpr std::array | InstructionNames |
constexpr std::array< std::string_view, 7 > | errorKinds |
constexpr std::array | colors |
using Ark::internal::PageAddr_t = uint16_t |
Definition at line 30 of file Closure.hpp.
|
strong |
Enumerator | |
---|---|
VM | |
Module | |
Scope | |
Type | |
Index | |
Arity | |
DivisionByZero |
Definition at line 9 of file ErrorKind.hpp.
enum Ark::internal::Instruction : uint8_t |
The different bytecodes are stored here.
FIRST_OPERATOR
must be the same as the one in the operators table from the aforementioned file. Definition at line 27 of file Instructions.hpp.
|
strong |
The different keywords available.
Enumerator | |
---|---|
Fun | |
Let | |
Mut | |
Set | |
If | |
While | |
Begin | |
Import | |
Del |
Definition at line 59 of file Common.hpp.
|
strong |
The different node types available.
Enumerator | |
---|---|
Symbol | |
Capture | |
Keyword | |
String | |
Number | |
List | |
Spread | |
Field | |
Macro | |
Namespace | |
Unused |
Definition at line 28 of file Common.hpp.
|
strong |
Enumeration to keep track of the type of a Compiler Value.
Enumerator | |
---|---|
Number | |
String | |
PageAddr |
Definition at line 26 of file ValTableElem.hpp.
std::size_t Ark::internal::codepointLength | ( | const std::string & | str | ) |
Definition at line 23 of file Utils.cpp.
Referenced by hookColor(), hookCompletion(), and hookHint().
std::size_t Ark::internal::contextLen | ( | const std::string & | prefix | ) |
Definition at line 31 of file Utils.cpp.
Referenced by hookCompletion(), and hookHint().
long Ark::internal::countOpenEnclosures | ( | const std::string & | line, |
char | open, | ||
char | close ) |
const Node & Ark::internal::getFalseNode | ( | ) |
Definition at line 314 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::MacroProcessor::evaluate().
const Node & Ark::internal::getListNode | ( | ) |
Definition at line 326 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::FunctionExecutor::applyMacro(), and Ark::internal::MacroProcessor::evaluate().
const Node & Ark::internal::getNilNode | ( | ) |
Definition at line 320 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::ConditionalExecutor::applyMacro(), and Ark::internal::MacroProcessor::evaluate().
const Node & Ark::internal::getTrueNode | ( | ) |
Definition at line 308 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::MacroProcessor::evaluate().
void Ark::internal::hookColor | ( | const std::vector< std::pair< std::string, replxx::Replxx::Color > > & | words_colors, |
const std::string & | context, | ||
replxx::Replxx::colors_t & | colors ) |
Definition at line 73 of file Utils.cpp.
References codepointLength(), and colors.
replxx::Replxx::completions_t Ark::internal::hookCompletion | ( | const std::vector< std::string > & | words, |
const std::string & | context, | ||
int & | length ) |
Definition at line 49 of file Utils.cpp.
References codepointLength(), and contextLen().
replxx::Replxx::hints_t Ark::internal::hookHint | ( | const std::vector< std::string > & | words, |
const std::string & | context, | ||
int & | length, | ||
replxx::Replxx::Color & | color ) |
Definition at line 98 of file Utils.cpp.
References codepointLength(), and contextLen().
Definition at line 89 of file Closure.hpp.
Definition at line 27 of file Namespace.hpp.
Definition at line 45 of file Closure.cpp.
Definition at line 21 of file Namespace.hpp.
References Ark::internal::Namespace::is_glob, Ark::internal::Namespace::name, and Ark::internal::Namespace::with_prefix.
std::optional< std::filesystem::path > Ark::internal::testExtensions | ( | const std::filesystem::path & | folder, |
const std::string & | package_path ) |
Definition at line 183 of file ImportSolver.cpp.
Referenced by Ark::internal::ImportSolver::findFile().
void Ark::internal::trimWhitespace | ( | std::string & | line | ) |
|
inlinenoexcept |
node |
Definition at line 241 of file Node.hpp.
References nodeTypes.
Referenced by Ark::internal::Compiler::compileExpression(), Ark::internal::Compiler::compileFunction(), Ark::internal::Compiler::compileLetMutSet(), Ark::internal::MacroProcessor::evaluate(), Ark::internal::MacroProcessor::registerFuncDef(), and Ark::internal::FunctionExecutor::unify().
|
constexpr |
Definition at line 8 of file Logger.cpp.
Referenced by hookColor(), and Ark::internal::Logger::Logger().
|
constexpr |
Definition at line 20 of file ErrorKind.hpp.
Referenced by Ark::VM::throwVMError().
|
constexpr |
Definition at line 267 of file Instructions.hpp.
Referenced by Ark::BytecodeReader::display(), and Ark::internal::IRCompiler::dumpToStream().
Ark::internal::IsAlnum Ark::internal::IsAlnum |
Ark::internal::IsAlpha Ark::internal::IsAlpha |
Ark::internal::IsDigit Ark::internal::IsDigit |
Ark::internal::IsHex Ark::internal::IsHex |
Ark::internal::IsInlineSpace Ark::internal::IsInlineSpace |
const IsChar Ark::internal::IsMinus('-') | ( | '-' | ) |
Referenced by Ark::internal::BaseParser::signedNumber().
Ark::internal::IsSpace Ark::internal::IsSpace |
Ark::internal::IsSymbol Ark::internal::IsSymbol |
|
constexpr |
List of available keywords in ArkScript.
Definition at line 73 of file Common.hpp.
Referenced by Formatter::format(), Formatter::formatVariable(), and Ark::internal::Node::repr().
|
constexpr |
Node types as string, in the same order as the enum NodeType.
Definition at line 44 of file Common.hpp.
Referenced by JsonCompiler::_compile(), Ark::internal::Parser::letMutSet(), and typeToString().