java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
- Direct Known Subclasses:
ArrayDeclaration
,DeclarationScope
,ExternalDeclaration
,Parameter
,SimpleVariableDeclaration
,VirtualMatch
,VirtualSpecification
public abstract sealed class Declaration
extends SyntaxClass
permits DeclarationScope, ExternalDeclaration, Parameter, SimpleVariableDeclaration, VirtualSpecification, VirtualMatch, ArrayDeclaration
Declaration.
Simula Standard: Chapter 5. Declarations declaration = simple-variable-declaration | array-declaration | switch-declaration | procedure-declaration | class-declaration | external-declarationThis class is prefix to DeclarationScope, ExternalDeclaration, Parameter, SimpleVariableDeclaration, VirtualSpecification, VirtualMatch, ArrayDeclaration
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionThe declarationKind.The DeclarationScope in which this Declaration is defined.External Identifier set by doCheckingSimula Identifier from Source TextIndicates that this declaration is protected.The typeFields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Check if a declaration with this identifier is already defined.final String
Returns the Java identifier for this declaration.boolean
isCompatibleClasses
(Declaration other) Check if these classes are compatible.protected void
modifyIdentifier
(String newIdentifier) Modify the identifier of this class.protected static boolean
parseDeclaration
(DeclarationList declarationList) Parse a declaration and add it to the given declaration list.Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doChecking, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, printTree, SET_SEMANTICS_CHECKED, toJavaCode
-
Field Details
-
type
The type -
isProtected
Indicates that this declaration is protected. -
identifier
Simula Identifier from Source Text -
externalIdent
External Identifier set by doChecking -
declaredIn
The DeclarationScope in which this Declaration is defined. -
declarationKind
The declarationKind.
-
-
Constructor Details
-
Declaration
Create a new Declaration.- Parameters:
identifier
- the given identifier
-
-
Method Details
-
getJavaIdentifier
Returns the Java identifier for this declaration.- Returns:
- the Java identifier for this declaration
-
modifyIdentifier
Modify the identifier of this class.- Parameters:
newIdentifier
- the new identifier
-
checkAlreadyDefined
private void checkAlreadyDefined()Check if a declaration with this identifier is already defined. -
parseDeclaration
Parse a declaration and add it to the given declaration list.- Parameters:
declarationList
- the given declaration list- Returns:
- true if a declaration was found, false otherwise
-
isCompatibleClasses
Check if these classes are compatible.- Parameters:
other
- the other ClassDeclaration- Returns:
- the resulting boolean value
-