C++ Reference

Generated from doxygen

struct AsebaAbstractTreeNode : public Aseba::Node
#include <tree.h>

Virtual class for abstraction nodes abort() if you try to typeCheck(), optimize() or emit() to force correct expansion into regular Aseba nodes.

Subclassed by Aseba::ArithmeticAssignmentNode, Aseba::MemoryVectorNode, Aseba::TupleVectorNode, Aseba::UnaryArithmeticAssignmentNode

Public Functions

Aseba::AbstractTreeNodeAbstractTreeNode(const SourcePos &sourcePos)

Constructor.

Node *Aseba::AbstractTreeNodeexpandAbstractNodes(std::wostream *dump) = 0

Second pass to expand “abstract” nodes into more concrete ones.

Generically traverse the tree, expand the children, and perform garbagge collection.

ReturnType Aseba::AbstractTreeNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::AbstractTreeNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::AbstractTreeNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::AbstractTreeNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

struct AsebaArithmeticAssignmentNode : public Aseba::AbstractTreeNode
#include <tree.h>

Node for operations like “vector (op)= something” Will expand to “vector = vector (op) something” children[0] is a MemoryVectorNode children[1] is whatever Node for the right operand.

Public Functions

Aseba::ArithmeticAssignmentNodeArithmeticAssignmentNode(const SourcePos &sourcePos, AsebaBinaryOperator op, Node *left, Node *right)

Constructor.

ArithmeticAssignmentNode *Aseba::ArithmeticAssignmentNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::ArithmeticAssignmentNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node *Aseba::ArithmeticAssignmentNodeexpandAbstractNodes(std::wostream *dump)

Expand “left (op)= right” to “left = left (op) right”.

Node *Aseba::ArithmeticAssignmentNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Third pass to expand vectorial operations into mutliple scalar ones.

Generic implementation for non-vectorial nodes.

std::wstring Aseba::ArithmeticAssignmentNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ArithmeticAssignmentNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaBinaryOperator Aseba::ArithmeticAssignmentNodeop

operator

Public Static Functions

ArithmeticAssignmentNode *Aseba::ArithmeticAssignmentNodefromArithmeticAssignmentToken(const SourcePos &sourcePos, Compiler::Token::Type token, Node *left, Node *right)

Protected Static Functions

AsebaBinaryOperator Aseba::ArithmeticAssignmentNodegetBinaryOperator(Compiler::Token::Type token)

Protected Static Attributes

const AsebaBinaryOperator Aseba::ArithmeticAssignmentNodeoperatorMap

= {

ASEBA_OP_ADD,

ASEBA_OP_SUB,

ASEBA_OP_MULT,

ASEBA_OP_DIV,

ASEBA_OP_MOD,

ASEBA_OP_SHIFT_LEFT,

ASEBA_OP_SHIFT_RIGHT,

ASEBA_OP_BIT_OR,

ASEBA_OP_BIT_XOR,

ASEBA_OP_BIT_AND

}


struct AsebaArrayReadNode : public Aseba::Node
#include <tree.h>

Node for reading from an array.

children[0] is the index in the array

Public Functions

Aseba::ArrayReadNodeArrayReadNode(const SourcePos &sourcePos, unsigned arrayAddr, unsigned arraySize, std::wstring arrayName)

Constructor.

ArrayReadNode *Aseba::ArrayReadNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::ArrayReadNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::ArrayReadNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::ArrayReadNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::ArrayReadNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ArrayReadNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::ArrayReadNodegetVectorAddr() const

return the address of the left-most operand, or E_NOVAL if none

unsigned Aseba::ArrayReadNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

unsigned Aseba::ArrayReadNodearrayAddr

address of the first element of the array

unsigned Aseba::ArrayReadNodearraySize

size of the array, might be used to assert compile-time access checks

std::wstring Aseba::ArrayReadNodearrayName

name of the array (for debug)

struct AsebaArrayWriteNode : public Aseba::Node
#include <tree.h>

Node for writing to an array.

Value to store is supposed to be on the stack already children[0] is the index in the array

Public Functions

Aseba::ArrayWriteNodeArrayWriteNode(const SourcePos &sourcePos, unsigned arrayAddr, unsigned arraySize, std::wstring arrayName)

Constructor.

ArrayWriteNode *Aseba::ArrayWriteNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::ArrayWriteNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::ArrayWriteNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::ArrayWriteNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::ArrayWriteNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ArrayWriteNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::ArrayWriteNodegetVectorAddr() const

return the address of the left-most operand, or E_NOVAL if none

unsigned Aseba::ArrayWriteNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

unsigned Aseba::ArrayWriteNodearrayAddr

address of the first element of the array

unsigned Aseba::ArrayWriteNodearraySize

size of the array, might be used to assert compile-time access checks

std::wstring Aseba::ArrayWriteNodearrayName

name of the array (for debug)

struct AsebaLocalEventDescription
#include <natives.h>

Description of a local event.

Public Members

const char *AsebaLocalEventDescriptionname

name of the function

const char *AsebaLocalEventDescriptiondoc

documentation of the local event

struct AsebaNativeFunctionArgumentDescription
#include <natives.h>

Description of an argument of a native function.

Public Members

int16_t AsebaNativeFunctionArgumentDescriptionsize

size of the argument in number of values; if negative, template parameter

const char *AsebaNativeFunctionArgumentDescriptionname

name of the argument

struct AsebaNativeFunctionDescription
#include <natives.h>

Description of a native function.

Public Members

const char *AsebaNativeFunctionDescriptionname

name of the function

const char *AsebaNativeFunctionDescriptiondoc

documentation of the function

AsebaNativeFunctionArgumentDescription AsebaNativeFunctionDescriptionarguments[]

arguments, terminated by an element of size 0

struct AsebaVariableDescription
#include <natives.h>

Description of a variable.

Public Members

uint16_t AsebaVariableDescriptionsize

size of the variable

const char *AsebaVariableDescriptionname

name of the variable

struct AsebaVMDescription
#include <natives.h>

Description of all variable.

Public Members

const char *AsebaVMDescriptionname

name of the microcontroller

AsebaVariableDescription AsebaVMDescriptionvariables[]

named variables, terminated by a variable of size 0

struct AsebaVMState
#include <vm.h>

This structure contains the state of the Aseba VM.

This is the required and the sufficient data for the VM to run. This is not sufficient for the compiler to build bytecode, as there is no description of variable names and sizes nor description of native function. For this, a description corresponding to the actual target must be provided to the compiler. ALL fields of this structure have to be initialized correctly for aseba to work. An initial call to AsebaVMInitStep must be done prior to any call to AsebaVMPeriodicStep or AsebaVMEventStep.

Public Members

uint16_t AsebaVMStatenodeId
uint16_t AsebaVMStatebytecodeSize

total amount of bytecode space

uint16_t *AsebaVMStatebytecode

bytecode space of size bytecodeSize

uint16_t AsebaVMStatevariablesSize

total amount of variables space

int16_t *AsebaVMStatevariables

variables of size variableCount

uint16_t AsebaVMStatestackSize

depth of execution stack

int16_t *AsebaVMStatestack

execution stack of size stackSize

uint16_t AsebaVMStateflags
uint16_t AsebaVMStatepc
int16_t AsebaVMStatesp
uint16_t AsebaVMStatebreakpoints[ASEBA_MAX_BREAKPOINTS]
uint16_t AsebaVMStatebreakpointsCount
struct AsebaAssignmentNode : public Aseba::Node
#include <tree.h>

Node for assignation.

children[0] is store code children[1] expression to store

Public Functions

Aseba::AssignmentNodeAssignmentNode(const SourcePos &sourcePos)

Constructor.

Aseba::AssignmentNodeAssignmentNode(const SourcePos &sourcePos, Node *left, Node *right)

Constructor.

AssignmentNode *Aseba::AssignmentNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::AssignmentNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node *Aseba::AssignmentNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Assignment between vectors is expanded into multiple scalar assignments.

Node::ReturnType Aseba::AssignmentNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::AssignmentNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::AssignmentNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::AssignmentNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::AssignmentNodetoNodeName() const

Return a string representation of the name of this node.

struct AsebaBinaryArithmeticNode : public Aseba::Node
#include <tree.h>

Node for binary arithmetic.

children[0] is left expression children[1] is right expression

Public Functions

Aseba::BinaryArithmeticNodeBinaryArithmeticNode(const SourcePos &sourcePos)
Aseba::BinaryArithmeticNodeBinaryArithmeticNode(const SourcePos &sourcePos, AsebaBinaryOperator op, Node *left, Node *right)

Constructor.

BinaryArithmeticNode *Aseba::BinaryArithmeticNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::BinaryArithmeticNodedeMorganNotRemoval()

Recursively apply de Morgan law as long as nodes are logic operations, and then invert comparisons.

Node::ReturnType Aseba::BinaryArithmeticNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::BinaryArithmeticNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::BinaryArithmeticNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::BinaryArithmeticNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::BinaryArithmeticNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::BinaryArithmeticNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaBinaryOperator Aseba::BinaryArithmeticNodeop

operator

Public Static Functions

BinaryArithmeticNode *Aseba::BinaryArithmeticNodefromComparison(const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)

Create a binary arithmetic node for comparaison operation op.

BinaryArithmeticNode *Aseba::BinaryArithmeticNodefromShiftExpression(const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)

Create a binary arithmetic node for shift operation op.

BinaryArithmeticNode *Aseba::BinaryArithmeticNodefromAddExpression(const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)

Create a binary arithmetic node for add/sub operation op.

BinaryArithmeticNode *Aseba::BinaryArithmeticNodefromMultExpression(const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)

Create a binary arithmetic node for mult/div/mod operation op.

BinaryArithmeticNode *Aseba::BinaryArithmeticNodefromBinaryExpression(const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right)

Create a binary arithmetic node for or/xor/and operation op.

struct AsebaBlockNode : public Aseba::Node
#include <tree.h>

Node for L”block”, i.e. a vector of statements.

Subclassed by Aseba::ProgramNode

Public Functions

Aseba::BlockNodeBlockNode(const SourcePos &sourcePos)

Constructor.

BlockNode *Aseba::BlockNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::BlockNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::BlockNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::BlockNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::BlockNodetoNodeName() const

Return a string representation of the name of this node.

struct AsebaBytecodeElement
#include <compiler.h>

A bytecode element.

Public Functions

Aseba::BytecodeElementBytecodeElement()
Aseba::BytecodeElementBytecodeElement(unsigned short bytecode)
Aseba::BytecodeElementBytecodeElement(unsigned short bytecode, unsigned short line)
Aseba::BytecodeElementoperator unsigned short() const
unsigned Aseba::BytecodeElementgetWordSize() const

Return the number of words this element takes in memory.

Public Members

unsigned short Aseba::BytecodeElementbytecode = {0xffff}
unsigned short Aseba::BytecodeElementline = {0}

bytecode itself

line in source code

struct AsebaBytecodeVector : public std::deque<BytecodeElement>
#include <compiler.h>

Bytecode array in the form of a dequeue, for construction.

Public Types

typedef std::map<unsigned, unsigned> Aseba::BytecodeVectorEventAddressesToIdsMap

A map of event addresses to identifiers.

Public Functions

Aseba::BytecodeVectorBytecodeVector()

Constructor.

void Aseba::BytecodeVectorpush_back(const BytecodeElement &be)
void Aseba::BytecodeVectorchangeStopToRetSub()

Change “stop” bytecode to “return from subroutine”.

unsigned short Aseba::BytecodeVectorgetTypeOfLast() const

Return the type of last bytecode element.

BytecodeVector::EventAddressesToIdsMap Aseba::BytecodeVectorgetEventAddressesToIds() const

Get the map of event addresses to identifiers.

Public Members

unsigned Aseba::BytecodeVectormaxStackDepth = {0}

maximum depth of the stack used by all the computations of the bytecode

unsigned Aseba::BytecodeVectorcallDepth = {0}

for callable bytecode (i.e.

subroutines), used in analysis of stack check

unsigned Aseba::BytecodeVectorlastLine = {0}

last line added, normally equal *this[this->size()-1].line, but may differ for instance on loops

struct AsebaCallNode : public Aseba::Node
#include <tree.h>

Node for calling a native function may have children for pushing constants somewhere.

Public Functions

Aseba::CallNodeCallNode(const SourcePos &sourcePos, unsigned funcId)

Constructor.

CallNode *Aseba::CallNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::CallNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::CallNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::CallNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::CallNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::CallNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::CallNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

unsigned Aseba::CallNodefuncId

identifier of the function to be called

std::vector<unsigned> Aseba::CallNodetemplateArgs

sizes of templated arguments

struct AsebaCallSubNode : public Aseba::Node
#include <tree.h>

Node for L”callsub” no children.

Public Functions

Aseba::CallSubNodeCallSubNode(const SourcePos &sourcePos, std::wstring subroutineName)

Constructor.

CallSubNode *Aseba::CallSubNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node::ReturnType Aseba::CallSubNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::CallSubNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::CallSubNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::CallSubNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::CallSubNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

std::wstring Aseba::CallSubNodesubroutineName

