Joos1W Compiler Framework
|
Public Member Functions | |
Semantic (BumpAllocator &alloc, diagnostics::DiagnosticEngine &diag) | |
UnresolvedType * | BuildUnresolvedType (SourceRange loc={}) |
ReferenceType * | BuildReferenceType (Decl const *decl) |
ArrayType * | BuildArrayType (Type *elementType, SourceRange loc={}) |
BuiltInType * | BuildBuiltInType (parsetree::BasicType::Type type, SourceRange loc={}) |
BuiltInType * | BuildBuiltInType (parsetree::Literal::Type type) |
BuiltInType * | BuildBuiltInType (ast::BuiltInType::Kind type) |
VarDecl * | BuildVarDecl (Type *type, SourceRange location, string_view name, ScopeID const *scope, Expr *init=nullptr) |
FieldDecl * | BuildFieldDecl (Modifiers modifiers, SourceRange location, Type *type, string_view name, Expr *init=nullptr, bool allowFinal=false) |
LinkingUnit * | BuildLinkingUnit (array_ref< CompilationUnit * > compilationUnits) |
CompilationUnit * | BuildCompilationUnit (ReferenceType *package, array_ref< ImportDeclaration > imports, SourceRange location, DeclContext *body) |
ClassDecl * | BuildClassDecl (Modifiers modifiers, SourceRange location, string_view name, ReferenceType *superClass, array_ref< ReferenceType * > interfaces, array_ref< Decl * > classBodyDecls) |
InterfaceDecl * | BuildInterfaceDecl (Modifiers modifiers, SourceRange location, string_view name, array_ref< ReferenceType * > extends, array_ref< Decl * > interfaceBodyDecls) |
MethodDecl * | BuildMethodDecl (Modifiers modifiers, SourceRange location, string_view name, Type *returnType, array_ref< VarDecl * > parameters, bool isConstructor, Stmt *body) |
BlockStatement * | BuildBlockStatement (array_ref< Stmt * > stmts) |
DeclStmt * | BuildDeclStmt (VarDecl *decl) |
ExprStmt * | BuildExprStmt (Expr *expr) |
IfStmt * | BuildIfStmt (Expr *condition, Stmt *thenStmt, Stmt *elseStmt=nullptr) |
WhileStmt * | BuildWhileStmt (Expr *condition, Stmt *body) |
ForStmt * | BuildForStmt (Stmt *init, Expr *condition, Stmt *update, Stmt *body) |
ReturnStmt * | BuildReturnStmt (SourceRange loc, Expr *expr) |
NullStmt * | BuildNullStmt () |
BumpAllocator & | allocator () |
void | ResetLexicalLocalScope () |
Clears the lexical local scope names. | |
bool | AddLexicalLocal (VarDecl *decl) |
Checks if a name is in the lexical local scope and if it is not, add it to the scope. More... | |
int | EnterLexicalScope () |
Called when a new lexical scope is entered. Returns the size of the local declaration stack so it can be restored when the scope is exited. More... | |
void | ExitLexicalScope (int size) |
Called when a lexical scope is exited. Resizes the local decl stack to the size it was when the scope was entered. Deletes the locals from the set as well. More... | |
auto | getAllLexicalDecls () const |
Get all the lexical declarations in the current scope. | |
ast::ScopeID const * | NextScopeID () |
ast::ScopeID const * | CurrentScopeID () const |
ast::ScopeID const * | NextFieldScopeID () |
ast::ScopeID const * | CurrentFieldScopeID () const |
void | ResetFieldScope () |
Definition at line 15 of file Semantic.h.
|
inline |
Checks if a name is in the lexical local scope and if it is not, add it to the scope.
name | The name to add to the scope |
Definition at line 96 of file Semantic.h.
References ast::Decl::name().
|
inline |
Called when a new lexical scope is entered. Returns the size of the local declaration stack so it can be restored when the scope is exited.
Definition at line 110 of file Semantic.h.
References ast::ScopeID::next().
|
inline |
Called when a lexical scope is exited. Resizes the local decl stack to the size it was when the scope was entered. Deletes the locals from the set as well.
size | The size of the local declaration stack when the scope was entered |
Definition at line 123 of file Semantic.h.
References ast::ScopeID::next().