|
|
void | internalCompilerError () const |
| | There is a bug in the compiler, ask for a bug report.
|
| |
|
void | expect (const Token::Type &type) const |
| | Check if next token is of type, produce an exception otherwise.
|
| |
|
unsigned | expectUInt12Literal () const |
| | Check if next token is an unsigned 12 bits integer literal. If so, return it, if not, throw an exception.
|
| |
|
unsigned | expectUInt16Literal () const |
| | Check if next token is an unsigned 16 bits integer literal. If so, return it, if not, throw an exception.
|
| |
|
unsigned | expectPositiveInt16Literal () 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 | expectAbsoluteInt16Literal (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 | expectPositiveConstant () const |
| | Check if next toxen is a valid positive part of a 16 bits signed integer constant.
|
| |
|
int | expectConstant () const |
| | Check if next toxen is a valid 16 bits signed integer constant.
|
| |
|
unsigned | expectPositiveInt16LiteralOrConstant () const |
| | Check and return either the positive part of a 16 bits signed integer or the value of a valid constant.
|
| |
|
int | expectInt16Literal () |
| | Check and return a 16 bits signed integer.
|
| |
|
int | expectInt16LiteralOrConstant () |
| | Check and return either a 16 bits signed integer or the value of a valid constant.
|
| |
|
unsigned | expectGlobalEventId () const |
| | Check if next token is a known global event identifier.
|
| |
|
unsigned | expectAnyEventId () const |
| | Check if next token is a known local or global event identifier.
|
| |
|
std::wstring | eventName (unsigned eventId) const |
| | Return the name of an event given its identifier.
|
| |
|
template<int length> |
| bool | isOneOf (const Token::Type types[length]) const |
| | Return true if next token is of the following types.
|
| |
|
template<int length> |
| void | expectOneOf (const Token::Type types[length]) const |
| | Check if next token is of one of the following types, produce an exception otherwise.
|
| |
|
void | freeTemporaryMemory () |
| |
|
unsigned | allocateTemporaryMemory (const SourcePos varPos, const unsigned size) |
| |
|
AssignmentNode * | allocateTemporaryVariable (const SourcePos varPos, Node *rValue) |
| |
|
VariablesMap::const_iterator | findVariable (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 | findFunction (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.
|
| |
|
ConstantsMap::const_iterator | findConstant (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.
|
| |
|
EventsMap::const_iterator | findGlobalEvent (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.
|
| |
|
EventsMap::const_iterator | findAnyEvent (const std::wstring &name, const SourcePos &pos) const |
| |
|
SubroutineReverseTable::const_iterator | findSubroutine (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 | constantExists (const std::wstring &name) const |
| | Return true if a constant of a given name exists.
|
| |
|
void | buildMaps () |
| | Build variables and functions maps.
|
| |
| void | tokenize (std::wistream &source) |
| | Parse source and build tokens vector. More...
|
| |
|
wchar_t | getNextCharacter (std::wistream &source, SourcePos &pos) |
| |
|
bool | testNextCharacter (std::wistream &source, SourcePos &pos, wchar_t test, Token::Type tokenIfTrue) |
| |
|
void | dumpTokens (std::wostream &dest) const |
| | Debug print of tokens.
|
| |
|
bool | verifyStackCalls (PreLinkBytecode &preLinkBytecode) |
| | Verify that no call path can create a stack overflow.
|
| |
|
bool | link (const PreLinkBytecode &preLinkBytecode, BytecodeVector &bytecode) |
| | Create the final bytecode for a microcontroller.
|
| |
|
void | disassemble (BytecodeVector &bytecode, const PreLinkBytecode &preLinkBytecode, std::wostream &dump) const |
| | Disassemble a microcontroller bytecode and dump it.
|
| |
|
Node * | parseProgram () |
| | Parse "program" grammar element.
|
| |
|
Node * | parseStatement () |
| | Parse "statement" grammar element.
|
| |
|
Node * | parseBlockStatement () |
| | Parse "block statement" grammar element.
|
| |
|
Node * | parseReturn () |
| | Parse "return statement" grammar element.
|
| |
|
void | parseConstDef () |
| | Parse "const def" elements.
|
| |
|
Node * | parseVarDef () |
| | Parse "var def" grammar element.
|
| |
|
AssignmentNode * | parseVarDefInit (MemoryVectorNode *lValue) |
| |
|
Node * | parseAssignment () |
| | Parse "assignment" grammar element.
|
| |
|
Node * | parseIfWhen (bool edgeSensitive) |
| | Parse "if" grammar element.
|
| |
|
Node * | parseFor () |
| | Parse "for" grammar element.
|
| |
|
Node * | parseWhile () |
| | Parse "while" grammar element.
|
| |
|
Node * | parseOnEvent () |
| | Parse "onevent" grammar element.
|
| |
|
Node * | parseEmit (bool shorterArgsAllowed=false) |
| | Parse "event" grammar element.
|
| |
|
Node * | parseSubDecl () |
| | Parse "sub" grammar element, declaration of subroutine.
|
| |
|
Node * | parseCallSub () |
| | Parse "subcall" grammar element, call of subroutine.
|
| |
|
Node * | parseOr () |
| | Parse "or" grammar element.
|
| |
|
Node * | parseAnd () |
| | Parse "and" grammar element.
|
| |
|
Node * | parseNot () |
| | Parse "not" grammar element.
|
| |
|
Node * | parseCondition () |
| | Parse "condition" grammar element.
|
| |
|
Node * | parseBinaryOrExpression () |
| | Parse "binary or" grammar element.
|
| |
|
Node * | parseBinaryXorExpression () |
| | Parse "binary xor" grammar element.
|
| |
|
Node * | parseBinaryAndExpression () |
| | Parse "binary and" grammar element.
|
| |
|
Node * | parseShiftExpression () |
| | Parse "shift_expression" grammar element.
|
| |
|
Node * | parseAddExpression () |
| | Parse "add_expression" grammar element.
|
| |
|
Node * | parseMultExpression () |
| | Parse "mult_expression" grammar element.
|
| |
|
Node * | parseUnaryExpression () |
| | Parse "unary_expression" grammar element.
|
| |
|
Node * | parseFunctionCall () |
| | Parse "function_call" grammar element.
|
| |
|
TupleVectorNode * | parseTupleVector (bool compatibility=false) |
| | Parse "[ .... ]" grammar element.
|
| |
|
Node * | parseConstantAndVariable () |
| |
|
MemoryVectorNode * | parseVariable () |
| |
|
unsigned | parseVariableDefSize () |
| |
|
Node * | tryParsingConstantExpression (SourcePos pos, int &constantResult) |
| | Use parseBinaryOrExpression() and try to reduce the result into an integer If successful, return NULL and the integer in constantResult If unsuccessful, return the parsed tree (constantResult useless in this case)
|
| |
|
int | expectConstantExpression (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.
|
| |
Aseba Event Scripting Language compiler.