the subroutine to call

unsigned Aseba::CallSubNodesubroutineId
struct AsebaCommonDefinitions
#include <compiler.h>

Definitions common to several nodes, such as events or some constants.

Public Functions

void Aseba::CommonDefinitionsclear()

Clear all the content.

Public Members

EventsDescriptionsVector Aseba::CommonDefinitionsevents

All defined events.

ConstantsDefinitions Aseba::CommonDefinitionsconstants

All globally defined constants.

class AsebaCompiler
#include <compiler.h>

Aseba Event Scripting Language compiler.

Public Types

using Aseba::CompilerSubroutineTable = std::vector<SubroutineDescriptor>

Lookup table for subroutines id => (name, address, line)

typedef std::map<std::wstring, unsigned> Aseba::CompilerSubroutineReverseTable

Reverse Lookup table for subroutines name => id.

using Aseba::CompilerImplementedEvents = std::set<unsigned int>

Lookup table to keep track of implemented events.

typedef std::map<std::wstring, int> Aseba::CompilerConstantsMap

Lookup table for constant name => value.

typedef std::map<std::wstring, unsigned> Aseba::CompilerEventsMap

Lookup table for event name => id.

Public Functions

Aseba::CompilerCompiler()

Constructor.

You must setup a description using setTargetDescription() before any call to compile().

void Aseba::CompilersetTargetDescription(const TargetDescription *description)

Set the description of the target as returned by the microcontroller.

You must call this function before any call to compile().

const TargetDescription *Aseba::CompilergetTargetDescription() const
const VariablesMap *Aseba::CompilergetVariablesMap() const
const SubroutineTable *Aseba::CompilergetSubroutineTable() const
void Aseba::CompilersetCommonDefinitions(const CommonDefinitions *definitions)

Set the common definitions, such as events or some constants.

bool Aseba::Compilercompile(std::wistream &source, BytecodeVector &bytecode, unsigned &allocatedVariablesCount, Error &errorDescription, std::wostream *dump = nullptr)

Compile a new condition.

Return
returns true on success
Parameters
  • source: stream to read the source code from
  • bytecode: destination array for bytecode
  • allocatedVariablesCount: amount of allocated variables
  • errorDescription: error is copied there on error
  • dump: stream to send dump messages to

void Aseba::CompilersetTranslateCallback(ErrorMessages::ErrorCallback newCB)

Public Static Functions

static std::wstring Aseba::Compilertranslate(ErrorCode error)
bool Aseba::CompilerisKeyword(const std::wstring &word)

Return whether a string is a language keyword.

Protected Functions

void Aseba::CompilerinternalCompilerError() const

There is a bug in the compiler, ask for a bug report.

void Aseba::Compilerexpect(const Token::Type &type) const

Check if next token is of type, produce an exception otherwise.

unsigned Aseba::CompilerexpectUInt12Literal() const

Check if next token is an unsigned 12 bits integer literal.

If so, return it, if not, throw an exception

unsigned Aseba::CompilerexpectUInt16Literal() const

Check if next token is an unsigned 16 bits integer literal.

If so, return it, if not, throw an exception

unsigned Aseba::CompilerexpectPositiveInt16Literal() const

Check if next token is the positive part of a 16 bits signed integer literal.

If so, return it, if not, throw an exception

int Aseba::CompilerexpectAbsoluteInt16Literal(bool negative) const

Check if next token is the absolute part of a 16 bits signed integer literal.

If so, return it, if not, throw an exception

unsigned Aseba::CompilerexpectPositiveConstant() const

Check if next toxen is a valid positive part of a 16 bits signed integer constant.

int Aseba::CompilerexpectConstant() const

Check if next toxen is a valid 16 bits signed integer constant.

unsigned Aseba::CompilerexpectPositiveInt16LiteralOrConstant() const

Check and return either the positive part of a 16 bits signed integer or the value of a valid constant.

int Aseba::CompilerexpectInt16Literal()

Check and return a 16 bits signed integer.

int Aseba::CompilerexpectInt16LiteralOrConstant()

Check and return either a 16 bits signed integer or the value of a valid constant.

unsigned Aseba::CompilerexpectGlobalEventId() const

Check if next token is a known global event identifier.

unsigned Aseba::CompilerexpectAnyEventId() const

Check if next token is a known local or global event identifier.

std::wstring Aseba::CompilereventName(unsigned eventId) const

Return the name of an event given its identifier.

template <int length>
bool Aseba::CompilerisOneOf(const Token::Type types[length]) const

Return true if next token is of the following types.

template <int length>
void Aseba::CompilerexpectOneOf(const Token::Type types[length]) const

Check if next token is of one of the following types, produce an exception otherwise.

void Aseba::CompilerfreeTemporaryMemory()
unsigned Aseba::CompilerallocateTemporaryMemory(const SourcePos varPos, const unsigned size)
AssignmentNode *Aseba::CompilerallocateTemporaryVariable(const SourcePos varPos, Node *rValue)
VariablesMap::const_iterator Aseba::CompilerfindVariable(const std::wstring &name, const SourcePos &pos) const

Look for a variable of a given name, and if found, return an iterator; if not, return an exception.

FunctionsMap::const_iterator Aseba::CompilerfindFunction(const std::wstring &name, const SourcePos &pos) const

Look for a function of a given name, and if found, return an iterator; if not, return an exception.

Compiler::ConstantsMap::const_iterator Aseba::CompilerfindConstant(const std::wstring &name, const SourcePos &pos) const

Look for a constant of a given name, and if found, return an iterator; if not, return an exception.

Compiler::EventsMap::const_iterator Aseba::CompilerfindGlobalEvent(const std::wstring &name, const SourcePos &pos) const

Look for a global event of a given name, and if found, return an iterator; if not, return an exception.

Compiler::EventsMap::const_iterator Aseba::CompilerfindAnyEvent(const std::wstring &name, const SourcePos &pos) const
Compiler::SubroutineReverseTable::const_iterator Aseba::CompilerfindSubroutine(const std::wstring &name, const SourcePos &pos) const

Look for a subroutine of a given name, and if found, return an iterator; if not, return an exception.

bool Aseba::CompilerconstantExists(const std::wstring &name) const

Return true if a constant of a given name exists.

void Aseba::CompilerbuildMaps()

Build variables and functions maps.

void Aseba::Compilertokenize(std::wistream &source)

Parse source and build tokens vector.

Parameters
  • source: source code

wchar_t Aseba::CompilergetNextCharacter(std::wistream &source, SourcePos &pos)
bool Aseba::CompilertestNextCharacter(std::wistream &source, SourcePos &pos, wchar_t test, Token::Type tokenIfTrue)
void Aseba::CompilerdumpTokens(std::wostream &dest) const

Debug print of tokens.

bool Aseba::CompilerverifyStackCalls(PreLinkBytecode &preLinkBytecode)

Verify that no call path can create a stack overflow.

bool Aseba::Compilerlink(const PreLinkBytecode &preLinkBytecode, BytecodeVector &bytecode)

Create the final bytecode for a microcontroller.

void Aseba::Compilerdisassemble(BytecodeVector &bytecode, const PreLinkBytecode &preLinkBytecode, std::wostream &dump) const

Disassemble a microcontroller bytecode and dump it.

Node *Aseba::CompilerparseProgram()

Parse “program” grammar element.

Node *Aseba::CompilerparseStatement()

Parse “statement” grammar element.

Node *Aseba::CompilerparseBlockStatement()

Parse “block statement” grammar element.

Node *Aseba::CompilerparseReturn()

Parse “return statement” grammar element.

void Aseba::CompilerparseConstDef()

Parse “const def” elements.

Node *Aseba::CompilerparseVarDef()

Parse “var def” grammar element.

AssignmentNode *Aseba::CompilerparseVarDefInit(MemoryVectorNode *lValue)
Node *Aseba::CompilerparseAssignment()

Parse “assignment” grammar element.

Node *Aseba::CompilerparseIfWhen(bool edgeSensitive)

Parse “if” grammar element.

Node *Aseba::CompilerparseFor()

Parse “for” grammar element.

Node *Aseba::CompilerparseWhile()

Parse “while” grammar element.

Node *Aseba::CompilerparseOnEvent()

Parse “onevent” grammar element.

Node *Aseba::CompilerparseEmit(bool shorterArgsAllowed = false)

Parse “event” grammar element.

Node *Aseba::CompilerparseSubDecl()

Parse “sub” grammar element, declaration of subroutine.

Node *Aseba::CompilerparseCallSub()

Parse “subcall” grammar element, call of subroutine.

Node *Aseba::CompilerparseOr()

Parse “or” grammar element.

Node *Aseba::CompilerparseAnd()

Parse “and” grammar element.

Node *Aseba::CompilerparseNot()

Parse “not” grammar element.

Node *Aseba::CompilerparseCondition()

Parse “condition” grammar element.

Node *Aseba::CompilerparseBinaryOrExpression()

Parse “binary or” grammar element.

Node *Aseba::CompilerparseBinaryXorExpression()

Parse “binary xor” grammar element.

Node *Aseba::CompilerparseBinaryAndExpression()

Parse “binary and” grammar element.

Node *Aseba::CompilerparseShiftExpression()

Parse “shift_expression” grammar element.

Node *Aseba::CompilerparseAddExpression()

Parse “add_expression” grammar element.

Node *Aseba::CompilerparseMultExpression()

Parse “mult_expression” grammar element.

Node *Aseba::CompilerparseUnaryExpression()

Parse “unary_expression” grammar element.

Node *Aseba::CompilerparseFunctionCall()

Parse “function_call” grammar element.

TupleVectorNode *Aseba::CompilerparseTupleVector(bool compatibility = false)

Parse “[ …. ]” grammar element.

Node *Aseba::CompilerparseConstantAndVariable()
MemoryVectorNode *Aseba::CompilerparseVariable()
unsigned Aseba::CompilerparseVariableDefSize()
Node *Aseba::CompilertryParsingConstantExpression(SourcePos pos, int &constantResult)

Use parseBinaryOrExpression() and try to reduce the result into an integer If successful, return nullptr and the integer in constantResult If unsuccessful, return the parsed tree (constantResult useless in this case)

int Aseba::CompilerexpectConstantExpression(SourcePos pos, Node *tree)

This is a generalization of expectPositiveInt16LiteralOrConstant() Try to reduce the expression into a single figure, if not raise an exception The tree pointed by “tree” is deleted during execution, not safe to use it after.

Protected Attributes

std::deque<Token> Aseba::Compilertokens

parsed tokens

VariablesMap Aseba::CompilervariablesMap

variables lookup

ImplementedEvents Aseba::CompilerimplementedEvents

list of implemented events

FunctionsMap Aseba::CompilerfunctionsMap

functions lookup

ConstantsMap Aseba::CompilerconstantsMap

constants map

EventsMap Aseba::CompilerglobalEventsMap

global-events map

EventsMap Aseba::CompilerallEventsMap

all-events map

SubroutineTable Aseba::CompilersubroutineTable

subroutine lookup

SubroutineReverseTable Aseba::CompilersubroutineReverseTable

subroutine reverse lookup

unsigned Aseba::CompilerfreeVariableIndex

index pointing to the first free variable

unsigned Aseba::CompilerendVariableIndex

(endMemory - endVariableIndex) is pointing to the first free variable at the end

const TargetDescription *Aseba::CompilertargetDescription

description of the target VM

const CommonDefinitions *Aseba::CompilercommonDefinitions

common definitions, such as events or some constants

ErrorMessages Aseba::Compilertranslator

Friends

friend Aseba::Compiler::AssignmentNode
friend Aseba::Compiler::CallSubNode
struct AsebaEmitNode : public Aseba::Node
#include <tree.h>

Node for L”emit”.

may have children for pushing constants somewhere

Public Functions

Aseba::EmitNodeEmitNode(const SourcePos &sourcePos)

Constructor.

EmitNode *Aseba::EmitNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::EmitNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::EmitNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::EmitNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::EmitNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::EmitNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

unsigned Aseba::EmitNodeeventId

id of event to emit

unsigned Aseba::EmitNodearrayAddr

address of the first element of the array to send

unsigned Aseba::EmitNodearraySize

size of the array to send.

0 if event has no argument

struct AsebaError
#include <compiler.h>

Compilation error.

Subclassed by Aseba::TranslatableError

Public Functions

Aseba::ErrorError(const SourcePos &pos, std::wstring message)

Create an error at pos.

Aseba::ErrorError()

Create an empty error.

std::wstring Aseba::ErrortoWString() const

Return a string describing the error.

Return the string version of this error.

Public Members

SourcePos Aseba::Errorpos

position of error in source string

std::wstring Aseba::Errormessage = L"not defined"

message

struct AsebaErrorMessages
#include <compiler.h>

Return error messages based on error ID (needed to translate messages for other applications)

Public Types

using Aseba::ErrorMessagesErrorCallback = const std::wstring (*)(ErrorCode)

Type of the callback.

Public Functions

Aseba::ErrorMessagesErrorMessages()

Public Static Functions

const std::wstring Aseba::ErrorMessagesdefaultCallback(ErrorCode error)

