Class NeverEndingIterationMarker
- All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener, EK9Listener
InfiniteStreamSourceOrError reads the marks.
It marks (NEVER_ENDING_ITERATION, the value is the reason in words):
- INF-1 - a
hasNext()METHOD whose returning variable is initialised with the literaltrueand never written:<- more as Boolean: true. - INF-2 - a
hasNext()METHOD whose returning variable is initialised from a Boolean PROPERTY of its own class that is declared with the literaltrue, is never written anywhere in the class (bySymbolWrites, so a mutating operator such as:=:counts) and is read nowhere else in the class (escape-lite: no other code holds it, so nothing can flip it through an alias). - INF-3 - a function or method whose returning variable only ever receives a dynamic class whose
hasNext()is marked, at least once in a position that always runs (MustExecutePosition) - the generator form,cat endless(), and aniterator()that returns such a dynamic class.
The mark is on the METHOD, not the class, so a closed class that inherits a marked hasNext() is
covered and an open class never is - whether a SOURCE is infinite also needs its type to be closed, which is
decided where the source is (InfiniteStreamSourceOrError).
Sound by construction: once hasNext() cannot return false, the only way out of the iteration is an
exception or a Panic, so a stage that waits for the end never emits normally. Anything not matched is simply
not marked - unknown sources keep today's behaviour. One residual is stated rather than closed: INF-2 trusts
that no caller mutates the Boolean that hasNext() hands back (b <- it.hasNext(); b :=: false),
which would flip the property through the alias the returning variable is.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnter a parse tree produced byEK9Parser.functionDeclaration().voidEnter a parse tree produced byEK9Parser.methodDeclaration().voidExit a parse tree produced byEK9Parser.dynamicClassDeclaration().voidExit a parse tree produced byEK9Parser.functionDeclaration().voidExit a parse tree produced byEK9Parser.methodDeclaration().markedHasNextOf(IAggregateSymbol aggregate) The reason a dynamic class (or closed class) never ends - its effective hasNext()'s mark - if it has one.Methods inherited from class EK9BaseListener
enterAccessModifier, enterAggregateParts, enterAggregateProperty, enterAllowingOnly, enterApplicationBlock, enterApplicationDeclaration, enterArgumentParam, enterAspectDeclaration, enterAssertDoesNotThrowExpression, enterAssertPanicExpression, enterAssertStatement, enterAssertThrowsExpression, enterAssignmentExpression, enterAssignmentStatement, enterBinaryLit, enterBinaryLiteral, enterBlock, enterBlockStatement, enterBooleanLit, enterBooleanLiteral, enterBytesLit, enterBytesLiteral, enterCall, enterCaseExpression, enterCaseStatement, enterCatchStatementExpression, enterCharacterLit, enterCharacterLiteral, enterClassBlock, enterClassDeclaration, enterColourLit, enterColourLiteral, enterCompilationUnit, enterComponentBlock, enterComponentDeclaration, enterConstantBlock, enterConstantDeclaration, enterConstantInitialiser, enterConstrainDeclaration, enterConstrainType, enterDateLit, enterDateLiteral, enterDateTimeLit, enterDateTimeLiteral, enterDeclareArgumentParam, enterDecorationDimensionLiteral, enterDecorationResolutionLiteral, enterDefaultOperator, enterDict, enterDimensionLit, enterDirective, enterDirectivePart, enterDottedName, enterDurationLit, enterDurationLiteral, enterDynamicClassDeclaration, enterDynamicFunctionBody, enterDynamicFunctionDeclaration, enterDynamicVariableCapture, enterElseOnlyBlock, enterEmptyBlock, enterEnumerationDeclaration, enterEveryRule, enterExcludedControlFlowStatement, enterExcludedInstantiation, enterExcludedListComprehension, enterExcludedLiteral, enterExpression, enterExpressionParam, enterExtendDeclaration, enterExtendPreamble, enterFinallyStatementExpression, enterFloatingPointLit, enterFloatingPointLiteral, enterForLoop, enterForRange, enterForStatementExpression, enterFunctionBlock, enterHttpAccess, enterHttpVerb, enterIdentifier, enterIdentifierReference, enterIfControlBlock, enterIfStatement, enterInitValuePair, enterInstructionBlock, enterIntegerLit, enterIntegerLiteral, enterList, enterMillisecondLit, enterMillisecondLiteral, enterModuleBlock, enterModuleDeclaration, enterModuleSegment, enterMoneyLit, enterMoneyLiteral, enterNonIdentifierOperator, enterObjectAccess, enterObjectAccessExpression, enterObjectAccessStart, enterObjectAccessType, enterOperationCall, enterOperationDetails, enterOperator, enterOperatorDeclaration, enterPackageBlock, enterParameterisedArgs, enterParameterisedDetail, enterParameterisedParams, enterParameterisedType, enterParamExpression, enterPathLit, enterPathLiteral, enterPipelinePart, enterPreFlowAndControl, enterPreFlowStatement, enterPrimary, enterPrimaryReference, enterProgramBlock, enterRange, enterRecordBlock, enterRecordDeclaration, enterReferencesBlock, enterRegExLit, enterRegisterStatement, enterRegularExpressionLiteral, enterRequireStatement, enterReservedWord, enterResolutionLit, enterReturningParam, enterSecurityConstraint, enterServiceBlock, enterServiceDeclaration, enterServiceOperationDeclaration, enterSheBang, enterSingleStatementBlock, enterStatement, enterStreamCat, enterStreamExpression, enterStreamExpressionTermination, enterStreamFor, enterStreamPart, enterStreamSource, enterStreamStatement, enterStreamStatementTermination, enterStringLit, enterStringLiteral, enterStringPart, enterSwitchStatementExpression, enterTernaryPart, enterTextBlock, enterTextBodyDeclaration, enterTextDeclaration, enterThrowStatement, enterTimeLit, enterTimeLiteral, enterTraitBlock, enterTraitDeclaration, enterTraitPreamble, enterTraitReference, enterTraitsList, enterTryStatementExpression, enterTypeBlock, enterTypeDeclaration, enterTypeDef, enterVariableDeclaration, enterVariableOnlyDeclaration, enterVersionNumberLit, enterVersionNumberLiteral, enterWebVariableCorrelation, enterWhileStatementExpression, exitAccessModifier, exitAggregateParts, exitAggregateProperty, exitAllowingOnly, exitApplicationBlock, exitApplicationDeclaration, exitArgumentParam, exitAspectDeclaration, exitAssertDoesNotThrowExpression, exitAssertPanicExpression, exitAssertStatement, exitAssertThrowsExpression, exitAssignmentExpression, exitAssignmentStatement, exitBinaryLit, exitBinaryLiteral, exitBlock, exitBlockStatement, exitBooleanLit, exitBooleanLiteral, exitBytesLit, exitBytesLiteral, exitCall, exitCaseExpression, exitCaseStatement, exitCatchStatementExpression, exitCharacterLit, exitCharacterLiteral, exitClassBlock, exitClassDeclaration, exitColourLit, exitColourLiteral, exitCompilationUnit, exitComponentBlock, exitComponentDeclaration, exitConstantBlock, exitConstantDeclaration, exitConstantInitialiser, exitConstrainDeclaration, exitConstrainType, exitDateLit, exitDateLiteral, exitDateTimeLit, exitDateTimeLiteral, exitDeclareArgumentParam, exitDecorationDimensionLiteral, exitDecorationResolutionLiteral, exitDefaultOperator, exitDict, exitDimensionLit, exitDirective, exitDirectivePart, exitDottedName, exitDurationLit, exitDurationLiteral, exitDynamicFunctionBody, exitDynamicFunctionDeclaration, exitDynamicVariableCapture, exitElseOnlyBlock, exitEmptyBlock, exitEnumerationDeclaration, exitEveryRule, exitExcludedControlFlowStatement, exitExcludedInstantiation, exitExcludedListComprehension, exitExcludedLiteral, exitExpression, exitExpressionParam, exitExtendDeclaration, exitExtendPreamble, exitFinallyStatementExpression, exitFloatingPointLit, exitFloatingPointLiteral, exitForLoop, exitForRange, exitForStatementExpression, exitFunctionBlock, exitHttpAccess, exitHttpVerb, exitIdentifier, exitIdentifierReference, exitIfControlBlock, exitIfStatement, exitInitValuePair, exitInstructionBlock, exitIntegerLit, exitIntegerLiteral, exitList, exitMillisecondLit, exitMillisecondLiteral, exitModuleBlock, exitModuleDeclaration, exitModuleSegment, exitMoneyLit, exitMoneyLiteral, exitNonIdentifierOperator, exitObjectAccess, exitObjectAccessExpression, exitObjectAccessStart, exitObjectAccessType, exitOperationCall, exitOperationDetails, exitOperator, exitOperatorDeclaration, exitPackageBlock, exitParameterisedArgs, exitParameterisedDetail, exitParameterisedParams, exitParameterisedType, exitParamExpression, exitPathLit, exitPathLiteral, exitPipelinePart, exitPreFlowAndControl, exitPreFlowStatement, exitPrimary, exitPrimaryReference, exitProgramBlock, exitRange, exitRecordBlock, exitRecordDeclaration, exitReferencesBlock, exitRegExLit, exitRegisterStatement, exitRegularExpressionLiteral, exitRequireStatement, exitReservedWord, exitResolutionLit, exitReturningParam, exitSecurityConstraint, exitServiceBlock, exitServiceDeclaration, exitServiceOperationDeclaration, exitSheBang, exitSingleStatementBlock, exitStatement, exitStreamCat, exitStreamExpression, exitStreamExpressionTermination, exitStreamFor, exitStreamPart, exitStreamSource, exitStreamStatement, exitStreamStatementTermination, exitStringLit, exitStringLiteral, exitStringPart, exitSwitchStatementExpression, exitTernaryPart, exitTextBlock, exitTextBodyDeclaration, exitTextDeclaration, exitThrowStatement, exitTimeLit, exitTimeLiteral, exitTraitBlock, exitTraitDeclaration, exitTraitPreamble, exitTraitReference, exitTraitsList, exitTryStatementExpression, exitTypeBlock, exitTypeDeclaration, exitTypeDef, exitVariableDeclaration, exitVariableOnlyDeclaration, exitVersionNumberLit, exitVersionNumberLiteral, exitWebVariableCorrelation, exitWhileStatementExpression, visitErrorNode, visitTerminal
-
Constructor Details
-
NeverEndingIterationMarker
NeverEndingIterationMarker(ParsedModule parsedModule)
-
-
Method Details
-
enterFunctionDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.functionDeclaration().The default implementation does nothing.
- Specified by:
enterFunctionDeclarationin interfaceEK9Listener- Overrides:
enterFunctionDeclarationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitFunctionDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.functionDeclaration().The default implementation does nothing.
- Specified by:
exitFunctionDeclarationin interfaceEK9Listener- Overrides:
exitFunctionDeclarationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterMethodDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.methodDeclaration().The default implementation does nothing.
- Specified by:
enterMethodDeclarationin interfaceEK9Listener- Overrides:
enterMethodDeclarationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitMethodDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.methodDeclaration().The default implementation does nothing.
- Specified by:
exitMethodDeclarationin interfaceEK9Listener- Overrides:
exitMethodDeclarationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitDynamicClassDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.dynamicClassDeclaration().The default implementation does nothing.
- Specified by:
exitDynamicClassDeclarationin interfaceEK9Listener- Overrides:
exitDynamicClassDeclarationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
markedHasNextOf
The reason a dynamic class (or closed class) never ends - its effective hasNext()'s mark - if it has one.
-