Class SwitchDeclaration
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
simula.compiler.syntaxClass.declaration.DeclarationScope
simula.compiler.syntaxClass.declaration.BlockDeclaration
simula.compiler.syntaxClass.declaration.ProcedureDeclaration
simula.compiler.syntaxClass.declaration.SwitchDeclaration
Switch Declaration.
Simula Standard: 5.3 Switch declaration switch-declaration = SWITCH switch-identifier := switch-list switch-list = designational-expression { , designational-expression }
Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Vector
<Expression> The switch list of label expressions.Fields inherited from class ProcedureDeclaration
myVirtual, parameterList, result
Fields inherited from class BlockDeclaration
currentBlock, isContextFree, isMainModule, labelcodeList, labelContext, labelContextStack, lastLineNumber, nLocalVariables, prevBlock, statements
Fields inherited from class DeclarationScope
CLASSFILE_ALREADY_GENERATED, declarationList, hasLocalClasses, isPreCompiledFromFile, labelList, sourceBlockLevel, sourceFileName
Fields inherited from class Declaration
declarationKind, declaredIn, externalIdent, identifier, isProtected, type
Fields inherited from class SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
build_STM_BODY
(CodeBuilder codeBuilder, Label begScope, Label endScope) Generate byteCode for the '_STM' method.protected void
Coding Utility: codeProcedureBody.void
Perform semantic checking.toString()
Methods inherited from class ProcedureDeclaration
buildClassFile, buildDeclaration, buildInitAttribute, doJavaCoding, edConstructorSignature, expectProcedureDeclaration, findVisibleAttributeMeaning, getResultFieldRefEntry, print, printTree, readObject, writeObject
Methods inherited from class BlockDeclaration
addLeadingLabel, allocateLocalVariable, build_TRY_CATCH, buildIsMethodDetachUsed, buildIsQPSystemBlock, buildMethod_STM, buildMethodMain, codeMethodMain, codeStatements, codeSTMBody, currentClassDesc, expectFormalParameterPart, getConstructorMethodTypeDesc, hasAccumLabel, hasDeclaredLabel, isBlockWithLocalClasses, isQPSystemBlock, nearestEnclosingBlock, printStatementList
Methods inherited from class DeclarationScope
buildAndLoadOrAddClassFile, buildCTX, buildCTX, buildCTX2, createJavaClassFile, doBuildClassFile, edCTX, edCTX, edJavaClassName, edScope, edScopeChain, findLabelMeaning, findMeaning, findProcedure, getBytesFromFile, getClassDesc, getRTBlockLevel, loadOrAddClassFile, modifyIdentifier, prefixLevel, prep, printDeclarationList, printStaticChain, scopeID
Methods inherited from class Declaration
acceptDeclaration, buildDeclarationCode, checkAlreadyDefined, getFieldIdentifier, getJavaIdentifier, isCompatibleClasses, verifyTree
Methods inherited from class SyntaxClass
ASSERT_SEMANTICS_CHECKED, buildByteCode, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, SET_SEMANTICS_CHECKED, setLineNumber, toJavaCode
-
Field Details
-
switchList
Vector<Expression> switchListThe switch list of label expressions.
-
-
Constructor Details
-
SwitchDeclaration
Create a new SwitchDeclaration.- Parameters:
ident
- switch identifier
-
-
Method Details
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.
This must be redefined in every subclass.
- Overrides:
doChecking
in classProcedureDeclaration
-
codeProcedureBody
protected void codeProcedureBody()Description copied from class:ProcedureDeclaration
Coding Utility: codeProcedureBody. Redefined in SwitchDeclaration.- Overrides:
codeProcedureBody
in classProcedureDeclaration
-
build_STM_BODY
Generate byteCode for the '_STM' method.- Overrides:
build_STM_BODY
in classProcedureDeclaration
- Parameters:
codeBuilder
- the CodeBuilderbegScope
- labelendScope
- label
-
toString
- Overrides:
toString
in classProcedureDeclaration
-