Default callback.

struct AsebaEventDeclNode : public Aseba::Node
#include <tree.h>

Node for L”onevent” no children.

Public Functions

Aseba::EventDeclNodeEventDeclNode(const SourcePos &sourcePos, unsigned eventId = 0)

Constructor.

EventDeclNode *Aseba::EventDeclNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::EventDeclNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::EventDeclNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::EventDeclNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::EventDeclNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::EventDeclNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

unsigned Aseba::EventDeclNodeeventId

the event id associated with this context

struct AsebaFoldedIfWhenNode : public Aseba::Node
#include <tree.h>

Node for L”if” and L”when” with operator folded inside.

children[0] is left part of expression children[1] is right part of expression children[2] is true block children[3] is false block

Public Functions

Aseba::FoldedIfWhenNodeFoldedIfWhenNode(const SourcePos &sourcePos)

Constructor.

FoldedIfWhenNode *Aseba::FoldedIfWhenNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::FoldedIfWhenNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node *Aseba::FoldedIfWhenNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::FoldedIfWhenNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::FoldedIfWhenNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::FoldedIfWhenNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::FoldedIfWhenNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaBinaryOperator Aseba::FoldedIfWhenNodeop

operator

bool Aseba::FoldedIfWhenNodeedgeSensitive

if true, true block is triggered only if previous comparison was false (“when” block).

If false, true block is triggered every time comparison is true

unsigned Aseba::FoldedIfWhenNodeendLine

line of end keyword

struct AsebaFoldedWhileNode : public Aseba::Node
#include <tree.h>

Node for L”while” with operator folded inside.

children[0] is left part of expression children[1] is right part of expression children[2] is block

Public Functions

Aseba::FoldedWhileNodeFoldedWhileNode(const SourcePos &sourcePos)

Constructor.

FoldedWhileNode *Aseba::FoldedWhileNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::FoldedWhileNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node *Aseba::FoldedWhileNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::FoldedWhileNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::FoldedWhileNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::FoldedWhileNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::FoldedWhileNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaBinaryOperator Aseba::FoldedWhileNodeop

operator

struct AsebaIfWhenNode : public Aseba::Node
#include <tree.h>

Node for L”if” and L”when”.

children[0] is expression children[1] is true block children[2] is false block

Public Functions

Aseba::IfWhenNodeIfWhenNode(const SourcePos &sourcePos)

Constructor.

IfWhenNode *Aseba::IfWhenNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::IfWhenNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node::ReturnType Aseba::IfWhenNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::IfWhenNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::IfWhenNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::IfWhenNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::IfWhenNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

bool Aseba::IfWhenNodeedgeSensitive

if true, true block is triggered only if previous comparison was false (“when” block).

If false, true block is triggered every time comparison is true

unsigned Aseba::IfWhenNodeendLine

line of end keyword

struct AsebaImmediateNode : public Aseba::Node
#include <tree.h>

Node for pushing immediate value on stack.

Might generate either Small Immediate or Large Immediate bytecode depending on the range of value no children

Public Functions

Aseba::ImmediateNodeImmediateNode(const SourcePos &sourcePos, int value)

Constructor.

ImmediateNode *Aseba::ImmediateNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::ImmediateNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Expand into a copy of itself.

ReturnType Aseba::ImmediateNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::ImmediateNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::ImmediateNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::ImmediateNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::ImmediateNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ImmediateNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::ImmediateNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

int Aseba::ImmediateNodevalue

value to push on stack

struct AsebaLoadNativeArgNode : public Aseba::Node
#include <tree.h>

Node for loading the address of the argument of a native function that is not known at compile time, but that does exist in memory.

Public Functions

Aseba::LoadNativeArgNodeLoadNativeArgNode(MemoryVectorNode *memoryNode, unsigned tempAddr)

Constructor, delete the provided memoryNode.

LoadNativeArgNode *Aseba::LoadNativeArgNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::LoadNativeArgNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::LoadNativeArgNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::LoadNativeArgNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::LoadNativeArgNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::LoadNativeArgNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::LoadNativeArgNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

unsigned Aseba::LoadNativeArgNodetempAddr

address of temporary (end of memory) for stack value duplication

unsigned Aseba::LoadNativeArgNodearrayAddr

address of the first element of the array

unsigned Aseba::LoadNativeArgNodearraySize

size of the array, might be used to assert compile-time access checks

std::wstring Aseba::LoadNativeArgNodearrayName

name of the array (for debug)

struct AsebaLoadNode : public Aseba::Node
#include <tree.h>

Node for loading a variable on stack.

no children

Public Functions

Aseba::LoadNodeLoadNode(const SourcePos &sourcePos, unsigned varAddr)

Constructor.

LoadNode *Aseba::LoadNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::LoadNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::LoadNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::LoadNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::LoadNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::LoadNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::LoadNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::LoadNodegetVectorAddr() const

return the address of the left-most operand, or E_NOVAL if none

unsigned Aseba::LoadNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

unsigned Aseba::LoadNodevarAddr

address of variable to load from

struct AsebaMemoryVectorNode : public Aseba::AbstractTreeNode
#include <tree.h>

Node for accessing a memory as a vector, in read or write operations If write == true, will expand to StoreNode or ArrayWriteNode If write == false, will expand to LoadNode or ArrayReadNode children[0] is an optional index If children[0] is a TupleVectorNode of one elements (int), it will be foo[x] If children[0] is a TupleVectorNode of two elements (int), it will be foo[x:y] If children[0] is another type of node, it will be foo[whatever] If children[0] doesn’t exist, access to the full array is considered.

Public Functions

Aseba::MemoryVectorNodeMemoryVectorNode(const SourcePos &sourcePos, unsigned arrayAddr, unsigned arraySize, std::wstring arrayName)

Constructor.

MemoryVectorNode *Aseba::MemoryVectorNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::MemoryVectorNodeexpandAbstractNodes(std::wostream *dump)

Dummy function, the node will be expanded during the vectorial pass.

Node *Aseba::MemoryVectorNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Expand to memory[index].

std::wstring Aseba::MemoryVectorNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::MemoryVectorNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::MemoryVectorNodegetVectorAddr() const

return the compile-time base address of the memory range, taking into account an immediate index foo[n] or foo[n:m] return E_NOVAL if foo[expr]

unsigned Aseba::MemoryVectorNodegetVectorSize() const

return the vector’s length

bool Aseba::MemoryVectorNodeisAddressStatic() const

return whether this node accesses a static address

virtual void Aseba::MemoryVectorNodesetWrite(bool write)

Public Members

unsigned Aseba::MemoryVectorNodearrayAddr

address of the first element of the array

unsigned Aseba::MemoryVectorNodearraySize

size of the array, might be used to assert compile-time access checks

std::wstring Aseba::MemoryVectorNodearrayName

name of the array (for debug)

bool Aseba::MemoryVectorNodewrite

expand to a node for storing or loading data?

struct AsebaNamedValue
#include <compiler.h>

A name - value pair.

Public Functions

Aseba::NamedValueNamedValue(std::wstring name, int value)

Create a filled pair.

Public Members

std::wstring Aseba::NamedValuename

name part of the pair

int Aseba::NamedValuevalue

value part of the pair

struct AsebaNamedValuesVector : public std::vector<NamedValue>
#include <compiler.h>

Generic vector of name - value pairs.

Public Functions

bool Aseba::NamedValuesVectorcontains(const std::wstring &s, size_t *position = nullptr) const

Return whether a named-value vector contains a certain value, by iterating.

struct AsebaNode
#include <tree.h>

An abstract node of syntax tree.

Subclassed by Aseba::AbstractTreeNode, Aseba::ArrayReadNode, Aseba::ArrayWriteNode, Aseba::AssignmentNode, Aseba::BinaryArithmeticNode, Aseba::BlockNode, Aseba::CallNode, Aseba::CallSubNode, Aseba::EmitNode, Aseba::EventDeclNode, Aseba::FoldedIfWhenNode, Aseba::FoldedWhileNode, Aseba::IfWhenNode, Aseba::ImmediateNode, Aseba::LoadNativeArgNode, Aseba::LoadNode, Aseba::ReturnNode, Aseba::StoreNode, Aseba::SubDeclNode, Aseba::UnaryArithmeticNode, Aseba::WhileNode

Public Types

enum Aseba::NodeReturnType

A type a node can return.

Values:

Aseba::NodeUNIT = 0
Aseba::NodeBOOL
Aseba::NodeINT
enum Aseba::NodeMemoryErrorCode

Values:

Aseba::NodeE_NOVAL = UINT_MAX
using Aseba::NodeNodesVector = std::vector<Node *>

Vector for children of a node.

Public Functions

Aseba::NodeNode(const SourcePos &sourcePos)

Constructor.

Node &Aseba::Nodeoperator=(const Node&)
Aseba::NodeNode(Node&&)
Node &Aseba::Nodeoperator=(Node &&rhs)
Aseba::Node~Node()

Destructor, delete all children.

virtual Node *Aseba::NodeshallowCopy() const = 0

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::NodedeepCopy() const

Return a deep copy of the object (children are also copied)

void Aseba::NodecheckVectorSize() const

Check the consistency in vectors’ size.

Node *Aseba::NodeexpandAbstractNodes(std::wostream *dump)

Second pass to expand “abstract” nodes into more concrete ones.

Generically traverse the tree, expand the children, and perform garbagge collection.

Node *Aseba::NodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Third pass to expand vectorial operations into mutliple scalar ones.

Generic implementation for non-vectorial nodes.

Node::ReturnType Aseba::NodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

virtual Node *Aseba::Nodeoptimize(std::wostream *dump) = 0

Optimize this node, return the optimized node.

unsigned Aseba::NodegetStackDepth() const

Return the stack depth requirement for this node and its children.

virtual void Aseba::Nodeemit(PreLinkBytecode &bytecodes) const = 0

Generate bytecode.

virtual std::wstring Aseba::NodetoWString() const = 0

Return a string representation of this node.

virtual std::wstring Aseba::NodetoNodeName() const = 0

Return a string representation of the name of this node.

void Aseba::Nodedump(std::wostream &dest, unsigned &indent) const

Dump this node and the rest of the tree.

std::wstring Aseba::NodetypeName(const Node::ReturnType &type) const

Return the name of a type.

void Aseba::NodeexpectType(const Node::ReturnType &expected, const Node::ReturnType &type) const

Check for a specific type, throw an exception otherwise.

unsigned Aseba::NodegetVectorAddr() const

return the address of the left-most operand, or E_NOVAL if none

unsigned Aseba::NodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

NodesVector Aseba::Nodechildren

children of this node

SourcePos Aseba::NodesourcePos

position is source

Protected Functions

Aseba::NodeNode(const Node&)
struct AsebaPreLinkBytecode
#include <compiler.h>

Bytecode use for compilation previous to linking.

Public Types

typedef std::map<unsigned, BytecodeVector> Aseba::PreLinkBytecodeEventsBytecode

Map of events id to event bytecode.

typedef std::map<unsigned, BytecodeVector> Aseba::PreLinkBytecodeSubroutinesBytecode

Map of routines id to routine bytecode.

Public Functions

Aseba::PreLinkBytecodePreLinkBytecode()

Add init event and point to currentBytecode it.

void Aseba::PreLinkBytecodefixup(const Compiler::SubroutineTable &subroutineTable)

Fixup prelinked bytecodes by making sure that each vector is closed correctly, i.e.

with a STOP for events and a RET for subroutines

Public Members

EventsBytecode Aseba::PreLinkBytecodeevents

bytecode for events

SubroutinesBytecode Aseba::PreLinkBytecodesubroutines

bytecode for routines

BytecodeVector *Aseba::PreLinkBytecodecurrent

pointer to bytecode being constructed

struct AsebaProgramNode : public Aseba::BlockNode
#include <tree.h>

Node for L”program”, i.e. a block node with some special behaviour later on.

Public Functions

Aseba::ProgramNodeProgramNode(const SourcePos &sourcePos)

Constructor.

ProgramNode *Aseba::ProgramNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::ProgramNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

This is the root node, take in charge the tree creation / deletion.

void Aseba::ProgramNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::ProgramNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ProgramNodetoNodeName() const

Return a string representation of the name of this node.

struct AsebaReturnNode : public Aseba::Node
#include <tree.h>

Node for returning from an event or subroutine has no children, just a jump of 0 offset that will be resolved at link time.

Public Functions

Aseba::ReturnNodeReturnNode(const SourcePos &sourcePos)
ReturnNode *Aseba::ReturnNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::ReturnNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::ReturnNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

unsigned Aseba::ReturnNodegetStackDepth() const

Return the stack depth requirement for this node and its children.

void Aseba::ReturnNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::ReturnNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::ReturnNodetoNodeName() const

Return a string representation of the name of this node.

struct AsebaSourcePos
#include <compiler.h>

Position in a source file or string. First is line, second is column.

Public Functions

Aseba::SourcePosSourcePos(unsigned character, unsigned row, unsigned column)
Aseba::SourcePosSourcePos()
std::wstring Aseba::SourcePostoWString() const

Return the string version of this position.

