ArkScript
A small, fast, functional and scripting language for video games
Ark Namespace Reference

Namespaces

 internal
 
 literals
 
 types
 
 Utils
 

Classes

class  BytecodeReader
 This class is just a helper to. More...
 
class  Compiler
 The ArkScript bytecode compiler. More...
 
class  TypeError
 A type error triggered when types don't match. More...
 
class  ZeroDivisionError
 A special zero division error triggered when a number is divided by 0. More...
 
class  PowError
 A pow error triggered when we can't do a pow b. More...
 
class  AssertionFailed
 An assertion error, only triggered from ArkScript code through (assert expr error-message) More...
 
class  SyntaxError
 SyntaxError thrown by the lexer. More...
 
class  ParseError
 ParseError thrown by the parser. More...
 
class  OptimizerError
 OptimizerError thrown by the AST optimizer. More...
 
class  MacroProcessingError
 MacroProcessingError thrown by the compiler. More...
 
class  CompilationError
 CompilationError thrown by the compiler. More...
 
class  Repl
 
class  State
 Ark state to handle the dirty job of loading and compiling ArkScript code. More...
 
class  UserType
 A class to be use C++ objects in ArkScript. More...
 
class  Value
 
class  VM
 The ArkScript virtual machine, executing ArkScript bytecode. More...
 

Typedefs

using bytecode_t = std::vector< uint8_t >
 

Enumerations

enum class  BytecodeSegment {
  All , Symbols , Values , Code ,
  HeadersOnly
}
 
enum class  ValueType {
  List = 0 , Number = 1 , String = 2 , PageAddr = 3 ,
  CProc = 4 , Closure = 5 , User = 6 , Nil = 7 ,
  True = 8 , False = 9 , Undefined = 10 , Reference = 11 ,
  InstPtr = 12 , Any = 99
}
 

Functions

bool operator== (const UserType &A, const UserType &B) noexcept
 
bool operator< (const UserType &A[[maybe_unused]], const UserType &B[[maybe_unused]]) noexcept
 
std::ostream & operator<< (std::ostream &os, const UserType &A) noexcept
 

Variables

constexpr uint16_t FeatureRemoveUnusedVars = 1 << 4
 
constexpr uint16_t DefaultFeatures = FeatureRemoveUnusedVars
 
constexpr std::size_t VMStackSize = 8192
 
const std::vector< std::string > KeywordsDict
 
const std::vector< std::pair< std::string, Replxx::Color > > ColorsRegexDict
 
const std::array< std::string, 13 > types_to_str
 
const Value Nil = Value(ValueType::Nil)
 ArkScript Nil value. More...
 
const Value False = Value(ValueType::False)
 ArkScript False value. More...
 
const Value True = Value(ValueType::True)
 ArkScript True value. More...
 

Typedef Documentation

◆ bytecode_t

using Ark::bytecode_t = typedef std::vector<uint8_t>

Definition at line 22 of file Common.hpp.

Enumeration Type Documentation

◆ BytecodeSegment

enum Ark::BytecodeSegment
strong
Enumerator
All 
Symbols 
Values 
Code 
HeadersOnly 

Definition at line 27 of file BytecodeReader.hpp.

◆ ValueType

enum Ark::ValueType
strong
Enumerator
List 
Number 
String 
PageAddr 
CProc 
Closure 
User 
Nil 
True 
False 
Undefined 
Reference 
InstPtr 
Any 

Definition at line 39 of file Value.hpp.

Function Documentation

◆ operator<()

bool Ark::operator< ( const UserType &A]  [[maybe_unused],
const UserType &B]  [[maybe_unused] 
)
noexcept

Definition at line 16 of file UserType.cpp.

◆ operator<<()

std::ostream& Ark::operator<< ( std::ostream &  os,
const UserType A 
)
noexcept

Definition at line 21 of file UserType.cpp.

◆ operator==()

bool Ark::operator== ( const UserType A,
const UserType B 
)
noexcept

Definition at line 11 of file UserType.cpp.

Variable Documentation

◆ ColorsRegexDict

const std::vector<std::pair<std::string, Replxx::Color> > Ark::ColorsRegexDict

Definition at line 58 of file ConsoleStyle.hpp.

Referenced by Ark::Repl::cui_setup().

◆ DefaultFeatures

constexpr uint16_t Ark::DefaultFeatures = FeatureRemoveUnusedVars
constexpr

Definition at line 51 of file Constants.hpp.

Referenced by main().

◆ False

const Value Ark::False = Value(ValueType::False)

ArkScript False value.

Definition at line 339 of file VM.hpp.

◆ FeatureRemoveUnusedVars

constexpr uint16_t Ark::FeatureRemoveUnusedVars = 1 << 4
constexpr

Definition at line 48 of file Constants.hpp.

Referenced by Ark::internal::Optimizer::feed(), and main().

◆ KeywordsDict

const std::vector<std::string> Ark::KeywordsDict

Definition at line 21 of file ConsoleStyle.hpp.

Referenced by Ark::Repl::cui_setup().

◆ Nil

const Value Ark::Nil = Value(ValueType::Nil)

ArkScript Nil value.

Definition at line 337 of file VM.hpp.

Referenced by Ark::VM::safeRun().

◆ True

const Value Ark::True = Value(ValueType::True)

ArkScript True value.

Definition at line 341 of file VM.hpp.

◆ types_to_str

const std::array<std::string, 13> Ark::types_to_str
Initial value:
= {
"List", "Number", "String", "Function",
"CProc", "Closure", "UserType", "Nil",
"Bool", "Bool", "Undefined", "Reference",
"InstPtr"
}

Definition at line 59 of file Value.hpp.

Referenced by Ark::VM::safeRun(), and Ark::types::typeListToString().

◆ VMStackSize

constexpr std::size_t Ark::VMStackSize = 8192
constexpr

Definition at line 53 of file Constants.hpp.

Referenced by Ark::VM::safeRun().