java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
simula.compiler.syntaxClass.declaration.DeclarationScope
- Direct Known Subclasses:
BlockDeclaration
,ConnectionBlock
public abstract sealed class DeclarationScope
extends Declaration
permits BlockDeclaration, ConnectionBlock
Declaration Scope.
This class is prefix to BlockDeclaration and ConnectionBlock, and superclass of ClassDeclaration, ProcedureDeclaration and MaybeBlockDeclaration.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.compiler.syntaxClass.declaration.Declaration
Declaration.Kind
-
Field Summary
Modifier and TypeFieldDescriptionint
The Compile time block level.protected static int
Current Runtime Block level - Used during doCheckingThe declaration list.boolean
Indicate if this scope has local classes.The label list.int
The Runtime block level.int
The source block level.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
ModifierConstructorDescriptionprotected
DeclarationScope
(String ident) Create a new DeclarationScope. -
Method Summary
Modifier and TypeMethodDescriptionedCTX()
Coding utility: Edit current context chain.static String
edCTX
(int ctxDiff) Coding utility: Edit context chain.protected String
Utility to edit JavaClass'NameEdit scope chain.findLabelMeaning
(String identifier) Find Label's MeaningfindMeaning
(String identifier) Find MeaningfindProcedure
(String identifier) Follow Static Chain Looking for a Procedure named 'identifier'Find visible attribute's Meaningprotected void
printDeclarationList
(int indent) scopeID()
Returns a printable scope ID.Methods inherited from class simula.compiler.syntaxClass.declaration.Declaration
getJavaIdentifier, isCompatibleClasses, modifyIdentifier, parseDeclaration
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
-
currentRTBlockLevel
protected static int currentRTBlockLevelCurrent Runtime Block level - Used during doChecking -
sourceBlockLevel
public int sourceBlockLevelThe source block level. Set during Parsing. -
ctBlockLevel
public int ctBlockLevelThe Compile time block level. Set during doChecking. -
rtBlockLevel
public int rtBlockLevelThe Runtime block level. Set during doChecking. -
hasLocalClasses
public boolean hasLocalClassesIndicate if this scope has local classes. -
declarationList
The declaration list. -
labelList
The label list.
-
-
Constructor Details
-
DeclarationScope
Create a new DeclarationScope.- Parameters:
ident
- scope identifier
-
-
Method Details
-
scopeID
Returns a printable scope ID.- Returns:
- a printable scope ID
-
findVisibleAttributeMeaning
Find visible attribute's Meaning- Parameters:
ident
- attribute identifier- Returns:
- the resulting Meaning
-
findMeaning
Find Meaning- Parameters:
identifier
- declared identifier- Returns:
- the resulting Meaning
-
findLabelMeaning
Find Label's Meaning- Parameters:
identifier
- declared label identifier- Returns:
- the resulting Meaning
-
findProcedure
Follow Static Chain Looking for a Procedure named 'identifier'- Parameters:
identifier
- the procedure identifier- Returns:
- the resulting ProcedureDeclaration
-
edCTX
Coding utility: Edit current context chain.- Returns:
- edited context chain
-
edCTX
Coding utility: Edit context chain.- Parameters:
ctxDiff
- block level difference.- Returns:
- edited context chain
-
edScopeChain
Edit scope chain.- Returns:
- edited scope chain
-
edJavaClassName
Utility to edit JavaClass'Name- Returns:
- the edited JavaClass'Name
-
printDeclarationList
protected void printDeclarationList(int indent)
-