Class RemoteVariable
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.expression.Expression
simula.compiler.syntaxClass.expression.RemoteVariable
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Used to indicate access remote array.private ProcedureDeclaration
Call Remote Procedure.private VirtualSpecification
Call Remote Virtual.The object expression before the dot.private Meaning
The remote attribute's semantic meaning.The variable after the dot.Fields inherited from class simula.compiler.syntaxClass.expression.Expression
backLink, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Default constructor used by Attribute File I/O(package private)
RemoteVariable
(Expression obj, VariableExpression var) Create a new RemoteVariable -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildEvaluation
(Expression rightPart, CodeBuilder codeBuilder) ClassFile coding utility: Build Evaluation Code.private static void
callStandardTextProcedure
(Expression beforeDot, StandardProcedure pro, VariableExpression variable, Object backLink, CodeBuilder codeBuilder) ClassFile coding utility: Call Standard TextProcedure.private String
doAccessRemoteArray
(Expression beforeDot, VariableExpression array) Java Coding Utility: Edit remote array access.private void
doAccessRemoteArray
(Expression beforeDot, VariableExpression array, CodeBuilder codeBuilder) ClassFile Coding Utility: Build Access Remote Array.void
Perform semantic checking.private Type
doRemoteChecking
(Expression obj, Expression attr) Perform semantic checkingprivate Type
doRemoteTextChecking
(Expression obj, Expression attr) Perform semantic checkingClassFile Coding Utility: Return the FieldRefEntry of this RemoteVariableGet a writeable variable.boolean
Returns true if this expression may be used as a statement.static RemoteVariable
Read and return an object.Generate Java code for this Syntax Class.toString()
void
Write a SyntaxClass object to a AttributeOutputStream.Methods inherited from class simula.compiler.syntaxClass.expression.Expression
acceptExpression, checkCompatibility, evaluate, expectExpression, get, getInt, getNumber, getQualification, printTree, put
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, buildByteCode, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, SET_SEMANTICS_CHECKED, setLineNumber
-
Field Details
-
remoteAttribute
The remote attribute's semantic meaning. Set by doChecking. -
callRemoteProcedure
Call Remote Procedure. If the remoteAttribute is declared as a ProcedureDeclaration 'callRemoteProcedure' is the procedure to be called. Set by doChecking. -
callRemoteVirtual
Call Remote Virtual. If the remoteAttribute is declared as a VirtualSpecification 'callRemoteVirtual' is the procedure to be called. Set by doChecking. -
obj
The object expression before the dot. -
var
The variable after the dot. -
accessRemoteArray
private boolean accessRemoteArrayUsed to indicate access remote array. Set by doChecking.
-
-
Constructor Details
-
RemoteVariable
RemoteVariable(Expression obj, VariableExpression var) Create a new RemoteVariable- Parameters:
obj
- object expressionvar
- the variable
-
RemoteVariable
private RemoteVariable()Default constructor used by Attribute File I/O
-
-
Method Details
-
getWriteableVariable
Description copied from class:Expression
Get a writeable variable.
This method is redefined in Variable, RemoteVariable and TypeConversion.
- Overrides:
getWriteableVariable
in classExpression
- 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 classSyntaxClass
-
doRemoteChecking
Perform semantic checking- Parameters:
obj
- remote objectattr
- remote attribute- Returns:
- the attribute's type
-
doRemoteTextChecking
Perform semantic checking- Parameters:
obj
- remote objectattr
- 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 classExpression
- Returns:
- true if this expression may be used as a statement
-
toJavaCode
Description copied from class:SyntaxClass
Generate Java code for this Syntax Class.- Overrides:
toJavaCode
in classSyntaxClass
- Returns:
- Java code
-
doAccessRemoteArray
Java Coding Utility: Edit remote array access.- Parameters:
beforeDot
- expression before dotarray
- 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 dotarray
- the array variablecodeBuilder
- the codeBuilder to use.
-
getFieldRefEntry
ClassFile Coding Utility: Return the FieldRefEntry of this RemoteVariable- Parameters:
pool
- the ConstantPoolBuilder to use- Returns:
- the FieldRefEntry of this RemoteVariable
-
buildEvaluation
Description copied from class:Expression
ClassFile coding utility: Build Evaluation Code.- Specified by:
buildEvaluation
in classExpression
- Parameters:
rightPart
- expressioncodeBuilder
- 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
- Overrides:
toString
in classExpression
-
writeObject
Description copied from class:SyntaxClass
Write a SyntaxClass object to a AttributeOutputStream.- Overrides:
writeObject
in classSyntaxClass
- Parameters:
oupt
- the AttributeOutputStream to write to.- Throws:
IOException
- if something went wrong.
-
readObject
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.
-