Public Members

unsigned Aseba::SourcePoscharacter = {0}

position in source text

unsigned Aseba::SourcePosrow = {0}

line in source text

unsigned Aseba::SourcePoscolumn = {0}

column in source text

bool Aseba::SourcePosvalid = {false}

true if character, row and column hold valid values

struct AsebaStoreNode : public Aseba::Node
#include <tree.h>

Node for storing a variable from stack.

no children

Public Functions

Aseba::StoreNodeStoreNode(const SourcePos &sourcePos, unsigned varAddr)

Constructor.

StoreNode *Aseba::StoreNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::StoreNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::StoreNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::StoreNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::StoreNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::StoreNodetoNodeName() const

Return a string representation of the name of this node.

unsigned Aseba::StoreNodegetVectorAddr() const

return the address of the left-most operand, or E_NOVAL if none

unsigned Aseba::StoreNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

Public Members

unsigned Aseba::StoreNodevarAddr

address of variable to store to

struct AsebaSubDeclNode : public Aseba::Node
#include <tree.h>

Node for L”sub” no children.

Public Functions

Aseba::SubDeclNodeSubDeclNode(const SourcePos &sourcePos, unsigned subroutineId)

Constructor.

SubDeclNode *Aseba::SubDeclNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

ReturnType Aseba::SubDeclNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::SubDeclNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::SubDeclNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::SubDeclNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::SubDeclNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

unsigned Aseba::SubDeclNodesubroutineId

the associated subroutine

struct Aseba::CompilerSubroutineDescriptor
#include <compiler.h>

Description of a subroutine.

Public Functions

Aseba::Compiler::SubroutineDescriptorSubroutineDescriptor(std::wstring name, unsigned address, unsigned line)

Public Members

std::wstring Aseba::Compiler::SubroutineDescriptorname
unsigned Aseba::Compiler::SubroutineDescriptoraddress
unsigned Aseba::Compiler::SubroutineDescriptorline
struct Aseba::CompilerToken
#include <compiler.h>

A token is a parsed element of inputs.

Public Types

enum Aseba::Compiler::TokenType

Values:

Aseba::Compiler::TokenTOKEN_END_OF_STREAM = 0
Aseba::Compiler::TokenTOKEN_STR_when
Aseba::Compiler::TokenTOKEN_STR_emit
Aseba::Compiler::TokenTOKEN_STR_hidden_emit
Aseba::Compiler::TokenTOKEN_STR_for
Aseba::Compiler::TokenTOKEN_STR_in
Aseba::Compiler::TokenTOKEN_STR_step
Aseba::Compiler::TokenTOKEN_STR_while
Aseba::Compiler::TokenTOKEN_STR_do
Aseba::Compiler::TokenTOKEN_STR_if
Aseba::Compiler::TokenTOKEN_STR_then
Aseba::Compiler::TokenTOKEN_STR_else
Aseba::Compiler::TokenTOKEN_STR_elseif
Aseba::Compiler::TokenTOKEN_STR_end
Aseba::Compiler::TokenTOKEN_STR_var
Aseba::Compiler::TokenTOKEN_STR_const
Aseba::Compiler::TokenTOKEN_STR_call
Aseba::Compiler::TokenTOKEN_STR_sub
Aseba::Compiler::TokenTOKEN_STR_callsub
Aseba::Compiler::TokenTOKEN_STR_onevent
Aseba::Compiler::TokenTOKEN_STR_abs
Aseba::Compiler::TokenTOKEN_STR_return
Aseba::Compiler::TokenTOKEN_STRING_LITERAL
Aseba::Compiler::TokenTOKEN_INT_LITERAL
Aseba::Compiler::TokenTOKEN_PAR_OPEN
Aseba::Compiler::TokenTOKEN_PAR_CLOSE
Aseba::Compiler::TokenTOKEN_BRACKET_OPEN
Aseba::Compiler::TokenTOKEN_BRACKET_CLOSE
Aseba::Compiler::TokenTOKEN_COLON
Aseba::Compiler::TokenTOKEN_COMMA
Aseba::Compiler::TokenTOKEN_ASSIGN
Aseba::Compiler::TokenTOKEN_OP_OR
Aseba::Compiler::TokenTOKEN_OP_AND
Aseba::Compiler::TokenTOKEN_OP_NOT
Aseba::Compiler::TokenTOKEN_OP_EQUAL
Aseba::Compiler::TokenTOKEN_OP_NOT_EQUAL
Aseba::Compiler::TokenTOKEN_OP_BIGGER
Aseba::Compiler::TokenTOKEN_OP_BIGGER_EQUAL
Aseba::Compiler::TokenTOKEN_OP_SMALLER
Aseba::Compiler::TokenTOKEN_OP_SMALLER_EQUAL
Aseba::Compiler::TokenTOKEN_OP_ADD
Aseba::Compiler::TokenTOKEN_OP_NEG
Aseba::Compiler::TokenTOKEN_OP_MULT
Aseba::Compiler::TokenTOKEN_OP_DIV
Aseba::Compiler::TokenTOKEN_OP_MOD
Aseba::Compiler::TokenTOKEN_OP_SHIFT_LEFT
Aseba::Compiler::TokenTOKEN_OP_SHIFT_RIGHT
Aseba::Compiler::TokenTOKEN_OP_BIT_OR
Aseba::Compiler::TokenTOKEN_OP_BIT_XOR
Aseba::Compiler::TokenTOKEN_OP_BIT_AND
Aseba::Compiler::TokenTOKEN_OP_BIT_NOT
Aseba::Compiler::TokenTOKEN_OP_ADD_EQUAL
Aseba::Compiler::TokenTOKEN_OP_NEG_EQUAL
Aseba::Compiler::TokenTOKEN_OP_MULT_EQUAL
Aseba::Compiler::TokenTOKEN_OP_DIV_EQUAL
Aseba::Compiler::TokenTOKEN_OP_MOD_EQUAL
Aseba::Compiler::TokenTOKEN_OP_SHIFT_LEFT_EQUAL
Aseba::Compiler::TokenTOKEN_OP_SHIFT_RIGHT_EQUAL
Aseba::Compiler::TokenTOKEN_OP_BIT_OR_EQUAL
Aseba::Compiler::TokenTOKEN_OP_BIT_XOR_EQUAL
Aseba::Compiler::TokenTOKEN_OP_BIT_AND_EQUAL
Aseba::Compiler::TokenTOKEN_OP_PLUS_PLUS
Aseba::Compiler::TokenTOKEN_OP_MINUS_MINUS

Public Functions

Aseba::Compiler::TokenToken()
Aseba::Compiler::Token::Token(Type type, SourcePos pos = SourcePos (), const std::wstring & value = L"")

Construct a new token of given type and value.

const std::wstring Aseba::Compiler::TokentypeName() const

Return the name of the type of this token.

std::wstring Aseba::Compiler::TokentoWString() const

Return a string representation of the token.

Aseba::Compiler::Tokenoperator Type() const

Public Members

Aseba::Compiler::Token::Type Aseba::Compiler::TokenTOKEN_END_OF_STREAM

type of this token

std::wstring Aseba::Compiler::TokensValue

string version of the value

int Aseba::Compiler::TokeniValue = {0}

int version of the value, 0 if not applicable

SourcePos Aseba::Compiler::Tokenpos

position of token in source code

struct AsebaTranslatableError : public Aseba::Error

Public Functions

Aseba::TranslatableErrorTranslatableError()
Aseba::TranslatableErrorTranslatableError(const SourcePos &pos, ErrorCode error)
TranslatableError &Aseba::TranslatableErrorarg(int value, int fieldWidth = 0, int base = 10, wchar_t fillChar = ' ')
TranslatableError &Aseba::TranslatableErrorarg(long int value, int fieldWidth = 0, int base = 10, wchar_t fillChar = ' ')
TranslatableError &Aseba::TranslatableErrorarg(unsigned value, int fieldWidth = 0, int base = 10, wchar_t fillChar = ' ')
TranslatableError &Aseba::TranslatableErrorarg(float value, int fieldWidth = 0, int precision = 6, wchar_t fillChar = ' ')
TranslatableError &Aseba::TranslatableErrorarg(const std::wstring &value)
Error Aseba::TranslatableErrortoError()

Public Members

WFormatableString Aseba::TranslatableErrormessage

Public Static Functions

void Aseba::TranslatableErrorsetTranslateCB(ErrorMessages::ErrorCallback newCB)

Public Static Attributes

ErrorMessages::ErrorCallback Aseba::TranslatableErrortranslateCB = nullptr
struct AsebaTupleVectorNode : public Aseba::AbstractTreeNode
#include <tree.h>

Node for assembling values into an array children[x] is the x-th Node to be assembled.

Public Functions

Aseba::TupleVectorNodeTupleVectorNode(const SourcePos &sourcePos)

Constructor.

Aseba::TupleVectorNodeTupleVectorNode(const SourcePos &sourcePos, int value)
TupleVectorNode *Aseba::TupleVectorNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::TupleVectorNodeexpandAbstractNodes(std::wostream *dump)

Dummy function, the node will be expanded during the vectorial pass.

Node *Aseba::TupleVectorNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Expand to vector[index].

std::wstring Aseba::TupleVectorNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::TupleVectorNodetoNodeName() const

Return a string representation of the name of this node.

void Aseba::TupleVectorNodedump(std::wostream &dest, unsigned &indent) const

Dump this node and the rest of the tree.

unsigned Aseba::TupleVectorNodegetVectorSize() const

return the children’s size, check for equal size, or E_NOVAL if no child

bool Aseba::TupleVectorNodeisImmediateVector() const
int Aseba::TupleVectorNodegetImmediateValue(unsigned index) const

return the n-th vector’s element

virtual void Aseba::TupleVectorNodeaddImmediateValue(int value)
struct AsebaUnaryArithmeticAssignmentNode : public Aseba::AbstractTreeNode
#include <tree.h>

Node for operations like “vector(op)”, may be ++ or Will expand to “vector (op)= [1,…,1]” children[0] is a MemoryVectorNode.

Public Functions

Aseba::UnaryArithmeticAssignmentNodeUnaryArithmeticAssignmentNode(const SourcePos &sourcePos, Compiler::Token::Type token, Node *memory)

Constructor.

UnaryArithmeticAssignmentNode *Aseba::UnaryArithmeticAssignmentNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node *Aseba::UnaryArithmeticAssignmentNodeexpandAbstractNodes(std::wostream *dump)

Expand “vector (opop)” to “vector (op)= 1”, and then call for the expansion of this last expression.

Node *Aseba::UnaryArithmeticAssignmentNodeexpandVectorialNodes(std::wostream *dump, Compiler *compiler = nullptr, unsigned int index = 0)

Third pass to expand vectorial operations into mutliple scalar ones.

Generic implementation for non-vectorial nodes.

std::wstring Aseba::UnaryArithmeticAssignmentNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::UnaryArithmeticAssignmentNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaBinaryOperator Aseba::UnaryArithmeticAssignmentNodearithmeticOp

operator

struct AsebaUnaryArithmeticNode : public Aseba::Node
#include <tree.h>

Node for unary arithmetic children[0] is the expression to negate.

Public Functions

Aseba::UnaryArithmeticNodeUnaryArithmeticNode(const SourcePos &sourcePos)

Constructor.

Aseba::UnaryArithmeticNodeUnaryArithmeticNode(const SourcePos &sourcePos, AsebaUnaryOperator op, Node *child)

Constructor.

UnaryArithmeticNode *Aseba::UnaryArithmeticNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

Node::ReturnType Aseba::UnaryArithmeticNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::UnaryArithmeticNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::UnaryArithmeticNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::UnaryArithmeticNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::UnaryArithmeticNodetoNodeName() const

Return a string representation of the name of this node.

Public Members

AsebaUnaryOperator Aseba::UnaryArithmeticNodeop

operator

struct AsebaWhileNode : public Aseba::Node
#include <tree.h>

Node for L”while”.

children[0] is expression children[1] is block

Public Functions

Aseba::WhileNodeWhileNode(const SourcePos &sourcePos)

Constructor.

WhileNode *Aseba::WhileNodeshallowCopy() const

Return a shallow copy of the object (children point to the same objects)

void Aseba::WhileNodecheckVectorSize() const

Check the consistency in vectors’ size.

Node::ReturnType Aseba::WhileNodetypeCheck(Compiler *compiler)

Typecheck this node, throw an exception if there is any type violation.

Node *Aseba::WhileNodeoptimize(std::wostream *dump)

Optimize this node, return the optimized node.

void Aseba::WhileNodeemit(PreLinkBytecode &bytecodes) const

Generate bytecode.

std::wstring Aseba::WhileNodetoWString() const

Return a string representation of this node.

std::wstring Aseba::WhileNodetoNodeName() const

Return a string representation of the name of this node.

namespace Aseba

Typedefs

using Aseba::VariablesNamesVector = typedef std::vector<std::wstring>

Vector of names of variables.

using Aseba::EventDescription = typedef NamedValue

An event description is a name - value pair.

using Aseba::ConstantDefinition = typedef NamedValue

An constant definition is a name - value pair.

