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

Namespaces

namespace  internal
 
namespace  literals
 
namespace  types
 
namespace  Utils
 

Classes

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

std::ostream & operator<< (std::ostream &os, const Value &V) noexcept
 
bool operator== (const UserType &A, const UserType &B) noexcept
 
bool operator< (const UserType &A, const UserType &B) 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 class Ark::BytecodeSegment
strong
Enumerator
All 
Symbols 
Values 
Code 
HeadersOnly 

Definition at line 27 of file BytecodeReader.hpp.

◆ ValueType

enum class 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,
const UserType B 
)
noexcept

Definition at line 16 of file UserType.cpp.

◆ operator<<() [1/2]

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

Definition at line 21 of file UserType.cpp.

◆ operator<<() [2/2]

std::ostream & Ark::operator<< ( std::ostream &  os,
const Value V 
)
noexcept

Definition at line 151 of file Value.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 59 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 295 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 293 of file VM.hpp.

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

◆ True

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

ArkScript True value.

Definition at line 297 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().