cs132.vapor.ast
Class VDataSegment

java.lang.Object
  extended by cs132.vapor.ast.Node
      extended by cs132.vapor.ast.VTarget
          extended by cs132.vapor.ast.VDataSegment

public class VDataSegment
extends VTarget

A top-level data segment.


Field Summary
 int index
          All functions in a single program are assigned an index contiguously, starting from zero.
 boolean mutable
          Whether the data segment is mutable.
 VOperand.Static[] values
          The data in the segment.
 
Fields inherited from class cs132.vapor.ast.VTarget
ident
 
Fields inherited from class cs132.vapor.ast.Node
sourcePos
 
Constructor Summary
VDataSegment(SourcePos sourcePos, String ident, int index, boolean mutable, VOperand.Static[] values)
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

public final int index
All functions in a single program are assigned an index contiguously, starting from zero.


mutable

public final boolean mutable
Whether the data segment is mutable. "var" segments are mutable, "const" segments are not.


values

public final VOperand.Static[] values
The data in the segment. Each value is 4 bytes long.

Constructor Detail

VDataSegment

public VDataSegment(SourcePos sourcePos,
                    String ident,
                    int index,
                    boolean mutable,
                    VOperand.Static[] values)