Package ghidra.pcode.emu.jit.gen.util
Interface Scope
- All Known Subinterfaces:
SubScope
public interface Scope
A scope for local variable declarations, but not treated as a resource
-
Method Summary
-
Method Details
-
sub
SubScope sub()Open a child scope of this scope, usually for temporary declarations/allocationsThe variables declared in this scope (see
decl(BNonVoid, String)) are reserved only with the scope of thetry-with-resourcesblock that ought to be used to managed this resource. Local variables meant to be in scope for the method's full scope should just be declared in the root scope.- Returns:
- the child scope
-
decl
Declare a local variable in this scopeThis assigns the local the next available index, being careful to increment the index according to the category of the given type. When this scope is closed, that index is reset to what is was at the start of this scope.
- Type Parameters:
T- the type of the variable- Parameters:
type- the type of the variablename- the name of the variable- Returns:
- the handle to the variable
-
close
void close()Close this scopeThis resets the index to what it was at the start of this scope. In general, there is no need for the user to call this on the root scope. This is automatically done by
Misc.finish(Emitter).
-