public class Locals extends Object
Scope
. Used for compilation to determine the
the amount of stack space needed for local variables.
Local variables within a Scope
follow proper lexical scoping by overriding out
of scope values. That is, the getNumberOfLocals()
pool will only be the
max number of visible variables within a Scope
.
Constructor and Description |
---|
Locals() |
Modifier and Type | Method and Description |
---|---|
void |
allocate(int size)
Allocates the number of local variables stored
|
Locals |
clone() |
int |
get(String reference)
Retrieves the index at which the supplied reference is stored.
|
int |
getIndex() |
int |
getNumberOfLocals() |
String |
getReference(int index)
Retrieves the reference by index
|
void |
setIndex(int prevIndex)
Used for reseting the index for lexical scoping.
|
void |
setReference(int index,
String reference)
Sets the reference at the specified index
|
int |
store(String reference)
Stores in the pool
|
public void allocate(int size)
size
- public int store(String reference)
reference
- public String getReference(int index)
index
- public void setReference(int index, String reference)
index
- reference
- public int get(String reference)
reference
- public int getNumberOfLocals()
public void setIndex(int prevIndex)
index
- public int getIndex()
Copyright © 2010–2015. All rights reserved.