![]() |
ArkScript
A small, lisp-inspired, functional scripting language
|
Namespaces | |
| namespace | Builtins |
| namespace | bytecode |
| namespace | ieee754 |
| namespace | IR |
| namespace | Language |
Classes | |
| struct | Arg |
| class | ASTLowerer |
| The ArkScript AST to IR compiler. More... | |
| class | BaseParser |
| struct | BlockInfo |
| struct | CharPred |
| class | Closure |
| Closure management. More... | |
| class | ClosureScope |
| A class to store fields captured by a closure. More... | |
| struct | CompiledPrompt |
| class | ConditionalExecutor |
| Handles Conditional macros. More... | |
| class | Debugger |
| struct | Declaration |
| class | Dict |
| struct | EntityWithOffset |
| struct | ExecutionContext |
| struct | FilePos |
| struct | FilePosition |
| Describe a position in a given file ; handled by the BaseParser. More... | |
| struct | FileSpan |
| Describes a span for a node/atom in a file, its start position and end position. More... | |
| class | FunctionExecutor |
| Handles function macros. More... | |
| class | Future |
| struct | Import |
| class | ImportSolver |
| struct | InstLoc |
| class | IRCompiler |
| class | IRInliner |
| class | IROptimizer |
| struct | IsAlnum |
| struct | IsAlpha |
| struct | IsChar |
| struct | IsDigit |
| struct | IsEither |
| struct | IsHex |
| struct | IsInlineSpace |
| struct | IsNot |
| struct | IsOct |
| struct | IsSpace |
| struct | IsSymbol |
| class | LocalsLocator |
| 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 |
| struct | PageCreationData |
| class | Parser |
| class | Pass |
| An interface to describe compiler passes. More... | |
| struct | SavedState |
| class | ScopeResolver |
| class | ScopeView |
| A class to handle the VM scope more efficiently. More... | |
| class | SharedLibrary |
| Handling a shared library as an ArkScript VM plugin. More... | |
| class | StaticScope |
| struct | SymbolData |
| class | SymbolExecutor |
| Handles Symbol macros. More... | |
| struct | TracedInstruction |
| 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 |
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 () |
| ARK_ALWAYS_INLINE std::string | typeToString (const Node &node) noexcept |
| void | serializeToVecLE (std::integral auto number, std::vector< uint8_t > &out) |
| void | serializeToVecBE (std::integral auto number, std::vector< uint8_t > &out) |
| void | serializeOn2BytesToVecLE (std::integral auto number, std::vector< uint8_t > &out) |
| void | serializeOn2BytesToVecBE (std::integral auto number, std::vector< uint8_t > &out) |
| template<std::integral T> | |
| T | deserializeLE (std::vector< uint8_t >::const_iterator begin, std::vector< uint8_t >::const_iterator end) |
| template<std::integral T> | |
| T | deserializeBE (std::vector< uint8_t >::const_iterator begin, std::vector< uint8_t >::const_iterator end) |
| bool | operator< (const Closure &A, const Closure &B) |
| bool | operator== (const Dict &A, const Dict &B) |
| std::vector< std::string > | getAllKeywords () |
| Compute a list of all the language keywords and builtins. | |
| std::vector< std::pair< std::string, replxx::Replxx::Color > > | getColorPerKeyword () |
| Compute a list of pairs (word -> color) to be used for coloration by the REPL. | |
| 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) |
| IR::Entity | fuseMathOps3 (const std::span< const IR::Entity > e) |
| IR::Entity | fuseMathOps2 (const std::span< const IR::Entity > e) |
| std::optional< std::filesystem::path > | testExtensions (const std::filesystem::path &folder, const std::string &package_path) |
| bool | operator== (const ScopeView &A, const ScopeView &B) |
| bool | operator== (const Closure &A, const Closure &B) |
| bool | operator== (const ClosureScope &A, const ClosureScope &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::IsOct | IsOct |
| Ark::internal::IsAlpha | IsAlpha |
| Ark::internal::IsAlnum | IsAlnum |
| Ark::internal::IsSymbol | IsSymbol |
| const IsChar | IsMinus ('-') |
| constexpr std::array< std::string_view, 13 > | 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::string_view | HiddenSymbolSuffix = "#hidden" |
| constexpr uint8_t | FirstOperator = Instruction::BREAKPOINT |
| 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 27 of file Closure.hpp.
|
strong |
Definition at line 82 of file BytecodeReader.hpp.
|
strong |
| Enumerator | |
|---|---|
| Classic | |
| SelfNotRecursive | |
| Symbol | |
| SymbolByIndex | |
| Builtin | |
Definition at line 19 of file ASTLowerer.cpp.
|
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. | Enumerator | |
|---|---|
| SYM_TABLE_START | |
| VAL_TABLE_START | |
| CODE_SEGMENT_START | |
| NUMBER_TYPE | |
| STRING_TYPE | |
| FUNC_TYPE | |
| FILENAMES_TABLE_START | |
| INST_LOC_TABLE_START | |
| X | |
| X | |
Definition at line 26 of file Instructions.hpp.
|
strong |
The different keywords available.
| Enumerator | |
|---|---|
| Fun | |
| Let | |
| Mut | |
| Set | |
| If | |
| While | |
| Begin | |
| Import | |
| Del | |
Definition at line 78 of file Common.hpp.
|
strong |
The different node types available.
| Enumerator | |
|---|---|
| Symbol | |
| MutArg | |
| RefArg | |
| Capture | |
| Keyword | |
| String | |
| Number | |
| List | |
| Spread | |
| Field | |
| Macro | |
| Namespace | |
| Unused | |
Definition at line 43 of file Common.hpp.
|
strong |
| Enumerator | |
|---|---|
| Interpret | Escape sequences and |
| Raw | Keep all text as is without modifying it (useful for the code formatter) |
Definition at line 30 of file Parser.hpp.
|
strong |
Enumeration to keep track of the type of Compiler Value.
| Enumerator | |
|---|---|
| Number | |
| String | |
| PageAddr | |
Definition at line 25 of file ValTableElem.hpp.
| std::size_t Ark::internal::codepointLength | ( | const std::string & | str | ) |
Definition at line 85 of file Utils.cpp.
Referenced by hookColor(), hookCompletion(), and hookHint().
| std::size_t Ark::internal::contextLen | ( | const std::string & | prefix | ) |
Definition at line 96 of file Utils.cpp.
Referenced by hookCompletion(), and hookHint().
| T Ark::internal::deserializeBE | ( | std::vector< uint8_t >::const_iterator | begin, |
| std::vector< uint8_t >::const_iterator | end ) |
Definition at line 56 of file IntegerSerializer.hpp.
Referenced by Ark::BytecodeReader::instLocations().
| T Ark::internal::deserializeLE | ( | std::vector< uint8_t >::const_iterator | begin, |
| std::vector< uint8_t >::const_iterator | end ) |
Definition at line 45 of file IntegerSerializer.hpp.
Referenced by Ark::BytecodeReader::values().
| IR::Entity Ark::internal::fuseMathOps2 | ( | const std::span< const IR::Entity > | e | ) |
Definition at line 17 of file IROptimizer.cpp.
Referenced by Ark::internal::IROptimizer::IROptimizer().
| IR::Entity Ark::internal::fuseMathOps3 | ( | const std::span< const IR::Entity > | e | ) |
Definition at line 12 of file IROptimizer.cpp.
Referenced by Ark::internal::IROptimizer::IROptimizer().
| std::vector< std::string > Ark::internal::getAllKeywords | ( | ) |
Compute a list of all the language keywords and builtins.
Definition at line 13 of file Utils.cpp.
References Ark::internal::Language::And, Ark::internal::Language::Apply, Ark::internal::Builtins::builtins, keywords, Ark::internal::Language::listInstructions, Ark::internal::Language::operators, and Ark::internal::Language::Or.
| std::vector< std::pair< std::string, replxx::Replxx::Color > > Ark::internal::getColorPerKeyword | ( | ) |
Compute a list of pairs (word -> color) to be used for coloration by the REPL.
Definition at line 42 of file Utils.cpp.
References Ark::internal::Language::And, Ark::internal::Language::Apply, Ark::internal::Builtins::builtins, keywords, Ark::internal::Language::listInstructions, Ark::internal::Language::operators, and Ark::internal::Language::Or.
| const Node & Ark::internal::getFalseNode | ( | ) |
Definition at line 418 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::MacroProcessor::evaluate().
| const Node & Ark::internal::getListNode | ( | ) |
Definition at line 430 of file Node.cpp.
References Symbol.
Referenced by Ark::internal::FunctionExecutor::applyMacro(), Ark::internal::MacroProcessor::evaluate(), and Ark::internal::FunctionExecutor::unify().
| const Node & Ark::internal::getNilNode | ( | ) |
Definition at line 424 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 412 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 135 of file Utils.cpp.
References codepointLength(), and colors.
Referenced by Ark::Repl::cuiSetup().
| replxx::Replxx::completions_t Ark::internal::hookCompletion | ( | const std::vector< std::string > & | words, |
| const std::string & | context, | ||
| int & | length ) |
Definition at line 111 of file Utils.cpp.
References codepointLength(), and contextLen().
Referenced by Ark::Repl::cuiSetup().
| 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 163 of file Utils.cpp.
References codepointLength(), and contextLen().
Referenced by Ark::Repl::cuiSetup().
Definition at line 89 of file Closure.hpp.
Definition at line 27 of file Namespace.hpp.
Definition at line 62 of file Closure.cpp.
|
noexcept |
Definition at line 38 of file ClosureScope.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.
Referenced by Ark::internal::Dict::Dict().
Definition at line 48 of file ScopeView.cpp.
| void Ark::internal::serializeOn2BytesToVecBE | ( | std::integral auto | number, |
| std::vector< uint8_t > & | out ) |
Definition at line 37 of file IntegerSerializer.hpp.
Referenced by Ark::internal::IRCompiler::compile(), Ark::internal::IRCompiler::pushFileHeader(), Ark::internal::IRCompiler::pushFilenameTable(), Ark::internal::IRCompiler::pushInstLocTable(), Ark::internal::IRCompiler::pushSymbolTable(), and Ark::internal::IRCompiler::pushValueTable().
| void Ark::internal::serializeOn2BytesToVecLE | ( | std::integral auto | number, |
| std::vector< uint8_t > & | out ) |
Definition at line 30 of file IntegerSerializer.hpp.
| void Ark::internal::serializeToVecBE | ( | std::integral auto | number, |
| std::vector< uint8_t > & | out ) |
Definition at line 18 of file IntegerSerializer.hpp.
Referenced by Ark::internal::IRCompiler::pushInstLocTable().
| void Ark::internal::serializeToVecLE | ( | std::integral auto | number, |
| std::vector< uint8_t > & | out ) |
Definition at line 10 of file IntegerSerializer.hpp.
Referenced by Ark::internal::IRCompiler::pushValueTable().
| std::optional< std::filesystem::path > Ark::internal::testExtensions | ( | const std::filesystem::path & | folder, |
| const std::string & | package_path ) |
Definition at line 191 of file ImportSolver.cpp.
Referenced by Ark::internal::ImportSolver::findFile().
|
inlinenoexcept |
| node |
Definition at line 280 of file Node.hpp.
References nodeTypes, and Symbol.
Referenced by Ark::internal::MacroProcessor::checkMacroTypeError(), Ark::internal::ASTLowerer::compileExpression(), Ark::internal::ASTLowerer::compileFunction(), Ark::internal::ASTLowerer::compileLetMutSet(), Ark::internal::MacroProcessor::evaluate(), and Ark::internal::MacroProcessor::registerFuncDef().
|
constexpr |
Definition at line 8 of file Logger.cpp.
Referenced by Ark::Repl::cuiSetup(), hookColor(), and Ark::internal::Logger::Logger().
|
constexpr |
Definition at line 20 of file ErrorKind.hpp.
Referenced by Ark::VM::throwVMError().
|
constexpr |
Definition at line 45 of file Instructions.hpp.
Referenced by Ark::internal::ASTLowerer::getOperator(), and Ark::internal::ASTLowerer::handleOperator().
|
constexpr |
Definition at line 104 of file Common.hpp.
Referenced by Ark::internal::NamespaceScope::add(), Ark::internal::NameResolutionPass::checkForUndefinedSymbol(), Ark::internal::NamespaceScope::get(), Ark::internal::ScopeResolver::getFullyQualifiedNameInNearestScope(), Ark::internal::NameResolutionPass::offerSuggestion(), and Ark::internal::NameResolutionPass::updateSymbolWithFullyQualifiedName().
|
constexpr |
Definition at line 47 of file Instructions.hpp.
Referenced by Ark::internal::IRCompiler::dumpToStream(), and Ark::BytecodeReader::printInstruction().
| 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::IsOct Ark::internal::IsOct |
| Ark::internal::IsSpace Ark::internal::IsSpace |
| Ark::internal::IsSymbol Ark::internal::IsSymbol |
|
constexpr |
List of available keywords in ArkScript.
Definition at line 92 of file Common.hpp.
Referenced by Formatter::format(), Formatter::formatVariable(), getAllKeywords(), getColorPerKeyword(), and Ark::internal::Node::repr().
|
constexpr |
Node types as string, in the same order as the enum NodeType.
Definition at line 61 of file Common.hpp.
Referenced by JsonCompiler::_compile(), Ark::internal::MacroProcessor::checkMacroTypeError(), Ark::internal::Parser::letMutSet(), and typeToString().