public abstract class AbstractScope extends AbstractStatement implements Scope
| Modifier and Type | Field and Description |
|---|---|
protected FramedScope |
framedScope |
protected Scope |
parentScope |
protected List<Statement> |
statements |
protected List<Variable> |
variables |
location| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScope(FramedScope framedScope,
@Nullable Scope parentScope,
Location location) |
protected |
AbstractScope(Scope parentScope,
Location location) |
| Modifier and Type | Method and Description |
|---|---|
Statement |
addStatement(Statement executable)
Add given statement to the current scope
|
void |
addVariable(Variable variable)
Add variable to the scope
|
Variable |
createVariable(VariableData variableData)
Create variable with given properties in the current scope
|
FramedScope |
getFramedScope()
Get parent frame
|
io.vavr.control.Option<Scope> |
getParentScope()
Get parent scope
|
List<? extends Statement> |
getStatements()
Get all statements
|
io.vavr.control.Option<Variable> |
getVariable(String name)
Get variable with the given name
|
List<? extends Variable> |
getVariables()
Get variables
|
boolean |
hasEffective(Class<? extends Statement> statementClass)
Check if scope has effective (statement that is always reachable) statement of the given type
|
boolean |
removeVariable(String name)
Remove variable with the given name
|
getSourceLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetStandardizedFramedScopegetSourceLocationprotected final Scope parentScope
protected final FramedScope framedScope
protected AbstractScope(FramedScope framedScope, @Nullable @Nullable Scope parentScope, Location location)
public Statement addStatement(Statement executable)
ScopeaddStatement in interface Scopeexecutable - the statement to addpublic boolean hasEffective(Class<? extends Statement> statementClass)
ScopehasEffective in interface ScopestatementClass - type of statements to search forpublic Variable createVariable(VariableData variableData)
ScopecreateVariable in interface ScopevariableData - the data about variablepublic void addVariable(Variable variable)
ScopeaddVariable in interface Scopevariable - the variable to addpublic boolean removeVariable(String name)
ScoperemoveVariable in interface Scopename - the name of variable to search forpublic io.vavr.control.Option<Variable> getVariable(String name)
ScopegetVariable in interface Scopename - the name to search forpublic List<? extends Variable> getVariables()
ScopegetVariables in interface Scopepublic List<? extends Statement> getStatements()
ScopegetStatements in interface Scopepublic io.vavr.control.Option<Scope> getParentScope()
ScopegetParentScope in interface Scopepublic FramedScope getFramedScope()
ScopegetFramedScope in interface ScopeCopyright © 2020. All rights reserved.