Class OperationStaticSemantics

java.lang.Object
org.kigalisim.lang.operation.OperationStaticSemantics

public class OperationStaticSemantics extends Object
Record describing common properties of an operation which can be inferred from static analysis.

Record describing common properties of an operation which can be inferred from static analysis, intended for use in polymorphic program static analysis for QubecTalk scripts.

  • Constructor Details

    • OperationStaticSemantics

      public OperationStaticSemantics(OperationType operationType)
      Create a record indicating that only the operation type could be inferred statically.
      Parameters:
      operationType - The type of operation for which the record is provided.
    • OperationStaticSemantics

      public OperationStaticSemantics(OperationType operationType, String stream)
      Create a record for an operation which involves a single stream.
      Parameters:
      operationType - The type of operation for which the record is provided.
      stream - The name of the stream involved in the operation.
    • OperationStaticSemantics

      public OperationStaticSemantics(OperationType operationType, Set<String> streams, Optional<Boolean> assumePriorNew)
      Create a new record of statically inferred operation properties.
      Parameters:
      operationType - The type of operation for which the record is provided.
      streams - The names of the streams included in the operation, copied on construction.
      assumePriorNew - Whether the operation treats prior equipment as a pseudo-cohort of typical age (the assuming new modifier) or empty if not applicable.
  • Method Details

    • getOperationType

      public OperationType getOperationType()
      Get the kind of operation described.
      Returns:
      The type of the operation.
    • getStreams

      public Set<String> getStreams()
      Get the streams targeted in the operation.

      The set of streams which are included in this operation which can be interpreted as analagous to "operands" of this operation which are streams. For example, the set command's operand is the stream set. Meanwhile, the read command's operand is the stream read. Some operations like a cap with displace may have two different streams as operands.

      Returns:
      Unmodifiable set of names of the streams involved, empty if none apply.
    • getAssumePriorNew

      public Optional<Boolean> getAssumePriorNew()
      Determine if the operation treats prior equipment as new (the assuming new modifier).
      Returns:
      True if assuming new, false if not, or empty if not applicable to the operation.