This class is an internal helper to export current scope values. It was extracted from class Lox to keep that class clean from this somehow 'cluttered' code.
The current purpose of this class is to write information into an AString buffer. This is used by method Lox.State. In the future, other export formats, like JSON might be implemented here.
Public Methods | |
ScopeDump (Dictionary< int, String > threadDictionary, String noKeyHashKey, AString target, int maxKeyLength=10) | |
int | writeScopeDomains (ScopeStore< AString > store, int indentSpaces) |
int | writeScopePrefixes (ScopeStore< Object > store, int indentSpaces) |
int | writeStoreMap< T > (ScopeStore< Dictionary< AString, T >> store) |
Protected Fields | |
AString | key = new AString() |
int | maxKeyLength |
String | noKeyHashKey |
AString | target |
AString | tempAS = new AString() |
Dictionary< int, String > | threadDictionary |
Protected Methods | |
AString | storeKeyToScope (AString key) |
AString | storeThreadToScope (Thread thread) |
Private Methods | |
int | writeStoreMapHelper< T > (Dictionary< AString, T > map, String prefix) |
|
inline |
Constructor
threadDictionary | User-defined threads names. |
noKeyHashKey | String to identify global keys. |
target | Target string to write to. |
maxKeyLength | The start value for the maximum length of a key. |
Helper method to write a ScopeStores' source related scope key as scope information.
key | The key of the StringTree that is to be "translated". |
|
inlineprotected |
Helper method to write thread information.
thread | The thread in question |
|
inline |
Writes the contents of the ScopeStore used for Scope Domains
store | The store to use |
indentSpaces | The number of spaces to add at the beginning of each line. |
|
inline |
Writes the contents of the ScopeStore used for Prefix Logables
store | The store to use |
indentSpaces | The number of spaces to add at the beginning of each line. |
|
inline |
Writes hash tables stored in a ScopeStore. Keys are AStrings. Value types currently supported are Object and int (in C# different method).
store | The store to use. |
|
inlineprivate |
Helper method.
map | The map to use |
prefix | A prefix string for each line |
|
protected |
The maximum length of a key. Adjusts (increases) over lifecycle.
|
protected |
String to identify global keys.
|
protected |
The target to write to
|
protected |
User-defined threads names.