Package icyllis.arc3d.compiler
Class SymbolTable
java.lang.Object
icyllis.arc3d.compiler.SymbolTable
Maps identifiers to symbols, each instance represents a scope level or a module boundary.
-
Method Summary
Modifier and TypeMethodDescriptionLooks up the requested symbol and returns a const pointer.findBuiltinSymbol
(String name) Looks up the requested symbol, only searching the built-in symbol tables.getArrayType
(Type type, int size) Finds or creates an array type with the given element type and array size.<T extends Symbol>
TInserts a symbol into the symbol table, reports errors if there was a name collision.boolean
boolean
isBuiltinType
(String name) Returns true if the name refers to a builtin type.boolean
Returns true if the name refers to a type (user or built-in) in the current symbol table.
-
Method Details
-
getParent
-
isBuiltin
public boolean isBuiltin()- Returns:
- true if this symbol table is at built-in level
-
find
Looks up the requested symbol and returns a const pointer. -
findBuiltinSymbol
Looks up the requested symbol, only searching the built-in symbol tables. Always const. -
isType
Returns true if the name refers to a type (user or built-in) in the current symbol table. -
isBuiltinType
Returns true if the name refers to a builtin type. -
insert
Inserts a symbol into the symbol table, reports errors if there was a name collision.- Returns:
- the given symbol if successful, or null if there was a name collision
-
getArrayType
Finds or creates an array type with the given element type and array size.
-