|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/Material/ShaderCompiler/SymbolTable.hpp>
Classes | |
| struct | Symbol |
Public Types | |
| using | OnOverrideProc = UniqueFunction< bool(SymbolType &prevSymbol) const > |
| using | OnReleaseProc = UniqueFunction< void(const SymbolType &symbol) const > |
| using | SearchPredicateProc = UniqueFunction< bool(const SymbolType &symbol) const > |
Public Member Functions | |
| SymbolTable () | |
| void | openScope () |
| void | closeScope (const OnReleaseProc &releaseProc=nullptr) |
| bool | register_ (const String &ident, SymbolType symbol, const OnOverrideProc &overrideProc=nullptr, const bool throwOnFailure=true) |
| Registers the specified symbol in the current scope (if the identifier is not empty). | |
| SymbolType | fetch (const String &ident) const |
| SymbolType | fetchFromCurrentScope (const String &ident) const |
| SymbolType | find (const SearchPredicateProc &searchPredicate) const |
| String | fetchSimilar (const String &ident) const |
| std::size_t | getScopeLevel () const |
| bool | isInsideGlobalScope () const |
Private Attributes | |
| Map< String, Stack< Symbol > > | mSymTable |
| Vector< Vector< Symbol > > | mSymTableAnonymous |
| Stack< Vector< String > > | mScopeStack |
| Stores all identifiers for the current stack. | |
| using CeresEngine::ShaderCompiler::SymbolTable< SymbolType >::OnOverrideProc = UniqueFunction<bool(SymbolType& prevSymbol) const> |
| using CeresEngine::ShaderCompiler::SymbolTable< SymbolType >::OnReleaseProc = UniqueFunction<void(const SymbolType& symbol) const> |
| using CeresEngine::ShaderCompiler::SymbolTable< SymbolType >::SearchPredicateProc = UniqueFunction<bool(const SymbolType& symbol) const> |
|
inline |
|
inline |
Remove all symbols from the table which are in the current scope
Callback for released symbol
Remove symbol from the top most scope level
Remove symbol entry completely if it's reference list is empty
Release all symbols from the anonymous symbol table
Decrease scope level
|
inline |
|
inline |
|
inline |
Find similar identifiers
Check if the distance is not too large
No similarities found
|
inline |
Search symbol in identifiable symbol ist
Search symbol in anonymous symbol list
|
inline |
|
inline |
|
inline |
|
inline |
Registers the specified symbol in the current scope (if the identifier is not empty).
At least one scope must be open before symbols can be registered!
Validate input parameters
Register symbol in anonymous symbol table
Check if identifier was already registered in the current scope
Call override procedure and pass previous symbol entry as reference
Register new identifier
|
private |
Stores all identifiers for the current stack.
All these identifiers will be removed from "mSymTable" when a scope will be closed.
|
private |
|
private |