ArkScript
A small, fast, functional and scripting language for video games
|
Namespaces | |
namespace | Builtins |
Classes | |
class | BaseParser |
struct | bytes_t |
struct | CharPred |
class | Closure |
Closure management. More... | |
class | ConditionalExecutor |
Handles Conditional macros. More... | |
struct | ExecutionContext |
struct | FilePosition |
class | FunctionExecutor |
Handles function macros. More... | |
class | Future |
struct | Import |
class | ImportSolver |
struct | IsAlnum |
struct | IsAlpha |
struct | IsAny |
struct | IsChar |
struct | IsDigit |
struct | IsEither |
struct | IsHex |
struct | IsInlineSpace |
struct | IsLower |
struct | IsNot |
struct | IsPrint |
struct | IsSpace |
struct | IsSymbol |
struct | IsUpper |
class | MacroExecutor |
A class that applies macros in a Node. More... | |
class | MacroExecutorPipeline |
The class that initializes the MacroExecutors. More... | |
class | MacroProcessor |
The class handling the macros definitions and calls, given an AST. More... | |
class | MacroScope |
struct | Module |
class | Node |
A node of an Abstract Syntax Tree for ArkScript. More... | |
class | Optimizer |
The ArkScript AST optimizer. More... | |
class | Parser |
class | Scope |
A class to handle the VM scope more efficiently. More... | |
class | SharedLibrary |
Handling a shared library as an ArkScript plugin. More... | |
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 , 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 , FIRST_COMMAND = 0x01 , LOAD_SYMBOL = 0x01 , LOAD_CONST = 0x02 , POP_JUMP_IF_TRUE = 0x03 , STORE = 0x04 , LET = 0x05 , POP_JUMP_IF_FALSE = 0x06 , JUMP = 0x07 , RET = 0x08 , HALT = 0x09 , CALL = 0x0a , CAPTURE = 0x0b , BUILTIN = 0x0c , MUT = 0x0d , DEL = 0x0e , SAVE_ENV = 0x0f , GET_FIELD = 0x10 , PLUGIN = 0x11 , LIST = 0x12 , APPEND = 0x13 , CONCAT = 0x14 , APPEND_IN_PLACE = 0x15 , CONCAT_IN_PLACE = 0x16 , POP_LIST = 0x17 , POP_LIST_IN_PLACE = 0x18 , POP = 0x19 , LAST_COMMAND = 0x19 , FIRST_OPERATOR = 0x20 , ADD = 0x20 , SUB = 0x21 , MUL = 0x22 , DIV = 0x23 , GT = 0x24 , LT = 0x25 , LE = 0x26 , GE = 0x27 , NEQ = 0x28 , EQ = 0x29 , LEN = 0x2a , EMPTY = 0x2b , TAIL = 0x2c , HEAD = 0x2d , ISNIL = 0x2e , ASSERT = 0x2f , TO_NUM = 0x30 , TO_STR = 0x31 , AT = 0x32 , AND_ = 0x33 , OR_ = 0x34 , MOD = 0x35 , TYPE = 0x36 , HASFIELD = 0x37 , NOT = 0x38 , LAST_OPERATOR = 0x38 , LAST_INSTRUCTION = 0x38 } |
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 , Mutability , Scope , Type , Index , Arity , DivisionByZero } |
Functions | |
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) noexcept |
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::string &context, int &length) |
void | hookColor (const std::string &context, replxx::Replxx::colors_t &colors) |
replxx::Replxx::hints_t | hookHint (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) |
bool | operator! (const Node &A) |
std::optional< std::filesystem::path > | testExtensions (const std::filesystem::path &folder, const std::string &package_path) |
bool | operator== (const Scope &A, const Scope &B) noexcept |
bool | operator== (const Closure &A, const Closure &B) noexcept |
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::IsUpper | IsUpper |
Ark::internal::IsLower | IsLower |
Ark::internal::IsAlpha | IsAlpha |
Ark::internal::IsAlnum | IsAlnum |
Ark::internal::IsPrint | IsPrint |
Ark::internal::IsSymbol | IsSymbol |
Ark::internal::IsAny | IsAny |
const IsChar | IsMinus ('-') |
constexpr std::array< std::string_view, 10 > | nodeTypes |
constexpr std::array< std::string_view, 9 > | keywords |
List of available keywords in ArkScript. | |
constexpr std::array< std::string_view, 25 > | operators |
constexpr std::array< std::string_view, 8 > | errorKinds |
const std::vector< std::string > | KeywordsDict |
const std::vector< std::pair< std::string, replxx::Replxx::Color > > | ColorsRegexDict |
using Ark::internal::PageAddr_t = typedef uint16_t |
Definition at line 30 of file Closure.hpp.
|
strong |
Enumerator | |
---|---|
VM | |
Module | |
Mutability | |
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 25 of file Instructions.hpp.
|
strong |
The different keywords available.
Enumerator | |
---|---|
Fun | |
Let | |
Mut | |
Set | |
If | |
While | |
Begin | |
Import | |
Del |
Definition at line 55 of file Common.hpp.
|
strong |
The different node types available.
Enumerator | |
---|---|
Symbol | |
Capture | |
Keyword | |
String | |
Number | |
List | |
Spread | |
Field | |
Macro | |
Unused |
Definition at line 27 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 22 of file Utils.cpp.
Referenced by hookColor(), hookCompletion(), and hookHint().
std::size_t Ark::internal::contextLen | ( | const std::string & | prefix | ) |
Definition at line 30 of file Utils.cpp.
Referenced by hookCompletion(), and hookHint().
long Ark::internal::countOpenEnclosures | ( | const std::string & | line, |
char | open, | ||
char | close | ||
) |
Count the open enclosure and its counterpart: (), {}, [].
line | data to operate on |
open | the open char: (, { or [ |
close | the closing char: ), } or ] |
Definition at line 7 of file Utils.cpp.
Referenced by Ark::Repl::getCodeBlock().
const Node & Ark::internal::getFalseNode | ( | ) |
Definition at line 287 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::MacroProcessor::evaluate().
const Node & Ark::internal::getListNode | ( | ) |
Definition at line 299 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 293 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 281 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::MacroProcessor::evaluate().
void Ark::internal::hookColor | ( | const std::string & | context, |
replxx::Replxx::colors_t & | colors | ||
) |
Definition at line 72 of file Utils.cpp.
References codepointLength(), and ColorsRegexDict.
Referenced by Ark::Repl::cuiSetup().
replxx::Replxx::completions_t Ark::internal::hookCompletion | ( | const std::string & | context, |
int & | length | ||
) |
Definition at line 48 of file Utils.cpp.
References codepointLength(), contextLen(), and KeywordsDict.
Referenced by Ark::Repl::cuiSetup().
replxx::Replxx::hints_t Ark::internal::hookHint | ( | const std::string & | context, |
int & | length, | ||
replxx::Replxx::Color & | color | ||
) |
Definition at line 97 of file Utils.cpp.
References codepointLength(), contextLen(), and KeywordsDict.
Referenced by Ark::Repl::cuiSetup().
Definition at line 90 of file Closure.hpp.
Definition at line 43 of file Closure.cpp.
std::optional< std::filesystem::path > Ark::internal::testExtensions | ( | const std::filesystem::path & | folder, |
const std::string & | package_path | ||
) |
Definition at line 167 of file ImportSolver.cpp.
Referenced by Ark::internal::ImportSolver::findFile().
void Ark::internal::trimWhitespace | ( | std::string & | line | ) |
Remove whitespaces at the start and end of a string.
line | string modified in place |
Definition at line 12 of file Utils.cpp.
Referenced by Ark::Repl::getLine().
|
inlinenoexcept |
Definition at line 200 of file Node.hpp.
References nodeTypes.
Referenced by Ark::internal::MacroProcessor::evaluate(), and Ark::internal::MacroProcessor::unify().
const std::vector<std::pair<std::string, replxx::Replxx::Color> > Ark::internal::ColorsRegexDict |
Definition at line 56 of file Utils.hpp.
Referenced by hookColor().
|
constexpr |
Definition at line 21 of file ErrorKind.hpp.
Referenced by Ark::VM::throwVMError().
const IsChar Ark::internal::IsMinus('-') | ( | '-' | ) |
Referenced by Ark::internal::BaseParser::signedNumber().
|
constexpr |
List of available keywords in ArkScript.
Definition at line 69 of file Common.hpp.
Referenced by Formatter::format(), Formatter::formatVariable(), and Ark::internal::Node::repr().
const std::vector<std::string> Ark::internal::KeywordsDict |
Definition at line 22 of file Utils.hpp.
Referenced by hookCompletion(), and hookHint().
|
constexpr |
Definition at line 41 of file Common.hpp.
Referenced by JsonCompiler::_compile(), and typeToString().
|
constexpr |
Definition at line 84 of file Common.hpp.
Referenced by Ark::Compiler::getOperator(), Ark::Compiler::handleCalls(), and Ark::internal::MacroProcessor::isConstEval().