using Aseba::EventsDescriptionsVector = typedef NamedValuesVector

Vector of events descriptions.

using Aseba::ConstantsDefinitions = typedef NamedValuesVector

Vector of constants definitions.

Enums

enum AsebaErrorCode

Values:

AsebaERROR_BROKEN_TARGET = 0
AsebaASEBA_ERROR_STACK_OVERFLOW
AsebaERROR_SCRIPT_TOO_BIG
AsebaERROR_VARIABLE_NOT_DEFINED
AsebaERROR_VARIABLE_NOT_DEFINED_GUESS
AsebaERROR_FUNCTION_NOT_DEFINED
AsebaERROR_FUNCTION_NOT_DEFINED_GUESS
AsebaERROR_CONSTANT_NOT_DEFINED
AsebaERROR_CONSTANT_NOT_DEFINED_GUESS
AsebaERROR_EVENT_NOT_DEFINED
AsebaERROR_EVENT_NOT_DEFINED_GUESS
AsebaERROR_EMIT_LOCAL_EVENT
AsebaERROR_SUBROUTINE_NOT_DEFINED
AsebaERROR_SUBROUTINE_NOT_DEFINED_GUESS
AsebaERROR_LINE
AsebaERROR_COL
AsebaERROR_UNBALANCED_COMMENT_BLOCK
AsebaERROR_SYNTAX
AsebaERROR_INVALID_IDENTIFIER
AsebaERROR_INVALID_HEXA_NUMBER
AsebaERROR_INVALID_BINARY_NUMBER
AsebaERROR_NUMBER_INVALID_BASE
AsebaERROR_IN_NUMBER
AsebaERROR_INTERNAL
AsebaERROR_EXPECTING
AsebaERROR_UINT12_OUT_OF_RANGE
AsebaERROR_UINT16_OUT_OF_RANGE
AsebaERROR_PINT16_OUT_OF_RANGE
AsebaERROR_INT16_OUT_OF_RANGE
AsebaERROR_PCONSTANT_OUT_OF_RANGE
AsebaERROR_CONSTANT_OUT_OF_RANGE
AsebaERROR_EXPECTING_ONE_OF
AsebaERROR_NOT_ENOUGH_TEMP_SPACE
AsebaERROR_MISPLACED_VARDEF
AsebaERROR_EXPECTING_IDENTIFIER
AsebaERROR_CONST_ALREADY_DEFINED
AsebaERROR_VAR_ALREADY_DEFINED
AsebaERROR_VAR_CONST_COLLISION
AsebaERROR_UNDEFINED_SIZE
AsebaERROR_NOT_ENOUGH_SPACE
AsebaERROR_EXPECTING_ASSIGNMENT
AsebaERROR_FOR_NULL_STEPS
AsebaERROR_FOR_START_HIGHER_THAN_END
AsebaERROR_FOR_START_LOWER_THAN_END
AsebaERROR_FOR_INVALID_INC_END_INDEX
AsebaERROR_FOR_INVALID_DEC_END_INDEX
AsebaERROR_EVENT_ALREADY_IMPL
AsebaERROR_EVENT_ARG_TOO_BIG
AsebaERROR_EVENT_WRONG_ARG_SIZE
AsebaERROR_SUBROUTINE_ALREADY_DEF
AsebaERROR_INDEX_EXPECTING_CONSTANT
AsebaERROR_INDEX_WRONG_END
AsebaERROR_SIZE_IS_NEGATIVE
AsebaERROR_SIZE_IS_NULL
AsebaERROR_NOT_CONST_EXPR
AsebaERROR_FUNCTION_HAS_NO_ARG
AsebaERROR_FUNCTION_NO_ENOUGH_ARG
AsebaERROR_FUNCTION_WRONG_ARG_SIZE
AsebaERROR_FUNCTION_WRONG_ARG_SIZE_TEMPLATE
AsebaERROR_FUNCTION_TOO_MANY_ARG
AsebaERROR_UNARY_ARITH_BUILD_UNEXPECTED
AsebaERROR_INCORRECT_LEFT_VALUE
AsebaERROR_ARRAY_OUT_OF_BOUND
AsebaERROR_ARRAY_SIZE_MISMATCH
AsebaERROR_IF_VECTOR_CONDITION
AsebaERROR_WHILE_VECTOR_CONDITION
AsebaERROR_ARRAY_ILLEGAL_ACCESS
AsebaERROR_INFINITE_LOOP
AsebaERROR_DIVISION_BY_ZERO
AsebaERROR_ABS_NOT_POSSIBLE
AsebaERROR_ARRAY_OUT_OF_BOUND_READ
AsebaERROR_ARRAY_OUT_OF_BOUND_WRITE
AsebaERROR_EXPECTING_TYPE
AsebaERROR_EXPECTING_CONDITION
AsebaERROR_TOKEN_END_OF_STREAM
AsebaERROR_TOKEN_STR_when
AsebaERROR_TOKEN_STR_emit
AsebaERROR_TOKEN_STR_hidden_emit
AsebaERROR_TOKEN_STR_for
AsebaERROR_TOKEN_STR_in
AsebaERROR_TOKEN_STR_step
AsebaERROR_TOKEN_STR_while
AsebaERROR_TOKEN_STR_do
AsebaERROR_TOKEN_STR_if
AsebaERROR_TOKEN_STR_then
AsebaERROR_TOKEN_STR_else
AsebaERROR_TOKEN_STR_elseif
AsebaERROR_TOKEN_STR_end
AsebaERROR_TOKEN_STR_var
AsebaERROR_TOKEN_STR_const
AsebaERROR_TOKEN_STR_call
AsebaERROR_TOKEN_STR_sub
AsebaERROR_TOKEN_STR_callsub
AsebaERROR_TOKEN_STR_onevent
AsebaERROR_TOKEN_STR_abs
AsebaERROR_TOKEN_STR_return
AsebaERROR_TOKEN_STRING_LITERAL
AsebaERROR_TOKEN_INT_LITERAL
AsebaERROR_TOKEN_PAR_OPEN
AsebaERROR_TOKEN_PAR_CLOSE
AsebaERROR_TOKEN_BRACKET_OPEN
AsebaERROR_TOKEN_BRACKET_CLOSE
AsebaERROR_TOKEN_COLON
AsebaERROR_TOKEN_COMMA
AsebaERROR_TOKEN_ASSIGN
AsebaERROR_TOKEN_OP_OR
AsebaERROR_TOKEN_OP_AND
AsebaERROR_TOKEN_OP_NOT
AsebaERROR_TOKEN_OP_BIT_OR
AsebaERROR_TOKEN_OP_BIT_XOR
AsebaERROR_TOKEN_OP_BIT_AND
AsebaERROR_TOKEN_OP_BIT_NOT
AsebaERROR_TOKEN_OP_BIT_OR_EQUAL
AsebaERROR_TOKEN_OP_BIT_XOR_EQUAL
AsebaERROR_TOKEN_OP_BIT_AND_EQUAL
AsebaERROR_TOKEN_OP_EQUAL
AsebaERROR_TOKEN_OP_NOT_EQUAL
AsebaERROR_TOKEN_OP_BIGGER
AsebaERROR_TOKEN_OP_BIGGER_EQUAL
AsebaERROR_TOKEN_OP_SMALLER
AsebaERROR_TOKEN_OP_SMALLER_EQUAL
AsebaERROR_TOKEN_OP_SHIFT_LEFT
AsebaERROR_TOKEN_OP_SHIFT_RIGHT
AsebaERROR_TOKEN_OP_SHIFT_LEFT_EQUAL
AsebaERROR_TOKEN_OP_SHIFT_RIGHT_EQUAL
AsebaERROR_TOKEN_OP_ADD
AsebaERROR_TOKEN_OP_NEG
AsebaERROR_TOKEN_OP_ADD_EQUAL
AsebaERROR_TOKEN_OP_NEG_EQUAL
AsebaERROR_TOKEN_OP_PLUS_PLUS
AsebaERROR_TOKEN_OP_MINUS_MINUS
AsebaERROR_TOKEN_OP_MULT
AsebaERROR_TOKEN_OP_DIV
AsebaERROR_TOKEN_OP_MOD
AsebaERROR_TOKEN_OP_MULT_EQUAL
AsebaERROR_TOKEN_OP_DIV_EQUAL
AsebaERROR_TOKEN_OP_MOD_EQUAL
AsebaERROR_TOKEN_UNKNOWN
AsebaERROR_UNKNOWN_ERROR
AsebaERROR_END

Functions

template <class T>
unsigned int AsebaeditDistance(const T &s1, const T &s2, const unsigned maxDist)

Compute the edit distance between two vector-style containers, inspired from http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#C.2B.2B.

template <typename MapType>
MapType::const_iterator AsebafindInTable(const MapType &map, const std::wstring &name, const SourcePos &pos, const ErrorCode notFoundError, const ErrorCode misspelledError)

Helper function to find for something in one of the map, using edit-distance to check for candidates if not found.

template <typename T>
bool AsebaisPOT(T number)

Return true if number is a power of two.

template <typename T>
unsigned AsebashiftFromPOT(T number)

If number is a power of two, number = (1 << shift) and this function returns shift, otherwise return value is undefined.

std::wstring AsebabinaryOperatorToString(AsebaBinaryOperator op)

Return the string corresponding to the binary operator.

std::wstring AsebaunaryOperatorToString(AsebaUnaryOperator op)

Return the string corresponding to the unary operator.

static void AsebaaddImmediateToBytecodes(int value, const SourcePos &sourcePos, PreLinkBytecode &bytecodes)
static bool AsebamatchNameInMemoryVector(const Node *root, std::wstring name)

Variables

const wchar_t *Asebaerror_map[ERROR_END]
file analysis.cpp
#include “compiler.h”#include “common/consts.h”#include <cassert>#include <iostream>
file compiler.cpp
#include “compiler.h”#include “tree.h”#include “errors_code.h”#include “common/consts.h”#include “common/utils/utils.h”#include “common/utils/FormatableString.h”#include <cassert>#include <cstdlib>#include <sstream>#include <iostream>#include <fstream>#include <iomanip>#include <memory>#include <limits>#include <iterator>
file compiler.h
#include <utility>#include <vector>#include <deque>#include <string>#include <map>#include <set>#include <istream>#include “errors_code.h”#include “common/types.h”#include “common/msg/TargetDescription.h”#include “common/utils/FormatableString.h”
file errors.cpp
#include “errors_code.h”#include “compiler.h”#include <sstream>#include <string>
file errors_code.h
file identifier-lookup.cpp
#include “compiler.h”#include “tree.h”#include “common/consts.h”#include “common/utils/FormatableString.h”#include <cassert>#include <cstdlib>#include <sstream>#include <iostream>#include <fstream>#include <iomanip>#include <memory>#include <limits>#include <algorithm>#include <malloc.h>

Functions for quick lookup of identifiers (variables, events, subroutines, native functions, constants) using maps.

file lexer.cpp
#include “compiler.h”#include “common/utils/FormatableString.h”#include “common/utils/utils.h”#include <cstdlib>#include <sstream>#include <ostream>#include <cctype>#include <cstdio>#include <cwctype>#include <locale>
file mainpage.dox
file natives.c
#include “common/consts.h”#include “common/types.h”#include “natives.h”#include <string.h>#include <assert.h>

Functions

int16_t aseba_atan2(int16_t y, int16_t x)
int16_t aseba_sin(int16_t angle)
int16_t aseba_cos(int16_t angle)
int16_t aseba_sqrt(int16_t num)
void aseba_comb_sort(int16_t *input, uint16_t size)
void AsebaNative_veccopy(AsebaVMState *vm)

Function to copy a vector.

void AsebaNative_vecfill(AsebaVMState *vm)

Function to fill all the elements of a vector to a specific value.

void AsebaNative_vecaddscalar(AsebaVMState *vm)

Function to add a scalar to each element of a vector.

void AsebaNative_vecadd(AsebaVMState *vm)

Function to add two vectors.

void AsebaNative_vecsub(AsebaVMState *vm)

Function to substract two vectors.

void AsebaNative_vecmul(AsebaVMState *vm)

Function to multiply two vectors elements by elements.

void AsebaNative_vecdiv(AsebaVMState *vm)

Function to divide two vectors elements by elements.

void AsebaNative_vecmin(AsebaVMState *vm)

Function to take the element by element minimum.

void AsebaNative_vecmax(AsebaVMState *vm)

Function to take the element by element maximum.

void AsebaNative_vecclamp(AsebaVMState *vm)

Function to clamp a vector of values element by element.

void AsebaNative_vecdot(AsebaVMState *vm)

Function to perform a dot product on a vector.

void AsebaNative_vecstat(AsebaVMState *vm)

Function to perform statistics on a vector.

void AsebaNative_vecargbounds(AsebaVMState *vm)

Function to get indices of the bounds of a vector.

void AsebaNative_vecsort(AsebaVMState *vm)

Function to sort a vector.

void AsebaNative_mathmuldiv(AsebaVMState *vm)

Function to perform dest = (a*b)/c in 32 bits.

void AsebaNative_mathatan2(AsebaVMState *vm)

