java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
simula.compiler.syntaxClass.declaration.VirtualSpecification
- All Implemented Interfaces:
Externalizable
,Serializable
Virtual Quantities.
Simula Standard: 5.5.3 Virtual quantities virtual-part = VIRTUAL : virtual-spec ; { virtual-spec ; } virtual-spec = virtual-specifier identifier-list | PROCEDURE procedure-identifier procedure-specification procedure-specification = IS procedure-declaration virtual-specifier = LABEL | SWITCH | [ type ] PROCEDURE identifier-list = identifier { , identifier }Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescription(package private) boolean
Indicates if this virtual has a default match.Virtual kind.The procedure specification if present.Fields inherited from class simula.compiler.syntaxClass.declaration.Declaration
declarationKind, declaredIn, externalIdent, identifier, isProtected, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
ConstructorDescriptionDefault constructor used by Externalization.VirtualSpecification
(String identifier, Type type, VirtualSpecification.Kind kind, ProcedureSpecification procedureSpec) VirtualSpecification. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform semantic checking.void
Output Java code.private static void
expectIdentifierList
(ClassDeclaration cls, Type type, VirtualSpecification.Kind kind) Parse a virtual identifier list.(package private) static void
Parse a virtual-part and put it into the given class.Returns the virtual identifier used i Java code.static VirtualSpecification
Get virtual specification.void
printTree
(int indent) Utility print syntax tree method.void
readExternal
(ObjectInput inpt) toString()
void
writeExternal
(ObjectOutput oupt) Methods inherited from class simula.compiler.syntaxClass.declaration.Declaration
getJavaIdentifier, isCompatibleClasses, modifyIdentifier, parseDeclaration
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, SET_SEMANTICS_CHECKED, toJavaCode
-
Field Details
-
kind
Virtual kind. -
procedureSpec
The procedure specification if present. -
hasDefaultMatch
boolean hasDefaultMatchIndicates if this virtual has a default match.Set during doChecking
-
-
Constructor Details
-
VirtualSpecification
VirtualSpecification(String identifier, Type type, VirtualSpecification.Kind kind, ProcedureSpecification procedureSpec) VirtualSpecification.- Parameters:
identifier
- virtual identifiertype
- the virtual's typekind
- the vitual KindprocedureSpec
- the ProcedureSpecification
-
VirtualSpecification
public VirtualSpecification()Default constructor used by Externalization.
-
-
Method Details
-
expectVirtualPart
Parse a virtual-part and put it into the given class.Syntax: virtual-part = VIRTUAL: virtual-spec ; { virtual-spec ; } virtual-spec = virtual-specifier identifier-list | PROCEDURE procedure-identifier procedure-specification virtual-Specifier = [ type ] PROCEDURE | LABEL | SWITCH identifier-list = identifier { , identifier } procedure-specification = IS procedure-declaration
Precondition: VIRTUAL is already read.- Parameters:
cls
- the ClassDeclaration
-
expectIdentifierList
private static void expectIdentifierList(ClassDeclaration cls, Type type, VirtualSpecification.Kind kind) Parse a virtual identifier list.Syntax: identifier-list = identifier { , identifier
- Parameters:
cls
- the ClassDeclarationtype
- the specifiers typekind
- the specifiers kind
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
getVirtualIdentifier
Returns the virtual identifier used i Java code.- Returns:
- the virtual identifier used i Java code
-
getVirtualSpecification
Get virtual specification.- Parameters:
decl
- the declaration to search for- Returns:
- a VirtualSpecification or null
-
doJavaCoding
public void doJavaCoding()Description copied from class:SyntaxClass
Output Java code.- Overrides:
doJavaCoding
in classSyntaxClass
-
printTree
public void printTree(int indent) Description copied from class:SyntaxClass
Utility print syntax tree method.- Overrides:
printTree
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the lines
-
toString
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-