C# Class Wren.Core.Bytecode.Compiler

Show file Open project: robotii/Wren.NET Class Usage Examples

Public Methods

Method Description
BindMethodCode ( ObjClass classObj, ObjFn fn ) : void
Compile ( WrenVM vm, ObjModule module, string sourcePath, string source, bool printErrors ) : ObjFn
Compiler ( Parser parser, Compiler parent, bool isFunction ) : System
DumpByteCode ( WrenVM vm, ObjFn fn ) : string

Private Methods

Method Description
AddConstant ( Wren.Core.Objects.Obj constant ) : int
AddStringChar ( Parser parser, char c ) : void
AddUpvalue ( bool isLocal, int index ) : int
Block ( ) : void
Boolean ( Compiler c, bool allowAssignment ) : void
Call ( Compiler c, bool allowAssignment ) : void
CallMethod ( int numArgs, string name ) : void
CallSignature ( Instruction instruction, Signature signature ) : void
ClassDefinition ( bool isForeign ) : void
Conditional ( Compiler c, bool allowAssignment ) : void
ConstructorSignature ( Compiler c, Signature signature ) : void
Consume ( TokenType expected, string errorMessage ) : void
ConsumeLine ( string errorMessage ) : void
CreateConstructor ( Signature signature, int initializerSymbol ) : void
DeclareNamedVariable ( ) : int
DeclareVariable ( Token token ) : int
DefineLocal ( string name, int length ) : int
DefineMethod ( int classSlot, bool isStaticMethod, int methodSymbol ) : void
DefineVariable ( int symbol ) : void
Definition ( ) : void
DiscardLocals ( int depth ) : int
Emit ( int b ) : int
Emit ( Instruction b ) : void
EmitByteArg ( Instruction instruction, int arg ) : int
EmitJump ( Instruction instruction ) : int
EmitShort ( int arg ) : void
EmitShortArg ( Instruction instruction, int arg ) : void
EndCompiler ( string debugName ) : ObjFn
EndLoop ( ) : void
Error ( string format ) : void
Expression ( ) : void
Field ( Compiler c, bool allowAssignment ) : void
FindUpvalue ( string name, int length ) : int
FinishArgumentList ( Signature signature ) : void
FinishBlock ( ) : bool
FinishBody ( bool isConstructor ) : void
FinishParameterList ( Signature signature ) : void
ForStatement ( ) : void
GetEnclosingClass ( ) : ClassCompiler
GetEnclosingClassCompiler ( ) : Compiler
GetNumArguments ( byte bytecode, List constants, int ip ) : int
GetRule ( TokenType type ) : GrammarRule
GetTokenString ( Parser parser ) : string
Grouping ( Compiler c, bool allowAssignment ) : void
IgnoreNewlines ( ) : void
Import ( ) : void
InfixOp ( Compiler c, bool allowAssignment ) : void
InfixSignature ( Compiler c, Signature signature ) : void
IsDigit ( char c ) : bool
IsLocalName ( string name ) : bool
IsName ( char c ) : bool
LexError ( Parser parser, string format ) : void
List ( Compiler c, bool allowAssignment ) : void
LoadCoreVariable ( string name ) : void
LoadLocal ( int slot ) : void
LoadThis ( ) : void
LoopBody ( ) : void
MakeNumber ( Parser parser, bool isHex ) : void
MakeToken ( Parser parser, TokenType type ) : void
Map ( Compiler c, bool allowAssignment ) : void
Match ( TokenType expected ) : bool
MatchLine ( ) : bool
MaybeSetter ( Signature signature ) : bool
Method ( ClassCompiler classCompiler, int classSlot ) : bool
MethodCall ( Instruction instruction, Signature signature ) : void
MethodSymbol ( string name ) : int
MixedSignature ( Compiler c, Signature signature ) : void
Name ( Compiler c, bool allowAssignment ) : void
NamedCall ( bool allowAssignment, Instruction instruction ) : void
NamedSignature ( Compiler c, Signature signature ) : void
NextChar ( Parser parser ) : char
NextToken ( ) : void
Number ( Compiler c, bool allowAssignment ) : void
ParameterList ( Signature signature ) : void
ParsePrecedence ( bool allowAssignment, Precedence precedence ) : void
PatchJump ( int offset ) : void
Peek ( ) : TokenType
PeekChar ( Parser parser ) : char
PeekNextChar ( Parser parser ) : char
PopScope ( ) : void
PushScope ( ) : void
ReadHexDigit ( Parser parser ) : int
ReadHexEscape ( int digits, string description ) : int
ReadHexNumber ( Parser parser ) : void
ReadName ( Parser parser, TokenType type ) : void
ReadNumber ( Parser parser ) : void
ReadString ( ) : void
ReadUnicodeEscape ( int length ) : void
ResolveLocal ( string name, int length ) : int
ResolveName ( string name, int length, Instruction &loadInstruction ) : int
ResolveNonmodule ( string name, int length, Instruction &loadInstruction ) : int
SignatureFromToken ( Signature signature, SignatureType type ) : Signature
SignatureParameterList ( string name, int numParams, char leftBracket, char rightBracket ) : string
SignatureSymbol ( Signature signature ) : int
SignatureToString ( Signature signature ) : string
SkipBlockComment ( Parser parser ) : void
SkipLineComment ( Parser parser ) : void
StartLoop ( Loop l ) : void
Statement ( ) : void
StaticField ( Compiler c, bool allowAssignment ) : void
StringConstant ( ) : int
Subscript ( Compiler c, bool allowAssignment ) : void
SubscriptSignature ( Compiler c, Signature signature ) : void
TestExitLoop ( ) : void
TwoCharToken ( Parser parser, char c, TokenType two, TokenType one ) : void
UnaryOp ( Compiler c, bool allowAssignment ) : void
UnarySignature ( Compiler c, Signature signature ) : void
ValidateNumParameters ( int numArgs ) : void
Variable ( bool allowAssignment, int index, Instruction loadInstruction ) : void
VariableDefinition ( ) : void
WhileStatement ( ) : void
and_ ( Compiler c, bool allowAssignment ) : void
null_ ( Compiler c, bool allowAssignment ) : void
or_ ( Compiler c, bool allowAssignment ) : void
string_ ( Compiler c, bool allowAssignment ) : void
super_ ( Compiler c, bool allowAssignment ) : void
this_ ( Compiler c, bool allowAssignment ) : void

Method Details

BindMethodCode() public static method

public static BindMethodCode ( ObjClass classObj, ObjFn fn ) : void
classObj Wren.Core.Objects.ObjClass
fn Wren.Core.Objects.ObjFn
return void

Compile() public static method

public static Compile ( WrenVM vm, ObjModule module, string sourcePath, string source, bool printErrors ) : ObjFn
vm Wren.Core.VM.WrenVM
module Wren.Core.Objects.ObjModule
sourcePath string
source string
printErrors bool
return Wren.Core.Objects.ObjFn

Compiler() public method

public Compiler ( Parser parser, Compiler parent, bool isFunction ) : System
parser Parser
parent Compiler
isFunction bool
return System

DumpByteCode() public static method

public static DumpByteCode ( WrenVM vm, ObjFn fn ) : string
vm Wren.Core.VM.WrenVM
fn Wren.Core.Objects.ObjFn
return string