Function to perform atan2.

void AsebaNative_mathsin(AsebaVMState *vm)

Function to perform sin.

void AsebaNative_mathcos(AsebaVMState *vm)

Function to perform cos.

void AsebaNative_mathrot2(AsebaVMState *vm)

Function to perform the rotation of a vector.

void AsebaNative_mathsqrt(AsebaVMState *vm)

Function to perform sqrt.

void AsebaNative_vecnonzerosequence(AsebaVMState *vm)

Function to get the middle index of the largest sequence of non-zero elements.

void AsebaSetRandomSeed(uint16_t seed)

Functon to set the seed of random generator.

uint16_t AsebaGetRandom()

Functon to get a random number.

void AsebaNative_rand(AsebaVMState *vm)

Function to get a 16-bit signed random number.

static void deque_shift(AsebaVMState *vm, uint16_t dq, uint16_t dq_capacity, uint16_t target, int16_t last, int16_t delta)
static void deque_throw_exception(AsebaVMState *vm)
void AsebaNative_deqsize(AsebaVMState *vm)

Function that reports size of deque dest in size.

static void _AsebaNative_deqget(AsebaVMState *vm, uint16_t dest, uint16_t deque, uint16_t index_val, uint16_t dest_length, uint16_t deque_length)
void AsebaNative_deqget(AsebaVMState *vm)

Function that copies index-th len-dest elements of deque src to dest.

void AsebaNative_deqset(AsebaVMState *vm)

Function that copies len-src elements of src to index-th position of deque dest.

static void _AsebaNative_deqinsert(AsebaVMState *vm, uint16_t deque, uint16_t src, uint16_t index_val, uint16_t deque_length, uint16_t src_length)
void AsebaNative_deqinsert(AsebaVMState *vm)

Function that copies len-src elements of src before index-th position of deque dest.

static void _AsebaNative_deqerase(AsebaVMState *vm, uint16_t deque, uint16_t index_val, uint16_t len_val, uint16_t deque_length)
void AsebaNative_deqerase(AsebaVMState *vm)

Function that erases len elements from deque dest starting from index-th position.

void AsebaNative_deqpushfront(AsebaVMState *vm)

Function that copies len-src elements of src before the front of deque dest.

void AsebaNative_deqpushback(AsebaVMState *vm)

Function that copies len-src elements of src after the end of deque dest.

void AsebaNative_deqpopfront(AsebaVMState *vm)

Function that erases len elements from deque dest starting at the front.

void AsebaNative_deqpopback(AsebaVMState *vm)

Function that erases len elements from deque dest starting from the end.

Variables

const int16_t aseba_atan_table[20 * 8 + 1]

= {

652, 735, 816, 896, 977, 1058, 1139, 1218, 1300, 1459, 1620, 1777, 1935, 2093, 2250,

2403, 2556, 2868, 3164, 3458, 3748, 4029, 4307, 4578, 4839, 5359, 5836, 6290, 6720, 7126,

7507, 7861, 8203, 8825, 9357, 9839, 10260, 10640, 10976, 11281, 11557, 12037, 12425, 12755, 13036,

13277, 13486, 13671, 13837, 14112, 14331, 14514, 14666, 14796, 14907, 15003, 15091, 15235, 15348, 15441,

15519, 15585, 15642, 15691, 15736, 15808, 15865, 15912, 15951, 15984, 16013, 16037, 16060, 16096, 16125,

16148, 16168, 16184, 16199, 16211, 16222, 16240, 16255, 16266, 16276, 16284, 16292, 16298, 16303, 16312,

16320, 16325, 16331, 16334, 16338, 16341, 16344, 16348, 16352, 16355, 16357, 16360, 16361, 16363, 16364,

16366, 16369, 16369, 16371, 16372, 16373, 16373, 16375, 16375, 16377, 16376, 16378, 16378, 16378, 16379,

16379, 16380, 16380, 16380, 16382, 16381, 16381, 16381, 16382, 16382, 16382, 16382, 16382, 16382, 16384,

16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16384, 16384, 16384, 16384,

16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384}


const int16_t aseba_sin_table[128 + 1]

= {

0, 403, 804, 1207, 1608, 2010, 2411, 2812, 3212, 3612, 4011, 4411, 4808, 5206, 5603,

5998, 6393, 6787, 7180, 7572, 7962, 8352, 8740, 9127, 9513, 9896, 10279, 10660, 11040, 11417,

11794, 12167, 12540, 12911, 13279, 13646, 14010, 14373, 14733, 15091, 15447, 15801, 16151, 16500, 16846,

17190, 17531, 17869, 18205, 18538, 18868, 19196, 19520, 19842, 20160, 20476, 20788, 21097, 21403, 21706,

22006, 22302, 22595, 22884, 23171, 23453, 23732, 24008, 24279, 24548, 24812, 25073, 25330, 25583, 25833,

26078, 26320, 26557, 26791, 27020, 27246, 27467, 27684, 27897, 28106, 28311, 28511, 28707, 28899, 29086,

29269, 29448, 29622, 29792, 29957, 30117, 30274, 30425, 30572, 30715, 30852, 30985, 31114, 31238, 31357,

31471, 31581, 31686, 31786, 31881, 31972, 32057, 32138, 32215, 32285, 32352, 32413, 32470, 32521, 32569,

32610, 32647, 32679, 32706, 32728, 32746, 32758, 32766, 32767,

}


const AsebaNativeFunctionDescription AsebaNativeDescription_veccopy

= {“math.copy”,

“copies src to dest element by element”,

{{-1, “dest”}, {-1, “src”}, {0, 0}}}


Description of AsebaNative_veccopy.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecfill

= {“math.fill”,

“fills dest with constant value”,

{{-1, “dest”}, {1, “value”}, {0, 0}}}


Description of AsebaNative_vecfill.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecaddscalar

= {

“math.addscalar”,

“add scalar to each element of src and store result to dest”,

{{-1, “dest”}, {-1, “src”}, {1, “scalar”}, {0, 0}}}


Description of AsebaNative_vecaddscalar.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecadd

