BaseRuntime class abstract
Implements common Lua runtime logic. Extend with mixin ReturnStmtCallStackUnwind or ReturnStmtDoNotUnwind.
The reason the return statement behavior is omitted is
b/c this library can be used to perform static analysis
as well. In such cases it's desirable to anaylze all
control flows instead of aborting early on return.
This decision allows the users of this library to choose
how to configure their desired runtime.
- Inheritance
- Implementers
Constructors
- BaseRuntime(BaseResults results)
Properties
- context → LuaObject?
-
no setter
- debugPath ↔ String?
-
getter/setter pair
- global → Scope
-
final
- hasContext → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- onIncludeImpl ↔ IncludeCallback?
-
getter/setter pair
- results → BaseResults
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope ↔ Scope
-
getter/setter pair
Methods
-
addDiagnostic(
String info) → void -
addError(
String err) → void -
addWarning(
String warn) → void -
callLuaFunction(
LuaObject obj, {List< Object?> args = const []}) → LuaObject? -
Given a callable lua
objand a list ofargs, configure a new scope with the providedargsas parameters based on the LuaObject.funcDef record. Args exceeding the parameter list will be dropped. Any remaining parameters will be filled by LuaObject.nil values. Any exceptions are caught and tracked for the trace back later. The scope is popped and any return result LuaObject is returned. -
debugSetPath(
String? path) → void -
defGlobal(
LuaObject value) → LuaObject -
defLocal(
LuaObject value) → LuaObject -
findOnSelf(
String field, {Object? or}) → LuaObject? -
First finds
fieldinside object "self" in Scope. If neither can be found,oris returned cast toLua. Iforis not provided, null is returned. -
findVar(
String id) → LuaObject? -
findVarArgs(
) → List< LuaObject> ? -
lineInfo(
Token token) → String -
lineTag(
Token token) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
popScope(
) → void -
pushScope(
{LuaObject? context}) → void -
tokenId(
Token token, {String? prefix}) → String -
toString(
) → String -
A string representation of this object.
inherited
-
visitAssignExpr(
AssignExpr assignExpr) → Object? -
override
-
visitAssignMultiExpr(
AssignMultiExpr assignMultiExpr) → Object? -
override
-
visitAST(
AST ast) → Object? -
override
-
visitBinaryExpr(
BinaryExpr expr) → Object? -
override
-
visitBooleanLiteral(
BooleanLiteral boolean) → Object? -
override
-
visitBreakStmt(
BreakStmt stmt) → Object? -
override
-
visitDeclArg(
DeclArg declArg) → Object? -
override
-
visitDeclMultiVar(
DeclMultiVar declMultiVar) → Object? -
override
-
visitDeclVar(
DeclVar declVar) → Object? -
override
-
visitForIterLoopStmt(
ForIterLoopStmt forIterLoopStmt) → Object? -
override
-
visitForLoopStmt(
ForLoopStmt forLoopStmt) → Object? -
override
-
visitFuncExpr(
FuncExpr expr) → Object? -
override
-
visitGotoLabelStmt(
GotoLabelStmt stmt) → Object? -
override
-
visitGotoStmt(
GotoStmt stmt) → Object? -
override
-
visitGroupExpr(
GroupExpr groupExpr) → Object? -
override
-
visitIfStmt(
IfStmt stmt) → Object? -
override
-
visitKeyValStmt(
KeyValStmt keyval) → Object? -
override
-
visitMemoryAccess(
MemoryAccess memoryAccess) → Object? -
override
-
visitNilLiteral(
NilLiteral nil) → Object? -
override
-
visitNotExpr(
NotExpr notExpr) → Object? -
override
-
visitNumberLiteral(
NumberLiteral number) → Object? -
override
-
visitRawExpr(
RawExpr rawExpr) → Object? -
override
-
visitRepeatUntilLoopStmt(
RepeatUntilLoopStmt repeatUntilLoopStmt) → Object? -
override
-
visitReturnStmt(
ReturnStmt expr) → Object? -
inherited
-
visitSelfExpr(
SelfExpr selfExpr) → Object? -
override
-
visitStringLiteral(
StringLiteral string) → Object? -
override
-
visitTableLiteral(
TableLiteral table) → Object? -
override
-
visitUnaryExpr(
UnaryExpr expr) → Object? -
override
-
visitWhileLoopStmt(
WhileLoopStmt whileLoopStmt) → Object? -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited