Class RecordValue

java.lang.Object
svm.value.Value
svm.value.RecordValue

public class RecordValue extends Value

RecordValue.

record_value
	::= c-record structured_type
		<attribute_value>+ endrecord

	structured_type ::= record_tag:tag

	attribute_value
		::= attr attribute:tag type repetition_value

Link to GitHub: Source File.

Author:
S-Port: Definition of S-code, Øystein Myhre Andersen
  • Field Details

    • tag

      public Tag tag
      The Record Tag
    • attrValues

      public Vector<Value> attrValues
      The Record Attributes
  • Constructor Details

    • RecordValue

      private RecordValue()
      Construct a new RecordValue.
    • RecordValue

      private RecordValue(AttributeInputStream inpt) throws IOException
      Construct a RecordValue from reading the given input
      Parameters:
      inpt - the input stream
      Throws:
      IOException - if IOException occur
  • Method Details

    • ofScode

      public static RecordValue ofScode()
      Scans the remaining S-Code belonging to this RecordValue. Then construct a new RecordValue instance.
      Returns:
      that RecordValue instance.
    • setValue

      private static int setValue(Vector<Value> attrValues, int idx, Value value)
      Update the 'attrValues(idx)' with the given value.
      Parameters:
      attrValues - a set of values
      idx - the index in attrValues
      value - the value
      Returns:
      the index updated with the number of basic values treated
    • addValue

      private int addValue(Value value)
      Add the given value to 'attrValues'. Note: Some values consists of several basic values
      Parameters:
      value - the value to be added
      Returns:
      the number of basic values added
    • addChars

      private int addChars(TextValue txt)
      Add characters to 'attrValues'.
      Parameters:
      txt - the text value to be added
      Returns:
      the number of basic values added
    • emit

      public void emit(DataSegment dseg)
      Description copied from class: Value
      Add this value to the given DataSegment
      Overrides:
      emit in class Value
      Parameters:
      dseg - the DataSegment
    • print

      public void print(String indent)
      Description copied from class: Value
      Utility print method.
      Overrides:
      print in class Value
      Parameters:
      indent - number of spaces leading the lines
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • write

      public void write(AttributeOutputStream oupt) throws IOException
      Description copied from class: Value
      Writes this Value to the given output.
      Overrides:
      write in class Value
      Parameters:
      oupt - the output stream
      Throws:
      IOException - if IOException occur
    • read

      public static RecordValue read(AttributeInputStream inpt) throws IOException
      Reads a RecordValue from the given input.
      Parameters:
      inpt - the AttributeInputStream
      Returns:
      the RecordValue read
      Throws:
      IOException - if IOException occur