= {

“math.add”,

“adds src1 and src2, write to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsub

= {

“math.sub”,

“substracts src2 from src1 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmul

= {

“math.mul”,

“multiplies src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdiv

= {

“math.div”,

“divides src1 by src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmin

= {

“math.min”,

“writes the minimum of src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecmin.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmax

= {

“math.max”,

“writes the maximum of src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsmax.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecclamp

= {

“math.clamp”,

“clamp src to low/high bounds into dest, element by element”,

{{-1, “dest”}, {-1, “src”}, {-1, “low”}, {-1, “high”}, {0, 0}}}


Description of AsebaNative_vecclamp.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdot

= {

“math.dot”,

“writes the dot product of src1 and src2 to dest, after a shift”,

{{1, “dest”}, {-1, “src1”}, {-1, “src2”}, {1, “shift”}, {0, 0}}}


Description of AsebaNative_vecdot.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecstat

= {

“math.stat”,

“performs statistics on src”,

{{-1, “src”}, {1, “min”}, {1, “max”}, {1, “mean”}, {0, 0}}}


Description of AsebaNative_vecstat.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecargbounds

= {

“math.argbounds”,

“get the indices (argmin, argmax) of the limit values of src”,

{{-1, “src”}, {1, “argmin”}, {1, “argmax”}, {0, 0}}}


Description of AsebaNative_vecargbounds.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsort

= {“math.sort”,

“sort array in place”,

{{-1, “array”}, {0, 0}}}


Description of AsebaNative_vecsort.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathmuldiv

= {

“math.muldiv”,

“performs dest = (a*b)/c in 32 bits element by element”,

{{-1, “dest”}, {-1, “a”}, {-1, “b”}, {-1, “c”}, {0, 0}}}


Description of AsebaNative_mathmuldiv.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathatan2

= {

“math.atan2”,

“performs dest = atan2(y,x) element by element”,

{{-1, “dest”}, {-1, “y”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathatan2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsin

= {“math.sin”,

“performs dest = sin(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathsin.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathcos

= {“math.cos”,

“performs dest = cos(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathcos.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathrot2

= {“math.rot2”,

“rotates v of angle a to dest”,

{{2, “dest”}, {2, “v”}, {1, “a”}, {0, 0}}}


Description of AsebaNative_mathrot2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsqrt

= {“math.sqrt”,

“performs dest = sqrt(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathsqrt.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecnonzerosequence

= {

“math.nzseq”,

“write to dest the middle index of the largest sequence of non-zero elements from src, -1 if “

“not found or if smaller than minLength”,

{{1, “dest”}, {-1, “src”}, {1, “minLength”}, {0, 0}}}


Description of AsebaNative_vecnonzerosequence.

uint16_t rnd_state
const AsebaNativeFunctionDescription AsebaNativeDescription_rand

= {“math.rand”,

“fill array with random values”,

{{-1, “dest”}, {0, 0}}}


Description of AsebaNative_rand.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqsize

= {“deque.size”,

“report size of dest”,

{{-1, “deque”}, {1, “size”}, {0, 0}}}


Description of AsebaNative_deqsize.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqget

= {

“deque.get”,

“fill dest from deque at index”,

{{-1, “deque”}, {-2, “dest”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqget.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqset

= {

“deque.set”,

“copies src to deque at index”,

{{-1, “deque”}, {-2, “src”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqset.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqinsert

= {

“deque.insert”,

“shift deque at index by len(src) and insert src”,

{{-1, “deque”}, {-2, “src”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqinsert.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqerase

= {

“deque.erase”,

“shift deque at index by len to erase”,

{{-1, “deque”}, {1, “index”}, {1, “len”}, {0, 0}}}


Description of AsebaNative_deqerase.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushfront

= {“deque.push_front”,

“insert src before the front of deque”,

{{-1, “deque”}, {-2, “src”}, {0, 0}}}


Description of AsebaNative_deqpushfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushback

= {“deque.push_back”,

“insert src after the back of deque”,

{{-1, “deque”}, {-2, “src”}, {0, 0}}}


Description of AsebaNative_deqpushback.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopfront

= {

“deque.pop_front”,

“fill dest from front of deque then erase elements”,

{{-1, “deque”}, {-2, “dest”}, {0, 0}}}


Description of AsebaNative_deqpopfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopback

= {

“deque.pop_back”,

“fill dest from back of deque then erase elements”,

{{-1, “deque”}, {-2, “dest”}, {0, 0}}}


Description of AsebaNative_deqpopback.

file natives.h
#include “common/types.h”#include “vm.h”

Definition of standard natives functions for Aseba Virtual Machine.

Defines

ASEBA_NATIVES_STD_COUNT

Embedded targets must know the size of ASEBA_NATIVES_STD_FUNCTIONS without having to compute them by hand, please update this when adding a new function.

ASEBA_NATIVES_STD_FUNCTIONS

snippet to include standard native functions

ASEBA_NATIVES_STD_DESCRIPTIONS

snippet to include descriptions of standard native functions

Typedefs

typedef void (*AsebaNativeFunctionPointer)(AsebaVMState *vm)

Signature of a native function.

Functions

static int16_t AsebaNativePopArg(AsebaVMState *vm)

Return an argument on the stack, including the value of template parameters.

void AsebaNative_veccopy(AsebaVMState *vm)

Function to copy a vector.

void AsebaNative_vecfill(AsebaVMState *vm)

Function to fill all the elements of a vector to a specific value.

void AsebaNative_vecaddscalar(AsebaVMState *vm)

Function to add a scalar to each element of a vector.

void AsebaNative_vecadd(AsebaVMState *vm)

Function to add two vectors.

void AsebaNative_vecsub(AsebaVMState *vm)

Function to substract two vectors.

void AsebaNative_vecmul(AsebaVMState *vm)

Function to multiply two vectors elements by elements.

void AsebaNative_vecdiv(AsebaVMState *vm)

Function to divide two vectors elements by elements.

void AsebaNative_vecmin(AsebaVMState *vm)

Function to take the element by element minimum.

void AsebaNative_vecmax(AsebaVMState *vm)

Function to take the element by element maximum.

void AsebaNative_vecclamp(AsebaVMState *vm)

Function to clamp a vector of values element by element.

void AsebaNative_vecdot(AsebaVMState *vm)

Function to perform a dot product on a vector.

void AsebaNative_vecstat(AsebaVMState *vm)

Function to perform statistics on a vector.

void AsebaNative_vecargbounds(AsebaVMState *vm)

Function to get indices of the bounds of a vector.

void AsebaNative_vecsort(AsebaVMState *vm)

Function to sort a vector.

void AsebaNative_mathmuldiv(AsebaVMState *vm)

Function to perform dest = (a*b)/c in 32 bits.

void AsebaNative_mathatan2(AsebaVMState *vm)

Function to perform atan2.

void AsebaNative_mathsin(AsebaVMState *vm)

Function to perform sin.

void AsebaNative_mathcos(AsebaVMState *vm)

Function to perform cos.

void AsebaNative_mathrot2(AsebaVMState *vm)

Function to perform the rotation of a vector.

void AsebaNative_mathsqrt(AsebaVMState *vm)

Function to perform sqrt.

void AsebaNative_vecnonzerosequence(AsebaVMState *vm)

Function to get the middle index of the largest sequence of non-zero elements.

void AsebaSetRandomSeed(uint16_t seed)

Functon to set the seed of random generator.

uint16_t AsebaGetRandom()

Functon to get a random number.

void AsebaNative_rand(AsebaVMState *vm)

Function to get a 16-bit signed random number.

void AsebaNative_deqsize(AsebaVMState *vm)

Function that reports size of deque dest in size.

void AsebaNative_deqget(AsebaVMState *vm)

Function that copies index-th len-dest elements of deque src to dest.

void AsebaNative_deqset(AsebaVMState *vm)

Function that copies len-src elements of src to index-th position of deque dest.

void AsebaNative_deqinsert(AsebaVMState *vm)

Function that copies len-src elements of src before index-th position of deque dest.

void AsebaNative_deqerase(AsebaVMState *vm)

Function that erases len elements from deque dest starting from index-th position.

void AsebaNative_deqpushfront(AsebaVMState *vm)

Function that copies len-src elements of src before the front of deque dest.

void AsebaNative_deqpushback(AsebaVMState *vm)

Function that copies len-src elements of src after the end of deque dest.

void AsebaNative_deqpopfront(AsebaVMState *vm)

Function that erases len elements from deque dest starting at the front.

void AsebaNative_deqpopback(AsebaVMState *vm)

Function that erases len elements from deque dest starting from the end.

Variables

const AsebaNativeFunctionDescription AsebaNativeDescription_veccopy

Description of AsebaNative_veccopy.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecfill

Description of AsebaNative_vecfill.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecaddscalar

Description of AsebaNative_vecaddscalar.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecadd

Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsub

Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmul

Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdiv

Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmin

Description of AsebaNative_vecmin.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmax

Description of AsebaNative_vecsmax.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecclamp

Description of AsebaNative_vecclamp.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdot

Description of AsebaNative_vecdot.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecstat

Description of AsebaNative_vecstat.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecargbounds

Description of AsebaNative_vecargbounds.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsort

Description of AsebaNative_vecsort.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathmuldiv

Description of AsebaNative_mathmuldiv.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathatan2

Description of AsebaNative_mathatan2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsin

Description of AsebaNative_mathsin.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathcos

Description of AsebaNative_mathcos.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathrot2

Description of AsebaNative_mathrot2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsqrt

Description of AsebaNative_mathsqrt.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecnonzerosequence

Description of AsebaNative_vecnonzerosequence.

const AsebaNativeFunctionDescription AsebaNativeDescription_rand

Description of AsebaNative_rand.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqsize

Description of AsebaNative_deqsize.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqget

Description of AsebaNative_deqget.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqset

Description of AsebaNative_deqset.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqinsert

Description of AsebaNative_deqinsert.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqerase

Description of AsebaNative_deqerase.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushfront

Description of AsebaNative_deqpushfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushback

Description of AsebaNative_deqpushback.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopfront

Description of AsebaNative_deqpopfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopback

Description of AsebaNative_deqpopback.

file parser.cpp
#include “compiler.h”#include “tree.h”#include “common/utils/FormatableString.h”#include “common/utils/utils.h”#include <memory>#include <valarray>#include <iostream>#include <cassert>#include <typeinfo>#include <algorithm>

Defines

IS_ONE_OF(array)
EXPECT_ONE_OF(array)
STRICT
file power-of-two.h
file tree-build.cpp
#include “tree.h”#include <cstdlib>#include <iostream>#include <utility>
file tree-dump.cpp
#include “tree.h”#include “common/utils/FormatableString.h”#include <ostream>
file tree-emit.cpp
#include “tree.h”#include “common/utils/utils.h”#include <cassert>#include <cstdlib>#include <algorithm>#include <iterator>
file tree-expand.cpp
#include “compiler.h”#include “tree.h”#include “common/utils/utils.h”#include “common/utils/FormatableString.h”#include <cassert>#include <memory>#include <iostream>
file tree-optimize.cpp
#include “tree.h”#include “power-of-two.h”#include “common/utils/FormatableString.h”#include “common/utils/utils.h”#include <cassert>#include <cstdlib>
file tree-typecheck.cpp
#include “tree.h”#include “common/utils/FormatableString.h”#include <cstdlib>
file tree.h
#include “compiler.h”#include “common/consts.h”#include “common/utils/FormatableString.h”#include <vector>#include <string>#include <ostream>#include <climits>#include <cassert>#include <iostream>
file vm.c
#include “common/consts.h”#include “common/types.h”#include “vm.h”#include <string.h>

Implementation of standard natives functions for Aseba Virtual Machine.

Implementation of Aseba Virtual Machine.

Defines

GET_BIT(v, b)

Return true if bit b of v is 1.

BIT_SET(v, b)

Set bit b of v to 1.

BIT_CLR(v, b)

Set bit b of v to 0.

Functions

void AsebaVMSendExecutionStateChanged(AsebaVMState *vm)

Send an execution state changed message.

void AsebaVMInit(AsebaVMState *vm)

Setup the execution status of the VM.

This is not sufficient to have a working VM. nodeId and bytecode, variables, and stack along with their sizes must be set outside this function. The content of the variable array is zeroed by this function.

uint16_t AsebaVMGetEventAddress(AsebaVMState *vm, uint16_t event)

Return the starting address of an event, or 0 if the event is not handled.

uint16_t AsebaVMSetupEvent(AsebaVMState *vm, uint16_t event)

Setup VM to execute an event.

If event is not handled, VM is not ready for run. Return the starting address of the event, or 0 if the event is not handled.

static int16_t AsebaVMDoBinaryOperation(AsebaVMState *vm, int16_t valueOne, int16_t valueTwo, uint16_t op)
static int16_t AsebaVMDoUnaryOperation(AsebaVMState *vm, int16_t value, uint16_t op)
void AsebaVMStep(AsebaVMState *vm)

Execute one bytecode of the current VM thread.

VM must be ready for run otherwise trashes may occur.

void AsebaVMEmitNodeSpecificError(AsebaVMState *vm, const char *message)

Can be called by glue code (including native functions), to stop vm and emit a node specific error.

uint16_t AsebaVMCheckBreakpoint(AsebaVMState *vm)

Execute on bytecode of the current VM thread and check for potential breakpoints.

Return 1 if breakpoint was seen, 0 otherwise. VM must be ready for run otherwise trashes may occur.

void AsebaDebugBareRun(AsebaVMState *vm, uint16_t stepsLimit)

Run without support of breakpoints.

Check ASEBA_VM_EVENT_RUNNING_MASK to exit on interrupts or stepsLimit if > 0.

void AsebaDebugBreakpointRun(AsebaVMState *vm, uint16_t stepsLimit)

Run with support of breakpoints.

Also check ASEBA_VM_EVENT_RUNNING_MASK to exit on interrupts.

uint16_t AsebaVMRun(AsebaVMState *vm, uint16_t stepsLimit)

Run the VM depending on the current execution mode.

Either run or step, depending of the current mode. If stepsLimit > 0, execute at maximim stepsLimit Return 1 if anything was executed, 0 otherwise.

uint8_t AsebaVMSetBreakpoint(AsebaVMState *vm, uint16_t pc)

Set a breakpoint at a specific location.

uint16_t AsebaVMClearBreakpoint(AsebaVMState *vm, uint16_t pc)

Clear the breakpoint at a specific location.

void AsebaVMClearBreakpoints(AsebaVMState *vm)

Clear all breakpoints.

static void AsebaVMResetWhenFlags(AsebaVMState *vm)

Reset all when flags in their default states in the bytecode.

void AsebaVMDebugMessage(AsebaVMState *vm, uint16_t id, uint16_t *data, uint16_t dataLength)

Execute a debug action from a debug message.

dataLength is given in number of uint16_t.

uint16_t AsebaVMShouldDropPacket(AsebaVMState *vm, uint16_t source, const uint8_t *data)

Return non-zero if VM will ignore the packet, 0 otherwise.

file vm.h
#include “common/types.h”

Definition of Aseba Virtual Machine.

Defines

AsebaMaskSet(v, m)

Set the part masked by m of v to 1.

AsebaMaskClear(v, m)

Set the part masked by m of v to 0.

AsebaMaskIsSet(v, m)

Returns true if the part masked by m of v is 1.

AsebaMaskIsClear(v, m)

Returns true if the part masked by m of v is 0.

AsebaSendMessageWords(vm, type, data, size)

Enums

enum [anonymous]

Values:

ASEBA_MAX_BREAKPOINTS = 16

maximum number of simultaneous breakpoints the target supports

enum AsebaAssertReason

Possible causes of AsebaAssert.

Values:

ASEBA_ASSERT_UNKNOWN = 0
ASEBA_ASSERT_UNKNOWN_UNARY_OPERATOR
ASEBA_ASSERT_UNKNOWN_BINARY_OPERATOR
ASEBA_ASSERT_UNKNOWN_BYTECODE
ASEBA_ASSERT_STACK_OVERFLOW
ASEBA_ASSERT_STACK_UNDERFLOW
ASEBA_ASSERT_OUT_OF_VARIABLES_BOUNDS
ASEBA_ASSERT_OUT_OF_BYTECODE_BOUNDS
ASEBA_ASSERT_STEP_OUT_OF_RUN
ASEBA_ASSERT_BREAKPOINT_OUT_OF_BYTECODE_BOUNDS
ASEBA_ASSERT_EMIT_BUFFER_TOO_LONG

Functions

void AsebaVMInit(AsebaVMState *vm)

Setup the execution status of the VM.

This is not sufficient to have a working VM. nodeId and bytecode, variables, and stack along with their sizes must be set outside this function. The content of the variable array is zeroed by this function.

uint16_t AsebaVMGetEventAddress(AsebaVMState *vm, uint16_t event)

Return the starting address of an event, or 0 if the event is not handled.

uint16_t AsebaVMSetupEvent(AsebaVMState *vm, uint16_t event)

Setup VM to execute an event.

If event is not handled, VM is not ready for run. Return the starting address of the event, or 0 if the event is not handled.

uint16_t AsebaVMRun(AsebaVMState *vm, uint16_t stepsLimit)

Run the VM depending on the current execution mode.

Either run or step, depending of the current mode. If stepsLimit > 0, execute at maximim stepsLimit Return 1 if anything was executed, 0 otherwise.

void AsebaVMDebugMessage(AsebaVMState *vm, uint16_t id, uint16_t *data, uint16_t dataLength)

Execute a debug action from a debug message.

dataLength is given in number of uint16_t.

void AsebaVMEmitNodeSpecificError(AsebaVMState *vm, const char *message)

Can be called by glue code (including native functions), to stop vm and emit a node specific error.

uint16_t AsebaVMShouldDropPacket(AsebaVMState *vm, uint16_t source, const uint8_t *data)

Return non-zero if VM will ignore the packet, 0 otherwise.

void AsebaSendMessage(AsebaVMState *vm, uint16_t id, const void *data, uint16_t size)

Called by AsebaStep if there is a message (not an user event) to send.

size is given in number of bytes.

void AsebaSendVariables(AsebaVMState *vm, uint16_t start, uint16_t length)

Called by AsebaVMDebugMessage when some variables must be sent efficiently.

void AsebaSendDescription(AsebaVMState *vm)

Called by AsebaVMDebugMessage when VM must send its description on the network.

void AsebaNativeFunction(AsebaVMState *vm, uint16_t id)

Called by AsebaStep to perform a native function call.

void AsebaWriteBytecode(AsebaVMState *vm)

Called by AsebaVMDebugMessage when VM must write its bytecode to flash, write an empty function to leave feature unsupported.

void AsebaResetIntoBootloader(AsebaVMState *vm)

Called by AsebaVMDebugMessage when VM must restart the node and enter to the bootloader, write an empty function to leave feature unsupported.

void AsebaPutVmToSleep(AsebaVMState *vm)

Called by AsebaVMDebugMessage when VM must put to node in deep sleep.

Write an empty function to leave feature unsupported

void __attribute__((weak))

Called by AsebaVMDebugMessage when VM is going to be run.

Called by AsebaVMEmitNodeSpecificError to be notified when VM hit an execution error Is also called for wrong array access or division by 0 with message == NULL.

Called by AsebaVMDebugMessage when VM is being resetted.

void AsebaAssert(AsebaVMState *vm, AsebaAssertReason reason)

If ASEBA_ASSERT is defined, this function is called when an error arise.

Variables

void const char* message
group compiler

Typedefs

using Aseba::VariablesNamesVector = typedef std::vector<std::wstring>

Vector of names of variables.

using Aseba::EventDescription = typedef NamedValue

An event description is a name - value pair.

using Aseba::ConstantDefinition = typedef NamedValue

An constant definition is a name - value pair.

using Aseba::EventsDescriptionsVector = typedef NamedValuesVector

Vector of events descriptions.

using Aseba::ConstantsDefinitions = typedef NamedValuesVector

Vector of constants definitions.

Variables

const wchar_t *Asebaerror_map[ERROR_END]
ErrorMessages::ErrorCallback Aseba::TranslatableErrortranslateCB = nullptr
const AsebaBinaryOperator Aseba::ArithmeticAssignmentNodeoperatorMap

= {

ASEBA_OP_ADD,

ASEBA_OP_SUB,

ASEBA_OP_MULT,

ASEBA_OP_DIV,

ASEBA_OP_MOD,

ASEBA_OP_SHIFT_LEFT,

ASEBA_OP_SHIFT_RIGHT,

ASEBA_OP_BIT_OR,

ASEBA_OP_BIT_XOR,

ASEBA_OP_BIT_AND

}


group vm

Glue logic must implement:

if (debug command queue is not empty)
    execute debug command
else if (executing a thread)
    run VM
else if (event queue is not empty)
    fetch event
    run VM
else
    sleep until something happens

Defines

ASEBA_NATIVES_STD_COUNT

Embedded targets must know the size of ASEBA_NATIVES_STD_FUNCTIONS without having to compute them by hand, please update this when adding a new function.

ASEBA_NATIVES_STD_FUNCTIONS

snippet to include standard native functions

ASEBA_NATIVES_STD_DESCRIPTIONS

snippet to include descriptions of standard native functions

GET_BIT(v, b)

Return true if bit b of v is 1.

BIT_SET(v, b)

Set bit b of v to 1.

BIT_CLR(v, b)

Set bit b of v to 0.

AsebaMaskSet(v, m)

Set the part masked by m of v to 1.

AsebaMaskClear(v, m)

Set the part masked by m of v to 0.

AsebaMaskIsSet(v, m)

Returns true if the part masked by m of v is 1.

AsebaMaskIsClear(v, m)

Returns true if the part masked by m of v is 0.

AsebaSendMessageWords(vm, type, data, size)

Typedefs

typedef void (*AsebaNativeFunctionPointer)(AsebaVMState *vm)

Signature of a native function.

Enums

enum [anonymous]__anonymous0

Values:

vmASEBA_MAX_BREAKPOINTS = 16

maximum number of simultaneous breakpoints the target supports

enum vmAsebaAssertReason

Possible causes of AsebaAssert.

Values:

vmASEBA_ASSERT_UNKNOWN = 0
vmASEBA_ASSERT_UNKNOWN_UNARY_OPERATOR
vmASEBA_ASSERT_UNKNOWN_BINARY_OPERATOR
vmASEBA_ASSERT_UNKNOWN_BYTECODE
vmASEBA_ASSERT_STACK_OVERFLOW
vmASEBA_ASSERT_STACK_UNDERFLOW
vmASEBA_ASSERT_OUT_OF_VARIABLES_BOUNDS
vmASEBA_ASSERT_OUT_OF_BYTECODE_BOUNDS
vmASEBA_ASSERT_STEP_OUT_OF_RUN
vmASEBA_ASSERT_BREAKPOINT_OUT_OF_BYTECODE_BOUNDS
vmASEBA_ASSERT_EMIT_BUFFER_TOO_LONG

Variables

const int16_t aseba_atan_table[20 * 8 + 1]

= {

652, 735, 816, 896, 977, 1058, 1139, 1218, 1300, 1459, 1620, 1777, 1935, 2093, 2250,

2403, 2556, 2868, 3164, 3458, 3748, 4029, 4307, 4578, 4839, 5359, 5836, 6290, 6720, 7126,

7507, 7861, 8203, 8825, 9357, 9839, 10260, 10640, 10976, 11281, 11557, 12037, 12425, 12755, 13036,

13277, 13486, 13671, 13837, 14112, 14331, 14514, 14666, 14796, 14907, 15003, 15091, 15235, 15348, 15441,

15519, 15585, 15642, 15691, 15736, 15808, 15865, 15912, 15951, 15984, 16013, 16037, 16060, 16096, 16125,

16148, 16168, 16184, 16199, 16211, 16222, 16240, 16255, 16266, 16276, 16284, 16292, 16298, 16303, 16312,

16320, 16325, 16331, 16334, 16338, 16341, 16344, 16348, 16352, 16355, 16357, 16360, 16361, 16363, 16364,

16366, 16369, 16369, 16371, 16372, 16373, 16373, 16375, 16375, 16377, 16376, 16378, 16378, 16378, 16379,

16379, 16380, 16380, 16380, 16382, 16381, 16381, 16381, 16382, 16382, 16382, 16382, 16382, 16382, 16384,

16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16384, 16384, 16384, 16384,

16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384}


const int16_t aseba_sin_table[128 + 1]

= {

0, 403, 804, 1207, 1608, 2010, 2411, 2812, 3212, 3612, 4011, 4411, 4808, 5206, 5603,

5998, 6393, 6787, 7180, 7572, 7962, 8352, 8740, 9127, 9513, 9896, 10279, 10660, 11040, 11417,

11794, 12167, 12540, 12911, 13279, 13646, 14010, 14373, 14733, 15091, 15447, 15801, 16151, 16500, 16846,

17190, 17531, 17869, 18205, 18538, 18868, 19196, 19520, 19842, 20160, 20476, 20788, 21097, 21403, 21706,

22006, 22302, 22595, 22884, 23171, 23453, 23732, 24008, 24279, 24548, 24812, 25073, 25330, 25583, 25833,

26078, 26320, 26557, 26791, 27020, 27246, 27467, 27684, 27897, 28106, 28311, 28511, 28707, 28899, 29086,

29269, 29448, 29622, 29792, 29957, 30117, 30274, 30425, 30572, 30715, 30852, 30985, 31114, 31238, 31357,

31471, 31581, 31686, 31786, 31881, 31972, 32057, 32138, 32215, 32285, 32352, 32413, 32470, 32521, 32569,

32610, 32647, 32679, 32706, 32728, 32746, 32758, 32766, 32767,

}


const AsebaNativeFunctionDescription AsebaNativeDescription_veccopy

= {“math.copy”,

“copies src to dest element by element”,

{{-1, “dest”}, {-1, “src”}, {0, 0}}}


Description of AsebaNative_veccopy.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecfill

= {“math.fill”,

“fills dest with constant value”,

{{-1, “dest”}, {1, “value”}, {0, 0}}}


Description of AsebaNative_vecfill.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecaddscalar

= {

“math.addscalar”,

“add scalar to each element of src and store result to dest”,

{{-1, “dest”}, {-1, “src”}, {1, “scalar”}, {0, 0}}}


Description of AsebaNative_vecaddscalar.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecadd

= {

“math.add”,

“adds src1 and src2, write to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsub

= {

“math.sub”,

“substracts src2 from src1 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmul

= {

“math.mul”,

“multiplies src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdiv

= {

“math.div”,

“divides src1 by src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmin

= {

“math.min”,

“writes the minimum of src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecmin.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmax

= {

“math.max”,

“writes the maximum of src1 and src2 to dest, element by element”,

{{-1, “dest”}, {-1, “src1”}, {-1, “src2”}, {0, 0}}}


Description of AsebaNative_vecsmax.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecclamp

= {

“math.clamp”,

“clamp src to low/high bounds into dest, element by element”,

{{-1, “dest”}, {-1, “src”}, {-1, “low”}, {-1, “high”}, {0, 0}}}


Description of AsebaNative_vecclamp.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdot

= {

“math.dot”,

“writes the dot product of src1 and src2 to dest, after a shift”,

{{1, “dest”}, {-1, “src1”}, {-1, “src2”}, {1, “shift”}, {0, 0}}}


Description of AsebaNative_vecdot.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecstat

= {

“math.stat”,

“performs statistics on src”,

{{-1, “src”}, {1, “min”}, {1, “max”}, {1, “mean”}, {0, 0}}}


Description of AsebaNative_vecstat.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecargbounds

= {

“math.argbounds”,

“get the indices (argmin, argmax) of the limit values of src”,

{{-1, “src”}, {1, “argmin”}, {1, “argmax”}, {0, 0}}}


Description of AsebaNative_vecargbounds.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsort

= {“math.sort”,

“sort array in place”,

{{-1, “array”}, {0, 0}}}


Description of AsebaNative_vecsort.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathmuldiv

= {

“math.muldiv”,

“performs dest = (a*b)/c in 32 bits element by element”,

{{-1, “dest”}, {-1, “a”}, {-1, “b”}, {-1, “c”}, {0, 0}}}


Description of AsebaNative_mathmuldiv.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathatan2

= {

“math.atan2”,

“performs dest = atan2(y,x) element by element”,

{{-1, “dest”}, {-1, “y”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathatan2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsin

= {“math.sin”,

“performs dest = sin(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathsin.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathcos

= {“math.cos”,

“performs dest = cos(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathcos.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathrot2

= {“math.rot2”,

“rotates v of angle a to dest”,

{{2, “dest”}, {2, “v”}, {1, “a”}, {0, 0}}}


Description of AsebaNative_mathrot2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsqrt

= {“math.sqrt”,

“performs dest = sqrt(x) element by element”,

{{-1, “dest”}, {-1, “x”}, {0, 0}}}


Description of AsebaNative_mathsqrt.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecnonzerosequence

= {

“math.nzseq”,

“write to dest the middle index of the largest sequence of non-zero elements from src, -1 if “

“not found or if smaller than minLength”,

{{1, “dest”}, {-1, “src”}, {1, “minLength”}, {0, 0}}}


Description of AsebaNative_vecnonzerosequence.

uint16_t rnd_state
const AsebaNativeFunctionDescription AsebaNativeDescription_rand

= {“math.rand”,

“fill array with random values”,

{{-1, “dest”}, {0, 0}}}


Description of AsebaNative_rand.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqsize

= {“deque.size”,

“report size of dest”,

{{-1, “deque”}, {1, “size”}, {0, 0}}}


Description of AsebaNative_deqsize.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqget

= {

“deque.get”,

“fill dest from deque at index”,

{{-1, “deque”}, {-2, “dest”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqget.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqset

= {

“deque.set”,

“copies src to deque at index”,

{{-1, “deque”}, {-2, “src”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqset.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqinsert

= {

“deque.insert”,

“shift deque at index by len(src) and insert src”,

{{-1, “deque”}, {-2, “src”}, {1, “index”}, {0, 0}}}


Description of AsebaNative_deqinsert.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqerase

= {

“deque.erase”,

“shift deque at index by len to erase”,

{{-1, “deque”}, {1, “index”}, {1, “len”}, {0, 0}}}


Description of AsebaNative_deqerase.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushfront

= {“deque.push_front”,

“insert src before the front of deque”,

{{-1, “deque”}, {-2, “src”}, {0, 0}}}


Description of AsebaNative_deqpushfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushback

= {“deque.push_back”,

“insert src after the back of deque”,

{{-1, “deque”}, {-2, “src”}, {0, 0}}}


Description of AsebaNative_deqpushback.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopfront

= {

“deque.pop_front”,

“fill dest from front of deque then erase elements”,

{{-1, “deque”}, {-2, “dest”}, {0, 0}}}


Description of AsebaNative_deqpopfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopback

= {

“deque.pop_back”,

“fill dest from back of deque then erase elements”,

{{-1, “deque”}, {-2, “dest”}, {0, 0}}}


Description of AsebaNative_deqpopback.

const AsebaNativeFunctionDescription AsebaNativeDescription_veccopy

Description of AsebaNative_veccopy.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecfill

Description of AsebaNative_vecfill.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecaddscalar

Description of AsebaNative_vecaddscalar.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecadd

Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsub

Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmul

Description of AsebaNative_vecadd.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdiv

Description of AsebaNative_vecsub.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmin

Description of AsebaNative_vecmin.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecmax

Description of AsebaNative_vecsmax.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecclamp

Description of AsebaNative_vecclamp.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecdot

Description of AsebaNative_vecdot.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecstat

Description of AsebaNative_vecstat.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecargbounds

Description of AsebaNative_vecargbounds.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecsort

Description of AsebaNative_vecsort.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathmuldiv

Description of AsebaNative_mathmuldiv.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathatan2

Description of AsebaNative_mathatan2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsin

Description of AsebaNative_mathsin.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathcos

Description of AsebaNative_mathcos.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathrot2

Description of AsebaNative_mathrot2.

const AsebaNativeFunctionDescription AsebaNativeDescription_mathsqrt

Description of AsebaNative_mathsqrt.

const AsebaNativeFunctionDescription AsebaNativeDescription_vecnonzerosequence

Description of AsebaNative_vecnonzerosequence.

const AsebaNativeFunctionDescription AsebaNativeDescription_rand

Description of AsebaNative_rand.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqsize

Description of AsebaNative_deqsize.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqget

Description of AsebaNative_deqget.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqset

Description of AsebaNative_deqset.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqinsert

Description of AsebaNative_deqinsert.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqerase

Description of AsebaNative_deqerase.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushfront

Description of AsebaNative_deqpushfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpushback

Description of AsebaNative_deqpushback.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopfront

Description of AsebaNative_deqpopfront.

const AsebaNativeFunctionDescription AsebaNativeDescription_deqpopback

Description of AsebaNative_deqpopback.

void const char* message
dir aseba
dir compiler
dir vm
page index