Class RemoteVariable


public final class RemoteVariable extends Expression

Remote Variable.


Syntax:

  remote-variable = expression  DOT  variable

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • remoteAttribute

      private Meaning remoteAttribute
      The remote attribute's semantic meaning. Set by doChecking.
    • callRemoteProcedure

      private ProcedureDeclaration callRemoteProcedure
      Call Remote Procedure. If the remoteAttribute is declared as a ProcedureDeclaration 'callRemoteProcedure' is the procedure to be called. Set by doChecking.
    • callRemoteVirtual

      private VirtualSpecification callRemoteVirtual
      Call Remote Virtual. If the remoteAttribute is declared as a VirtualSpecification 'callRemoteVirtual' is the procedure to be called. Set by doChecking.
    • obj

      public Expression obj
      The object expression before the dot.
    • var

      public VariableExpression var
      The variable after the dot.
    • accessRemoteArray

      private boolean accessRemoteArray
      Used to indicate access remote array. Set by doChecking.
  • Constructor Details

    • RemoteVariable

      RemoteVariable(Expression obj, VariableExpression var)
      Create a new RemoteVariable
      Parameters:
      obj - object expression
      var - the variable
    • RemoteVariable

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

    • getWriteableVariable

      public VariableExpression getWriteableVariable()
      Description copied from class: Expression

      Get a writeable variable.

      This method is redefined in Variable, RemoteVariable and TypeConversion.

      Overrides:
      getWriteableVariable in class Expression
      Returns:
      a writeable variable or null
    • doChecking

      public void doChecking()
      Description copied from class: SyntaxClass

      Perform semantic checking.

      This must be redefined in every subclass.

      Overrides:
      doChecking in class SyntaxClass
    • doRemoteChecking

      private Type doRemoteChecking(Expression obj, Expression attr)
      Perform semantic checking
      Parameters:
      obj - remote object
      attr - remote attribute
      Returns:
      the attribute's type
    • doRemoteTextChecking

      private Type doRemoteTextChecking(Expression obj, Expression attr)
      Perform semantic checking
      Parameters:
      obj - remote object
      attr - remote attribute
      Returns:
      the attribute's type
    • 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
    • doAccessRemoteArray

      private String doAccessRemoteArray(Expression beforeDot, VariableExpression array)
      Java Coding Utility: Edit remote array access.
      Parameters:
      beforeDot - expression before dot
      array - the array variable
      Returns:
      the resulting Java source code
    • doAccessRemoteArray

      private void doAccessRemoteArray(Expression beforeDot, VariableExpression array, CodeBuilder codeBuilder)
      ClassFile Coding Utility: Build Access Remote Array.
      Parameters:
      beforeDot - expression before dot
      array - the array variable
      codeBuilder - the codeBuilder to use.
    • getFieldRefEntry

      public FieldRefEntry getFieldRefEntry(ConstantPoolBuilder pool)
      ClassFile Coding Utility: Return the FieldRefEntry of this RemoteVariable
      Parameters:
      pool - the ConstantPoolBuilder to use
      Returns:
      the FieldRefEntry of this RemoteVariable
    • 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.
    • callStandardTextProcedure

      private static void callStandardTextProcedure(Expression beforeDot, StandardProcedure pro, VariableExpression variable, Object backLink, CodeBuilder codeBuilder)
      ClassFile coding utility: Call Standard TextProcedure.
      Parameters:
      beforeDot - expression before dot.
      pro - the StandardProcedure.
      variable - the VariableExpression.
      backLink - if not null, this procedure call is part of the backLink Expression/Statement.
      codeBuilder - the codeBuilder to use.
    • 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 RemoteVariable readObject(AttributeInputStream inpt) throws IOException
      Read and return an object.
      Parameters:
      inpt - the AttributeInputStream to read from
      Returns:
      the object read from the stream.
      Throws:
      IOException - if something went wrong.