java.lang.Object
simula.compiler.syntaxClass.expression.CallProcedure
Coding Utilities: Call Procedure
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static String
asNormalMethod
(VariableExpression variable) CallProcedure.asNormalMethodprivate static String
asRemoteMethod
(Expression obj, ProcedureDeclaration procedure, VariableExpression func) CallProcedure.remote(package private) static String
asStaticMethod
(VariableExpression variable, boolean isContextFree) CallProcedure.asStaticMethodprivate static String
codeCPF
(String ident, VariableExpression variable, ProcedureSpecification procedureSpec) Coding Utility: Edit Call Procedure Formal.private static String
codeCSVP
(String ident, VariableExpression variable, ProcedureSpecification procedureSpec) Coding Utility: Edit Call Specified Virtual Procedure.private static void
doArrayParameter
(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar) Coding Utility: Edit Array as Actual Parameter into the given StringBuilder.private static String
doParameterTransmition
(Type formalType, Parameter.Kind kind, Parameter.Mode mode, Expression apar) Coding Utility: Edit parameter transmission,private static void
doProcedureParameter
(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar) Coding Utility: Edit Procedure as Actual Parameter into the given StringBuilder.private static void
doSimpleParameter
(StringBuilder s, Type formalType, Parameter.Mode mode, Expression apar) Coding Utility: Edit simple parameter into the given StringBuilder.private static String
edProcedureParameters
(VariableExpression variable, String SL, ProcedureDeclaration procedure) Coding Utility: Edit procedure parameters.private static String
edProcedureQuant
(Expression apar) Coding Utility: Edit new procedure quant.(package private) static String
formal
(VariableExpression variable, Parameter par) CallProcedure.formalprivate static int
getNdim
(Expression actualParameter) Returns the array's number of dimensions.(package private) static String
normal
(VariableExpression variable) CallProcedure.normal(package private) static String
remote
(Expression obj, ProcedureDeclaration procedure, VariableExpression func, SyntaxClass backLink) CallProcedure.remote(package private) static String
remoteVirtual
(Expression obj, VariableExpression variable, VirtualSpecification virtual) CallProcedure.remoteVirtual(package private) static String
virtual
(VariableExpression variable, VirtualSpecification virtual, boolean remotelyAccessed) CallProcedure.virtual
-
Constructor Details
-
CallProcedure
CallProcedure()Default constructor.
-
-
Method Details
-
normal
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 DOTprocedure
- Procedure Declarationfunc
- Function Designator, may be subscriptedbackLink
- 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 DOTprocedure
- Procedure Declarationfunc
- Function Designator, may be subscripted- Returns:
- piece of Java source code
-
asNormalMethod
CallProcedure.asNormalMethod- Parameters:
variable
- the procedure variable- Returns:
- piece of Java source code
-
asStaticMethod
CallProcedure.asStaticMethod- Parameters:
variable
- the procedure variableisContextFree
- true if the procedure is independent of context- Returns:
- piece of Java source code
-
formal
CallProcedure.formal- Parameters:
variable
- the procedure variablepar
- 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 variablevirtual
- the virtual specificationremotelyAccessed
- 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 DOTvariable
- the procedure variablevirtual
- 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 identifiervariable
- the procedure variableprocedureSpec
- 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 identifiervariable
- the procedure variableprocedureSpec
- 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 variableSL
- static linkprocedure
- the procedure- Returns:
- the resulting Java source code
-
getNdim
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 typekind
- parameter's kindmode
- parameter's transmission modeapar
- 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 StringBuilderformalType
- the formal typemode
- the parameter's modeapar
- 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 StringBuilderformalType
- the formal typemode
- the parameter modeapar
- 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 StringBuilderformalType
- the formal typemode
- the parameter modeapar
- actual parameter
-
edProcedureQuant
Coding Utility: Edit new procedure quant.- Parameters:
apar
- the actual parameter- Returns:
- the resulting Java source code
-