Package com.tonic.parser.attribute
Class LocalVariableTableAttribute
- java.lang.Object
-
- com.tonic.parser.attribute.Attribute
-
- com.tonic.parser.attribute.LocalVariableTableAttribute
-
public class LocalVariableTableAttribute extends Attribute
The LocalVariableTable attribute: name, type, slot, and live range of each local variable.
-
-
Constructor Summary
Constructors Constructor Description LocalVariableTableAttribute(String name, ClassFile parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a class.LocalVariableTableAttribute(String name, MemberEntry parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a member.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LocalVariableTableEntry>getLocalVariableTable()voidread(ClassFile classFile, int length)Reads the attribute data from the class file.voidsetLocalVariableTable(List<LocalVariableTableEntry> localVariableTable)Sets the entries (used when emitting a table during lowering rather than reading one from bytecode).StringtoString()voidupdateLength()Recomputes the attribute length field from the current in-memory content.
-
-
-
Constructor Detail
-
LocalVariableTableAttribute
public LocalVariableTableAttribute(String name, MemberEntry parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a member.- Parameters:
name- the attribute nameparent- the member the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
LocalVariableTableAttribute
public LocalVariableTableAttribute(String name, ClassFile parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a class.- Parameters:
name- the attribute nameparent- the class the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
-
Method Detail
-
setLocalVariableTable
public void setLocalVariableTable(List<LocalVariableTableEntry> localVariableTable)
Sets the entries (used when emitting a table during lowering rather than reading one from bytecode).- Parameters:
localVariableTable- the entries to emit
-
getLocalVariableTable
public List<LocalVariableTableEntry> getLocalVariableTable()
- Returns:
- the local variable table
-
read
public void read(ClassFile classFile, int length)
Description copied from class:AttributeReads the attribute data from the class file.
-
updateLength
public void updateLength()
Description copied from class:AttributeRecomputes the attribute length field from the current in-memory content.- Specified by:
updateLengthin classAttribute
-
-