#include <compile.h>
Classes | |
struct | Local |
struct | Parser |
struct | ParseRule |
Static Public Member Functions | |
static const char * | Intern (const std::string &str) |
static bool | HadError () |
static bool | Compile (const char *source, Chunk *chunk) |
static TClassInfo * | GetClassInfo (const char *classname) |
template<typename TObj > | |
static void | Register () |
Private Types | |
enum | Precedence { PREC_NONE, PREC_ASSIGNMENT, PREC_OR, PREC_AND, PREC_EQUALITY, PREC_COMPARISON, PREC_TERM, PREC_FACTOR, PREC_UNARY, PREC_CALL, PREC_PRIMARY } |
using | ParseFn = void(Compiler::*)(bool) |
Private Member Functions | |
void | Declaration () |
void | Statement () |
void | Synchronize () |
void | Block () |
void | BeginScope () |
void | EndScope () |
void | VarDeclaration () |
uint8_t | IdentifierConstant (Token *token) |
uint8_t | ParseVariable (const char *errorMessage) |
void | DefineVariable (uint8_t global) |
void | DeclareVariable () |
void | AddLocal (Token name) |
int | ResolveLocal (Token *name) |
void | MarkIntialized () |
void | FieldsStatement () |
void | PrintStatement () |
void | ExpressionStatement () |
void | IfStatement () |
void | WhileStatement () |
void | ForStatement () |
void | ReturnStatement () |
bool | Match (TokenType type) |
bool | Check (TokenType type) |
void | ErrorAt (Token &token, const char *message) |
void | PatchJump (int offset) |
int | EmitJump (uint8_t instruction) |
void | EmitLoop (int loopStart) |
void | EmitByte (uint8_t byte) |
void | EmitBytes (uint8_t bytea, uint8_t byteb) |
void | EmitReturn () |
void | EmitConstant (Value value) |
uint8_t | MakeConstant (Value value) |
void | Number (bool canAssign) |
void | Grouping (bool canAssign) |
void | Unary (bool canAssign) |
void | Binary (bool canAssign) |
void | Literal (bool canAssign) |
void | String (bool canAssign) |
void | Variable (bool canAssign) |
void | And (bool canAssign) |
void | Or (bool canAssign) |
void | Call (bool canAssign) |
void | Index (bool canAssign) |
void | Dot (bool canAssign) |
void | NamedVariable (Token token, bool canAssign) |
void | ParsePrecedence (Precedence precedence) |
ParseRule * | GetRule (TokenType type) const |
uint8_t | ArgumentList () |
void | Advance () |
void | Expression () |
void | Consume (TokenType type, const char *message) |
void | SetChunk (Chunk *chunk) |
void | Finish () |
Chunk * | CurrentChunk () |
Compiler () | |
bool | DoCompile (const char *_source, Chunk *chunk) |
const char * | DoIntern (const std::string &str) |
void | DoRegister (const char *classname) |
Static Private Member Functions | |
static Compiler & | Instance () |
Private Attributes | |
std::unordered_set< std::string > | strings |
Parser | parser |
Scanner | scanner |
Chunk * | current |
std::vector< Local > | locals |
int | scopeDepth |
TClassList | tclasslist |
const char * | source |
|
private |
|
private |
Enumerator | |
---|---|
PREC_NONE | |
PREC_ASSIGNMENT | |
PREC_OR | |
PREC_AND | |
PREC_EQUALITY | |
PREC_COMPARISON | |
PREC_TERM | |
PREC_FACTOR | |
PREC_UNARY | |
PREC_CALL | |
PREC_PRIMARY |
Definition at line 21 of file compile.h.
|
private |
Definition at line 29 of file compile.cc.
|
private |
Definition at line 108 of file compile.cc.
|
private |
Definition at line 398 of file compile.cc.
|
private |
Definition at line 465 of file compile.cc.
|
private |
Definition at line 475 of file compile.cc.
|
private |
Definition at line 306 of file compile.cc.
|
private |
Definition at line 575 of file compile.cc.
|
private |
Definition at line 299 of file compile.cc.
|
private |
Definition at line 504 of file compile.cc.
|
private |
Definition at line 344 of file compile.cc.
|
inlinestatic |
Definition at line 140 of file compile.h.
|
private |
Definition at line 409 of file compile.cc.
|
private |
Definition at line 35 of file compile.cc.
|
private |
Definition at line 91 of file compile.cc.
|
private |
Definition at line 122 of file compile.cc.
|
private |
Definition at line 8 of file compile.cc.
|
private |
Definition at line 673 of file compile.cc.
|
private |
Definition at line 678 of file compile.cc.
|
private |
Definition at line 491 of file compile.cc.
|
private |
Definition at line 359 of file compile.cc.
|
private |
Definition at line 363 of file compile.cc.
|
private |
Definition at line 434 of file compile.cc.
|
private |
Definition at line 281 of file compile.cc.
|
private |
Definition at line 348 of file compile.cc.
|
private |
Definition at line 430 of file compile.cc.
|
private |
Definition at line 310 of file compile.cc.
|
private |
Definition at line 386 of file compile.cc.
|
private |
Definition at line 394 of file compile.cc.
|
private |
Definition at line 332 of file compile.cc.
|
private |
Definition at line 320 of file compile.cc.
|
private |
Definition at line 418 of file compile.cc.
|
private |
Definition at line 201 of file compile.cc.
|
inlinestatic |
|
private |
Definition at line 621 of file compile.cc.
|
private |
Definition at line 460 of file compile.cc.
|
private |
Definition at line 61 of file compile.cc.
|
private |
Definition at line 266 of file compile.cc.
|
private |
Definition at line 498 of file compile.cc.
|
inlinestaticprivate |
|
inlinestatic |
|
private |
Definition at line 534 of file compile.cc.
|
private |
Definition at line 438 of file compile.cc.
|
private |
Definition at line 118 of file compile.cc.
|
private |
Definition at line 338 of file compile.cc.
|
private |
Definition at line 553 of file compile.cc.
|
private |
Definition at line 447 of file compile.cc.
|
private |
Definition at line 509 of file compile.cc.
|
private |
Definition at line 598 of file compile.cc.
|
private |
Definition at line 67 of file compile.cc.
|
private |
Definition at line 288 of file compile.cc.
|
private |
Definition at line 326 of file compile.cc.
|
inlinestatic |
|
private |
Definition at line 79 of file compile.cc.
|
private |
Definition at line 253 of file compile.cc.
|
inlineprivate |
|
private |
Definition at line 154 of file compile.cc.
|
private |
Definition at line 544 of file compile.cc.
|
private |
Definition at line 131 of file compile.cc.
|
private |
Definition at line 520 of file compile.cc.
|
private |
Definition at line 46 of file compile.cc.
|
private |
Definition at line 549 of file compile.cc.
|
private |
Definition at line 183 of file compile.cc.
|
private |
|
private |