Class QualifiedObject


public final class QualifiedObject extends Expression

Qualified Object

Simula Standard: 3.8 Object expressions

  qualified-object
       =  simple-object-expression  QUA  class-identifier

The qualification of an object expression is defined by the following rules:

  • The expression none is qualified by a fictitious class which is inner to all declared classes.
  • A variable or function designator is qualified as stated in the declaration (or specification, see below) of the variable or array or procedure in question.
  • An object generator, local object or qualified object is qualified by the class of the identifier following the symbol new, this or qua respectively.
  • A conditional object expression is qualified by the innermost class which includes the qualifications of both alternatives. If there is no such class, the expression is illegal.
  • Any formal parameter of object reference type is qualified according to its specification regardless of the qualification of the corresponding actual parameter.
  • The qualification of a function designator whose procedure identifier is that of a virtual quantity depends on the access level (see 5.5.5). The qualification is that of the matching declaration, if any, occurring at the innermost prefix level equal or outer to the access level, or, if no such match exists, it is that of the virtual specification.
Link to GitHub: Source File.
Author:
SIMULA Standards Group, Øystein Myhre Andersen
  • Field Details

    • lhs

      private Expression lhs
      The left hand simple-object-expression
    • classIdentifier

      private String classIdentifier
      The right hand class identifier.
    • classDeclaration

      ClassDeclaration classDeclaration
      The right hand class declaration. Set by doChecking.
  • Constructor Details

    • QualifiedObject

      QualifiedObject(Expression lhs, String classIdentifier)
      Create a new QualifiedObject
      Parameters:
      lhs - left hand side
      classIdentifier - class identifier
    • QualifiedObject

      private QualifiedObject()
      Default constructor used by Attribute File I/O
  • Method Details

    • doChecking

      public void doChecking()
      Description copied from class: SyntaxClass

      Perform semantic checking.

      This must be redefined in every subclass.

      Overrides:
      doChecking in class SyntaxClass
    • maybeStatement

      public boolean maybeStatement()
      Description copied from class: Expression
      Returns true if this expression may be used as a statement.
      Specified by:
      maybeStatement in class Expression
      Returns:
      true if this expression may be used as a statement
    • toJavaCode

      public String toJavaCode()
      Description copied from class: SyntaxClass
      Generate Java code for this Syntax Class.
      Overrides:
      toJavaCode in class SyntaxClass
      Returns:
      Java code
    • buildEvaluation

      public void buildEvaluation(Expression rightPart, CodeBuilder codeBuilder)
      Description copied from class: Expression
      ClassFile coding utility: Build Evaluation Code.
      Specified by:
      buildEvaluation in class Expression
      Parameters:
      rightPart - expression
      codeBuilder - the codeBuilder used.
    • toString

      public String toString()
      Overrides:
      toString in class Expression
    • writeObject

      public void writeObject(AttributeOutputStream oupt) throws IOException
      Description copied from class: SyntaxClass
      Write a SyntaxClass object to a AttributeOutputStream.
      Overrides:
      writeObject in class SyntaxClass
      Parameters:
      oupt - the AttributeOutputStream to write to.
      Throws:
      IOException - if something went wrong.
    • readObject

      public static QualifiedObject readObject(AttributeInputStream inpt) throws IOException
      Read and return a QualifiedObject object.
      Parameters:
      inpt - the AttributeInputStream to read from
      Returns:
      the QualifiedObject object read from the stream.
      Throws:
      IOException - if something went wrong.