Module Simula

Class CallProcedure

java.lang.Object
simula.compiler.syntaxClass.expression.CallProcedure

public final class CallProcedure extends Object
Coding Utilities: Call Procedure

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Constructor Details

    • CallProcedure

      CallProcedure()
      Default constructor.
  • Method Details

    • normal

      static String normal(VariableExpression variable)
      CallProcedure.normal
      Parameters:
      variable - the procedure variable
      Returns:
      piece of Java source code
    • remote

      static String remote(Expression obj, ProcedureDeclaration procedure, VariableExpression func, SyntaxClass backLink)
      CallProcedure.remote
      Parameters:
      obj - Object Expression before DOT
      procedure - Procedure Declaration
      func - Function Designator, may be subscripted
      backLink - if not null, this procedure call is part of the backLink Expression/Statement.
      Returns:
      piece of Java source code
    • asRemoteMethod

      private static String asRemoteMethod(Expression obj, ProcedureDeclaration procedure, VariableExpression func)
      CallProcedure.remote
      Parameters:
      obj - Object Expression before DOT
      procedure - Procedure Declaration
      func - Function Designator, may be subscripted
      Returns:
      piece of Java source code
    • asNormalMethod

      static String asNormalMethod(VariableExpression variable)
      CallProcedure.asNormalMethod
      Parameters:
      variable - the procedure variable
      Returns:
      piece of Java source code
    • asStaticMethod

      static String asStaticMethod(VariableExpression variable, boolean isContextFree)
      CallProcedure.asStaticMethod
      Parameters:
      variable - the procedure variable
      isContextFree - true if the procedure is independent of context
      Returns:
      piece of Java source code
    • formal

      static String formal(VariableExpression variable, Parameter par)
      CallProcedure.formal
      Parameters:
      variable - the procedure variable
      par - declared as parameter 'par'
      Returns:
      piece of Java source code
    • virtual

      static String virtual(VariableExpression variable, VirtualSpecification virtual, boolean remotelyAccessed)
      CallProcedure.virtual
      Parameters:
      variable - the procedure variable
      virtual - the virtual specification
      remotelyAccessed - true if remotely accessed.
      Returns:
      piece of Java source code
    • remoteVirtual

      static String remoteVirtual(Expression obj, VariableExpression variable, VirtualSpecification virtual)
      CallProcedure.remoteVirtual
      Parameters:
      obj - Object Expression before DOT
      variable - the procedure variable
      virtual - Virtual Specification
      Returns:
      piece of Java source code
    • codeCPF

      private static String codeCPF(String ident, VariableExpression variable, ProcedureSpecification procedureSpec)
      Coding Utility: Edit Call Procedure Formal.
      Parameters:
      ident - the procedure identifier
      variable - the procedure variable
      procedureSpec - the procedure spec
      Returns:
      the resulting Java source code
    • codeCSVP

      private static String codeCSVP(String ident, VariableExpression variable, ProcedureSpecification procedureSpec)
      Coding Utility: Edit Call Specified Virtual Procedure.
      Parameters:
      ident - the procedure identifier
      variable - the procedure variable
      procedureSpec - the procedure spec
      Returns:
      the resulting Java source code
    • edProcedureParameters

      private static String edProcedureParameters(VariableExpression variable, String SL, ProcedureDeclaration procedure)
      Coding Utility: Edit procedure parameters.
      Parameters:
      variable - a variable
      SL - static link
      procedure - the procedure
      Returns:
      the resulting Java source code
    • getNdim

      private static int getNdim(Expression actualParameter)
      Returns the array's number of dimensions.
      Parameters:
      actualParameter - the array parameter
      Returns:
      the array's number of dimensions.
    • doParameterTransmition

      private static String doParameterTransmition(Type formalType, Parameter.Kind kind, Parameter.Mode mode, Expression apar)
      Coding Utility: Edit parameter transmission,
      Parameters:
      formalType - parameter's formal type
      kind - parameter's kind
      mode - parameter's transmission mode
      apar - the actual parameter
      Returns:
      the resulting Java source code
    • doSimpleParameter

      private static void doSimpleParameter(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar)
      Coding Utility: Edit simple parameter into the given StringBuilder.
      Parameters:
      s - the StringBuilder
      formalType - the formal type
      mode - the parameter's mode
      apar - actual parameter
    • doArrayParameter

      private static void doArrayParameter(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar)
      Coding Utility: Edit Array as Actual Parameter into the given StringBuilder.
      Parameters:
      s - the StringBuilder
      formalType - the formal type
      mode - the parameter mode
      apar - actual parameter
    • doProcedureParameter

      private static void doProcedureParameter(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar)
      Coding Utility: Edit Procedure as Actual Parameter into the given StringBuilder.
      Parameters:
      s - the StringBuilder
      formalType - the formal type
      mode - the parameter mode
      apar - actual parameter
    • edProcedureQuant

      private static String edProcedureQuant(Expression apar)
      Coding Utility: Edit new procedure quant.
      Parameters:
      apar - the actual parameter
      Returns:
      the resulting Java source code