Class ScopeBase
java.lang.Object
com.bradyrussell.uiscoin.lang.compiler.scope.ScopeBase
- Direct Known Subclasses:
ScopeGlobal
,ScopeLocal
public class ScopeBase
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<ScopeBase>
Children
ScopeBase
Parent
protected int
ScopeAddress
protected int
ScopeBaseAddress
java.lang.String
ScopeName
protected java.util.HashMap<java.lang.String,StructDefinition>
structDefinitions
protected java.util.HashMap<java.lang.String,java.lang.Object>
symbolTable
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
declareArray(java.lang.String Name, PrimitiveType SymbolType, int Length)
int
declareConstantInlineSymbol(java.lang.String Name, TypedValue Value)
int
declareStruct(java.lang.String Name, java.lang.String StructType)
int
declareSymbol(java.lang.String Name, PrimitiveType SymbolType)
ScopeLocal
defineFunction(java.lang.String Name, PrimitiveType SymbolType, java.util.List<NameAndType> Parameters)
boolean
defineStruct(java.lang.String Name, java.util.List<NameAndType> Fields)
ScopeBase
findScopeContaining(java.lang.String Name)
StructDefinition
findStructDefinition(java.lang.String StructType)
java.lang.String
getAllocation()
java.lang.String
getDeallocation()
int
getDepth()
java.lang.String
getRecursiveAllocation()
java.lang.Object
getSymbol(java.lang.String Name)
boolean
hasSymbol(java.lang.String Name)
int
size()
java.lang.String
toString()
-
Field Details
-
ScopeName
public java.lang.String ScopeName -
Parent
-
Children
-
symbolTable
protected java.util.HashMap<java.lang.String,java.lang.Object> symbolTable -
structDefinitions
-
ScopeBaseAddress
protected int ScopeBaseAddress -
ScopeAddress
protected int ScopeAddress
-
-
Constructor Details
-
Method Details
-
defineFunction
public ScopeLocal defineFunction(java.lang.String Name, PrimitiveType SymbolType, java.util.List<NameAndType> Parameters) -
defineStruct
-
declareSymbol
-
declareStruct
public int declareStruct(java.lang.String Name, java.lang.String StructType) -
declareArray
-
declareConstantInlineSymbol
-
getSymbol
public java.lang.Object getSymbol(java.lang.String Name) -
hasSymbol
public boolean hasSymbol(java.lang.String Name) -
size
public int size() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
findScopeContaining
-
findStructDefinition
-
getRecursiveAllocation
public java.lang.String getRecursiveAllocation() -
getAllocation
public java.lang.String getAllocation() -
getDeallocation
public java.lang.String getDeallocation() -
getDepth
public int getDepth()
-