passes

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CodeImportVisibility      = "import-visibility"
	CodeEnumerationBodyMember = "enumeration-body-member"
)

Parser warning codes the analysis reports as errors: the reference rejects both forms, while the parser reads them into the tree the author intended.

View Source
const (
	CodeMOSAInterfaceNoStandard    = "mosa-interface-no-standard"
	CodeMOSAInterfaceNoControl     = "mosa-interface-no-control"
	CodeMOSAInterfaceNotTraced     = "mosa-interface-not-traced"
	CodeMOSAComponentNoDataRights  = "mosa-component-no-data-rights"
	CodeMOSAProprietaryNoRationale = "mosa-proprietary-no-rationale"
	CodeMOSABoundaryNotDesignated  = "mosa-boundary-not-designated"
)

Diagnostic codes of the MOSA rules.

View Source
const (
	CodeOOSEMRequirementNotDerived   = "oosem-requirement-not-derived"
	CodeOOSEMRequirementNotSatisfied = "oosem-requirement-not-satisfied"
	CodeOOSEMLogicalNotAllocated     = "oosem-logical-component-not-allocated"
	CodeOOSEMUseCaseSubject          = "oosem-use-case-subject"
)

Diagnostic codes of the OOSEM method rules.

View Source
const (
	LevelSyntax         = kit.LevelSyntax
	LevelNameResolution = kit.LevelNameResolution
	LevelType           = kit.LevelType
	LevelConstraint     = kit.LevelConstraint
)
View Source
const (
	CodeSendPayloadMissing        = "send-payload-missing"
	CodeSendToPort                = "send-to-port"
	CodeSendReceiverNotOccurrence = "send-receiver-not-occurrence"
	CodeSendSenderNotOccurrence   = "send-sender-not-occurrence"
)

Diagnostic codes of the send-action rules.

View Source
const CodeConnectorEnds = "connector-ends"

CodeConnectorEnds marks a connector whose ends do not fit the link it specializes: too many for a binary link, or redefining no end of it.

View Source
const CodeKerMLNotation = "kerml-notation"

CodeKerMLNotation marks KerML notation used in a SysML file, where the SysML grammar has no production for it. Strict mode rejects it too: the pinned SysML grammar admits it nowhere.

View Source
const CodeNonstandardNotation = "nonstandard-notation"

CodeNonstandardNotation marks notation OpenSysML accepts that no production of the pinned SysML v2 grammars admits.

View Source
const CodeReservedKeywordName = "reserved-keyword-name"

CodeReservedKeywordName marks a recovered declared name spelled as a reserved keyword, which analysis rejects in every mode.

View Source
const CodeSysMLNotation = "sysml-notation"

CodeSysMLNotation marks SysML notation used in a KerML file, which the pinned KerML grammar admits nowhere.

View Source
const CodeUnboundParameter = "unbound-parameter"

CodeUnboundParameter advises of an invocation leaving a default-less input parameter unbound: well formed (KerML 1.0 §8.3.4.8.8), but the runtime refuses to evaluate it.

Variables

This section is empty.

Functions

func Analyze

func Analyze(name string, root *ast.RootNamespace, parseDiags []diag.Diagnostic, idx *symbols.Index) []diag.Diagnostic

Analyze runs the default validation passes over a single parsed document and returns diagnostics sorted by span offset, then source, then message. parseDiags are the parser's diagnostics, already adapted to diag.Diagnostic by the caller.

func AnalyzeShared

func AnalyzeShared(name string, kind source.Kind, root *ast.RootNamespace,
	parseDiags []diag.Diagnostic, opts Options, shared Shared) []diag.Diagnostic

AnalyzeShared validates a document over a resolver and model kept across analyses: what the run memoizes is owned by the document (see Resolver.InDocument), to be dropped when it or what it read changes.

func AnalyzeWithKind

func AnalyzeWithKind(name string, kind source.Kind, root *ast.RootNamespace,
	parseDiags []diag.Diagnostic, idx *symbols.Index) []diag.Diagnostic

AnalyzeWithKind validates a document whose language is not encoded in name, in the default conformance mode.

func AnalyzeWithOptions

func AnalyzeWithOptions(name string, kind source.Kind, root *ast.RootNamespace,
	parseDiags []diag.Diagnostic, idx *symbols.Index, opts Options) []diag.Diagnostic

AnalyzeWithOptions validates a document under explicit analysis options.

func NewArgumentTyper

func NewArgumentTyper(resolver *resolve.Resolver, model *semantics.Model) semantics.ArgumentTyper

NewArgumentTyper is the checker's argument typing for model to select calls with, so a consumer reading a call through the model selects what the checker selects.

func NewTypedModel

func NewTypedModel(resolver *resolve.Resolver) *semantics.Model

NewTypedModel is a semantic model over resolver with the checker's argument typing installed: what every path that hands a model to the runtime builds.

func SelectInvocation

func SelectInvocation(resolver *resolve.Resolver, model *semantics.Model, scope *symbols.Scope, e *ast.InvocationExpr, performs semantics.Performs) *semantics.InvocationSelection

SelectInvocation is the declaration e calls in scope, chosen among every visible declaration of its name the call site can run by its arguments' static types; the runtime dispatches on it too.

Types

type AnnotationOwnershipPass

type AnnotationOwnershipPass struct{}

AnnotationOwnershipPass checks that an annotation owned by its annotated element owns its annotating element (KerML 8.3.2.3.3): textually, no `about` names itself.

func (AnnotationOwnershipPass) ElementScoped

func (AnnotationOwnershipPass) ElementScoped()

ElementScoped: each `about` reference gates on its own resolution.

func (AnnotationOwnershipPass) Level

func (AnnotationOwnershipPass) Run

type AssignmentReferentPass

type AssignmentReferentPass struct{}

AssignmentReferentPass checks SysML AssignmentActionUsage referents.

func (AssignmentReferentPass) ElementScoped

func (AssignmentReferentPass) ElementScoped()

func (AssignmentReferentPass) Level

func (AssignmentReferentPass) Run

type AssociationEndTypesPass

type AssociationEndTypesPass struct{}

AssociationEndTypesPass checks that every owned end feature of an association has exactly one type (KerML 8.3.4.1.2, validateAssociationEndTypes), counting types inherited by redefinition and ignoring ones a more specific type implies.

func (AssociationEndTypesPass) Level

func (AssociationEndTypesPass) Run

type ConstraintPass

type ConstraintPass struct{}

ConstraintPass runs the depth-C semantic constraint checks over a document's symbol tree: specialization-cycle detection, multiplicity-range validity, and subsetting multiplicity conformance (design §4.1). It runs at LevelConstraint, after type checking; it relies on the shared semantic model for the resolved specialization graph and extracted multiplicities.

func (ConstraintPass) Level

func (ConstraintPass) Level() PassLevel

func (ConstraintPass) Run

func (ConstraintPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type Context

type Context = kit.Context

Context carries shared state made available to every pass in a run.

func NewContext

func NewContext(name string, idx *symbols.Index, parseDiags []diag.Diagnostic) *Context

NewContext builds a Context for a document, in the default mode.

func NewContextWithKind

func NewContextWithKind(name string, kind source.Kind, idx *symbols.Index,
	parseDiags []diag.Diagnostic) *Context

NewContextWithKind builds a context with an explicit source language.

func NewContextWithOptions

func NewContextWithOptions(name string, kind source.Kind, idx *symbols.Index,
	parseDiags []diag.Diagnostic, opts Options) *Context

NewContextWithOptions builds a context that carries explicit analysis options.

type ElementFilterPass

type ElementFilterPass struct{}

ElementFilterPass checks the element-filter conditions a document writes: the `filter` members of a namespace (KerML 8.2.4) and the `[...]` clause of an import or expose (SysML v2 7.4.4). A condition is a predicate over one candidate element, so it has to be boolean-valued and it has to be a form the filter evaluator can decide; a condition that is neither selects nothing, and name resolution keeps every candidate rather than hiding model content on a verdict it could not reach.

It runs at LevelType, and its subject is one condition. A classification test is Boolean whatever type it names, so it rests on that type and says nothing more once the type fails to resolve; every other form is judged on itself, where an unresolved name is the verdict — not model-level evaluable — rather than a reason to withhold it.

func (ElementFilterPass) ElementScoped

func (ElementFilterPass) ElementScoped()

func (ElementFilterPass) Level

func (ElementFilterPass) Level() PassLevel

func (ElementFilterPass) Run

func (ElementFilterPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type ElementScoped

type ElementScoped interface{ ElementScoped() }

ElementScoped marks a pass whose subject is a single element rather than the document, so a failure on another element does not skip it. Such a pass names its subject in code and asks Context.DownstreamOfFailure about the references that subject rests on.

type EndFeaturePass

type EndFeaturePass struct{}

EndFeaturePass checks end features (KerML 8.3.3.1.5): an end feature has no direction and is not derived, abstract, composite or portion.

func (EndFeaturePass) ElementScoped

func (EndFeaturePass) ElementScoped()

ElementScoped: each end feature gates on its own head.

func (EndFeaturePass) Level

func (EndFeaturePass) Level() PassLevel

func (EndFeaturePass) Run

func (EndFeaturePass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type FeatureReferencePass

type FeatureReferencePass struct{}

FeatureReferencePass checks the features an expression names: a referent must be a feature (KerML 8.4.4.6.2/8.4.4.7.2), a featured one must be reachable from where it is named (8.3.4.5.2 validateSubsettingFeaturingTypes), and each feature of a declared chain must be featured within the one before it (8.3.3.3.4 validateFeatureChainingFeatureConformance).

func (FeatureReferencePass) Level

func (FeatureReferencePass) Run

type Gathers

type Gathers = kit.Gathers

Gathers holds workspace-wide audit state.

func NewGathers

func NewGathers() *Gathers

NewGathers returns gathers with nothing gathered yet.

type GrammarViolationPass

type GrammarViolationPass struct{}

GrammarViolationPass escalates the parser's warnings on a bare `import` (ImportPrefix) and an illegal EnumerationBody member to errors; both read, so neither gates a tier.

func (GrammarViolationPass) Level

func (GrammarViolationPass) Run

type ImplicitBasePass

type ImplicitBasePass struct{}

ImplicitBasePass checks that a classifier reaches the standard-library supertype implied by its kind and that a feature has at least one type (KerML 1.0 validateClassifierDefaultSupertype, validateFeatureHasType). Both hold implicitly once the library is in the resource set, so they report a model whose resources do not supply it, or whose conjugation replaces it.

func (ImplicitBasePass) Level

func (ImplicitBasePass) Level() PassLevel

func (ImplicitBasePass) Run

func (ImplicitBasePass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type KerMLSubsettingMetaclassPass

type KerMLSubsettingMetaclassPass struct{}

KerMLSubsettingMetaclassPass checks that a feature subsets another Feature.

func (KerMLSubsettingMetaclassPass) ElementScoped

func (KerMLSubsettingMetaclassPass) ElementScoped()

func (KerMLSubsettingMetaclassPass) Level

func (KerMLSubsettingMetaclassPass) Run

type MOSAPass

type MOSAPass struct{}

MOSAPass audits the elements a model classifies with the MOSA library for the openness MOSA asks of them; each rule fires only once the model states that kind of fact.

func (MOSAPass) Level

func (MOSAPass) Level() PassLevel

Level reports the tier the pass runs at.

func (MOSAPass) Run

func (MOSAPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

Run audits one workspace document against the MOSA rules.

type MetadataAnnotationPass

type MetadataAnnotationPass struct{}

MetadataAnnotationPass checks a metadata annotation: what it may annotate, and that its body restates features of its type and binds model-level evaluable values (KerML 1.0 §7.4.9, §8.3.4.9).

func (MetadataAnnotationPass) Level

func (MetadataAnnotationPass) Run

type MetadataTypePass

type MetadataTypePass struct{}

MetadataTypePass reports an annotation (`@M`, `#M` or `metadata m : M`) whose type is not a concrete metaclass or metadata definition (KerML validateMetadataFeatureMetadata, validateMetadataFeatureMetadataNotAbstract; SysML validateMetadataUsageType).

func (MetadataTypePass) ElementScoped

func (MetadataTypePass) ElementScoped()

Its subject is one annotation, and the reference that subject rests on is the metaclass it names: a failure on another element does not hide it.

func (MetadataTypePass) Level

func (MetadataTypePass) Level() PassLevel

func (MetadataTypePass) Run

func (MetadataTypePass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type MultiplicityBoundsPass

type MultiplicityBoundsPass struct{}

MultiplicityBoundsPass checks that every multiplicity bound has a Natural value (KerML 8.3.3.1.9, validateMultiplicityRangeBoundResultTypes): a model-level evaluable bound must evaluate to a non-negative whole number or `*`, and any other bound must have an Integer-conforming result type.

func (MultiplicityBoundsPass) Level

func (MultiplicityBoundsPass) Run

type MultiplicityDomainPass

type MultiplicityDomainPass struct{}

MultiplicityDomainPass checks that a feature-owned multiplicity has the same featuring types as its owning feature.

func (MultiplicityDomainPass) Level

func (MultiplicityDomainPass) Run

type NameResolutionPass

type NameResolutionPass struct{}

NameResolutionPass resolves every reference in a document via the Plan-3 resolver and reports unresolved / ambiguous references.

func (NameResolutionPass) Level

func (NameResolutionPass) Level() PassLevel

Level reports the name-resolution dependency level.

func (NameResolutionPass) Run

Run resolves the document and adapts resolver diagnostics.

type NonstandardNotationPass

type NonstandardNotationPass struct{}

NonstandardNotationPass reports extension notation and recoverable grammar violations without gating later semantic analysis.

func (NonstandardNotationPass) Level

Level reports the syntax level: the written notation is all it reads.

func (NonstandardNotationPass) Run

Run walks the document for extension and language-specific notation.

type OOSEMMethodPass

type OOSEMMethodPass struct{}

OOSEMMethodPass audits the artefacts a model classifies with the OOSEM library against the method's traceability and allocation rules. Each rule fires only once the model declares the artefacts the rule relates, so a model still being built is not told what it has not reached yet.

func (OOSEMMethodPass) Level

func (OOSEMMethodPass) Level() PassLevel

func (OOSEMMethodPass) Run

func (OOSEMMethodPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type Options

type Options = kit.Options

Options is the analysis configuration of one run.

type Pass

type Pass = kit.Pass

Pass is a single validation rule.

type PassLevel

type PassLevel = kit.PassLevel

PassLevel is the dependency tier of a validation pass.

type RedefinitionConformancePass

type RedefinitionConformancePass struct{}

RedefinitionConformancePass reports the feature-conformance rules a subsetting or redefinition breaks: direction, uniqueness and constancy (KerML 8.3.3.3). The predicates live in semantics; this pass only locates and words them.

func (RedefinitionConformancePass) Level

func (RedefinitionConformancePass) Run

type RedefinitionDirectionPass

type RedefinitionDirectionPass struct{}

RedefinitionDirectionPass reports direction conformance as a typing property.

func (RedefinitionDirectionPass) Level

func (RedefinitionDirectionPass) Run

type ReferenceSubsettingPass

type ReferenceSubsettingPass struct{}

ReferenceSubsettingPass checks that a feature owns at most one reference subsetting (`references`/`::>`), KerML 8.3.3.1.5. Every reference subsetting after the first is reported, as the pilot does.

func (ReferenceSubsettingPass) Level

func (ReferenceSubsettingPass) Run

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds an ordered set of validation passes.

func DefaultRegistry

func DefaultRegistry() *Registry

DefaultRegistry returns the default pass registry: syntax, name resolution, state transitions, type checking, and semantic constraints.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns an empty registry.

func (*Registry) Passes

func (r *Registry) Passes() []Pass

Passes returns the registered passes in registration order.

func (*Registry) Register

func (r *Registry) Register(p Pass)

Register adds a pass to the registry.

func (*Registry) Run

func (r *Registry) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

Run executes all registered passes in ascending PassLevel order and returns their accumulated diagnostics. A pass whose subject is the document is skipped once a strictly lower level emitted a blocking diagnostic, avoiding cascade noise; an ElementScoped pass runs and gates itself per element. Passes at the same level always run.

type ResultExpressionPass

type ResultExpressionPass struct{}

ResultExpressionPass checks that a function or expression has at most one result expression, owned or inherited (KerML 8.3.4.6 Expression::result, 8.3.4.8 Function::result). A calculation body states at most one; a type that inherits a result expression cannot state its own — a specialization or redefinition keeps the inherited body or adds constraints beside it — and one that inherits two along different specializations is invalid on its own.

func (ResultExpressionPass) ElementScoped

func (ResultExpressionPass) ElementScoped()

ElementScoped: each type gates on the head naming its supertypes.

func (ResultExpressionPass) Level

func (ResultExpressionPass) Run

type SendActionPass

type SendActionPass struct{}

SendActionPass types the payload, `via` and `to` arguments of every send and checks the SysML v2 SendActionUsage constraints on them.

func (SendActionPass) ElementScoped

func (SendActionPass) ElementScoped()

ElementScoped lets each send argument gate independently on lower failures.

func (SendActionPass) Level

func (SendActionPass) Level() PassLevel

Level reports that this pass consumes name-resolution results.

func (SendActionPass) Run

func (SendActionPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

Run checks every send in the document.

type Shared

type Shared struct {
	Resolver *resolve.Resolver
	Model    *semantics.Model
	Gathers  *Gathers
}

Shared is the semantic state a workspace keeps across analyses: the resolver and model it memoizes into, and what its audits gathered per document.

func (Shared) Share

func (s Shared) Share(ctx *Context)

Share hands ctx the workspace's resolver, model and gathers in place of the fresh ones it would make.

type SyntaxPass

type SyntaxPass struct{}

SyntaxPass surfaces the parser-produced diagnostics carried on the Context. The passes package does not import parser; the caller adapts parser diagnostics into diag.Diagnostic and stores them on Context.ParseDiagnostics.

func (SyntaxPass) Level

func (SyntaxPass) Level() PassLevel

Level reports that syntax is the lowest dependency level.

func (SyntaxPass) Run

func (SyntaxPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

Run returns the parse diagnostics carried on the context.

type TopLevelImportPass

type TopLevelImportPass struct{}

TopLevelImportPass checks that an import owned by the root namespace is private (KerML 8.2.3.4.2, validateImportTopLevelVisibility): a root namespace has no owner, so a non-private import there exports into nothing. It runs at the constraint tier so a recovered parse is not reported on twice and this error does not gate the type and constraint tiers.

func (TopLevelImportPass) Level

func (TopLevelImportPass) Level() PassLevel

func (TopLevelImportPass) Run

type TransitionGuardPass

type TransitionGuardPass struct{}

TransitionGuardPass checks that each transition guard is Boolean-valued, including the guarded successions of an action body (`first a if x then b;`).

func (TransitionGuardPass) ElementScoped

func (TransitionGuardPass) ElementScoped()

func (TransitionGuardPass) Level

func (TransitionGuardPass) Run

type TriggerArgumentPass

type TriggerArgumentPass struct{}

TriggerArgumentPass types the argument of every `after`, `at` or `when` trigger, each gated on its own argument rather than the whole document.

func (TriggerArgumentPass) ElementScoped

func (TriggerArgumentPass) ElementScoped()

func (TriggerArgumentPass) Level

func (TriggerArgumentPass) Run

type TypeCheckPass

type TypeCheckPass struct{}

TypeCheckPass validates that each def/usage relationship target has a symbol kind compatible with the source node and relationship kind (spec §6.3), and types expressions (operands, bound values, invocation arguments) against the stdlib scalar lattice. It runs at LevelType, after name resolution; unresolved targets are skipped.

func (TypeCheckPass) Level

func (TypeCheckPass) Level() PassLevel

func (TypeCheckPass) Run

func (TypeCheckPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type TypeRelationshipsPass

type TypeRelationshipsPass struct{}

TypeRelationshipsPass checks the union, intersection, difference and chaining relationships a type owns for a single operand or a self operand (KerML 8.3.3.1.2, 8.3.3.1.5). Constraint tier: the self rules resolve targets.

func (TypeRelationshipsPass) Level

func (TypeRelationshipsPass) Run

type UndefinedOperatorPass

type UndefinedOperatorPass struct{}

UndefinedOperatorPass warns on every written `~x`, as §8.2.5.8.1 asks of a tool when no domain-specific definition of `DataFunctions::'~'` is available.

func (UndefinedOperatorPass) Level

Level reports the syntax level: the written operator is all it reads, so a later-tier failure never hides the warning.

func (UndefinedOperatorPass) Run

Run warns at each `~` operator expression the parser recorded on the root. It stays a warning in every conformance mode: the specification asks for a warning, not a rejection.

type VariableFeaturePass

type VariableFeaturePass struct{}

VariableFeaturePass checks feature variability (KerML 8.3.3.1.5): a `var` feature is owned by an occurrence type and is no portion; only a variable feature is initialized or constant.

func (VariableFeaturePass) ElementScoped

func (VariableFeaturePass) ElementScoped()

ElementScoped: each feature gates on its own head and its owner's.

func (VariableFeaturePass) Level

func (VariableFeaturePass) Run

type VariantOwnerPass

type VariantOwnerPass struct{}

VariantOwnerPass reports a `variant` whose owner is not a variation: it offers no choice to anything (SysML v2 §7.20 VariantMembership; pilot SysMLValidator validateVariationMembershipOwningNamespace). The grammar admits the member in any definition body (SysML.xtext DefinitionBodyItem), so the rule is semantic.

func (VariantOwnerPass) ElementScoped

func (VariantOwnerPass) ElementScoped()

ElementScoped: a variant gates on its own declaration and on what makes its owner a variation, not on faults elsewhere in the document.

func (VariantOwnerPass) Level

func (VariantOwnerPass) Level() PassLevel

func (VariantOwnerPass) Run

func (VariantOwnerPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type W8DConnectorFeaturingPass

type W8DConnectorFeaturingPass struct{}

W8DConnectorFeaturingPass checks that each end of a connector names a feature featured within the connector's own featuring type (KerML 1.0 §8.3.3.3, Feature::isFeaturedWithin): a nested feature is reached with dot notation, not with `::`.

func (W8DConnectorFeaturingPass) Level

func (W8DConnectorFeaturingPass) Run

type W8DFlowEndPass

type W8DFlowEndPass struct{}

W8DFlowEndPass checks that a flow's ends name features of the flow's own context rather than members of an unrelated definition (SysML v2 §8.3.17).

func (W8DFlowEndPass) Level

func (W8DFlowEndPass) Level() PassLevel

func (W8DFlowEndPass) Run

func (W8DFlowEndPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type W8DMetadataUsagePass

type W8DMetadataUsagePass struct{}

W8DMetadataUsagePass checks that every feature in a `metadata m : A { … }` usage body redefines one of A's own and binds a model-level evaluable value (KerML §7.5); the type itself is MetadataTypePass's. It runs at the tier MetadataAnnotationPass reports the same rules for the `@A { … }` spelling.

func (W8DMetadataUsagePass) Level

func (W8DMetadataUsagePass) Run

type W8DOccurrenceTypingPass

type W8DOccurrenceTypingPass struct{}

W8DOccurrenceTypingPass checks that an occurrence, item or part is typed by occurrence definitions only (SysML v2 §8.3.9.11, OccurrenceUsage).

func (W8DOccurrenceTypingPass) Level

func (W8DOccurrenceTypingPass) Run

type W8DVariabilityPass

type W8DVariabilityPass struct{}

W8DVariabilityPass checks that every usage a variation owns is a variant and that a variation does not specialize another variation (SysML v2 §7.20). An enumeration definition is a variation without saying so (SysML v2 §7.6.4).

func (W8DVariabilityPass) Level

func (W8DVariabilityPass) Level() PassLevel

func (W8DVariabilityPass) Run

type W8DVerificationPass

type W8DVerificationPass struct{}

W8DVerificationPass checks that a `verify` appears only in the objective of a verification case (SysML v2 §8.3.24).

func (W8DVerificationPass) Level

func (W8DVerificationPass) Run

type W9CBoundFeatureTypesPass

type W9CBoundFeatureTypesPass struct{}

W9CBoundFeatureTypesPass checks that the two features a binding connector binds have conforming types (SysML 8.3.3.1, KerML 8.3.4.3): binding features of unrelated types cannot be satisfied. Besides `bind a = b` it judges the bindings the language implies: a function's result expression to its result parameter, a subject's value or the subject of a `satisfy … by` to the subject it fills, and a nested requirement's subject to its owner's. The binding an operator or invocation argument implies is judged by the type checker, which knows the parameter it fills (w9c_argument_bindings.go).

func (W9CBoundFeatureTypesPass) Level

func (W9CBoundFeatureTypesPass) Run

type W9CInheritedNameConflictPass

type W9CInheritedNameConflictPass struct{}

W9CInheritedNameConflictPass warns when a declaration reuses a member name a library definition it conforms to already supplies — `state start;` inside a state, against StatePerformances::StateAction::start — and when two such definitions each supply a feature of one name: `action a : ABlock` inherits `self`, `start` and `done` from both Actions::Action and Parts::Part. The resolver's own rule covers only the document's own supertypes.

func (W9CInheritedNameConflictPass) Level

func (W9CInheritedNameConflictPass) Run

type W9CShortNameDistinguishabilityPass

type W9CShortNameDistinguishabilityPass struct{}

W9CShortNameDistinguishabilityPass reports the short names one namespace uses twice, or that repeat another member's name: a short name is a name for distinguishability (KerML 7.2.2). Resolve's own rule keys on primary names, so it never sees these.

func (W9CShortNameDistinguishabilityPass) Level

func (W9CShortNameDistinguishabilityPass) Run

type W9CUserStandardLibraryPass

type W9CUserStandardLibraryPass struct{}

W9CUserStandardLibraryPass reports a `standard library package` written outside the standard library: only the library's own packages may claim it (KerML 7.2.4).

func (W9CUserStandardLibraryPass) Level

func (W9CUserStandardLibraryPass) Run

type W10BEndKindPass

type W10BEndKindPass struct{}

W10BEndKindPass checks the kind and the number of end features an interface or a flow connection definition declares. It is level-scoped to the type tier like the usage-typing rules it accompanies, since the reference reports both on the same declaration.

func (W10BEndKindPass) Level

func (W10BEndKindPass) Level() PassLevel

func (W10BEndKindPass) Run

func (W10BEndKindPass) Run(ctx *Context, name string, root *ast.RootNamespace) []diag.Diagnostic

type W10BIndividualTypingPass

type W10BIndividualTypingPass struct{}

W10BIndividualTypingPass checks that a usage carrying the `individual` modifier is typed by exactly one individual definition (SysML v2 §8.3.9.11). Other types are allowed beside it, as they are in the reference.

func (W10BIndividualTypingPass) Level

func (W10BIndividualTypingPass) Run

type W10BPortionOwnerPass

type W10BPortionOwnerPass struct{}

W10BPortionOwnerPass checks that a `snapshot` or `timeslice` usage is owned by an occurrence definition or usage: a portion of an occurrence needs the occurrence it is a portion of (SysML v2 §8.3.9.11).

func (W10BPortionOwnerPass) Level

func (W10BPortionOwnerPass) Run

type W10BRelatedElementsPass

type W10BRelatedElementsPass struct{}

W10BRelatedElementsPass reports a concrete association with fewer than two ends, or a concrete connector whose ends reference fewer than two features: a link needs two participants (KerML 1.1 §8.3.3.5, §8.3.4.7). An abstract declaration is exempt, as it is in the reference — its ends are the specialization's to supply. A binding connector, abstract or not, must bind exactly two features (§8.3.4.7.2 validateBindingConnectorIsBinary).

func (W10BRelatedElementsPass) Level

func (W10BRelatedElementsPass) Run

type W10BStructuralPass

type W10BStructuralPass struct{}

W10BStructuralPass checks how many members of a kind a declaration owns and whether they may be composite. The rules read the declaration only, so they sit at the type tier rather than behind it.

func (W10BStructuralPass) Level

func (W10BStructuralPass) Level() PassLevel

func (W10BStructuralPass) Run

type W11AKerMLSpecializationPass

type W11AKerMLSpecializationPass struct{}

W11AKerMLSpecializationPass checks the kind of a classifier's supertypes: a data type specializes neither a class nor an association, a class neither a data type nor an association, and a structure and a behavior do not specialize each other (KerML 1.0 §8.4.4). A SysML definition is a classifier of the family its metaclass specializes, and its data type and class rules are worded in SysML terms (SysML v2 §8.3.7.2, §8.3.10.2).

func (W11AKerMLSpecializationPass) Level

func (W11AKerMLSpecializationPass) Run

type W11AUsageTypingPass

type W11AUsageTypingPass struct{}

W11AUsageTypingPass checks the kind of a usage's type where the typing is inherited through a subsetting, redefinition or reference subsetting, and the kind of the feature a `perform`/`exhibit` member references.

func (W11AUsageTypingPass) Level

func (W11AUsageTypingPass) Run

type W11EConjugatedSpecializationPass

type W11EConjugatedSpecializationPass struct{}

W11EConjugatedSpecializationPass checks that a conjugated type is not the specific type of a specialization (KerML 1.0 validateSpecializationSpecificNotConjugated). The specialization metaclass rules are W11AKerMLSpecializationPass's, and this pass shares its level so a kind error does not suppress this one.

func (W11EConjugatedSpecializationPass) Level

func (W11EConjugatedSpecializationPass) Run

Source Files

Directories

Path Synopsis
Package behavior contains validation passes over state machines, successions and control nodes.
Package behavior contains validation passes over state machines, successions and control nodes.
Package diagram contains validation passes for view renderings and diagram layout annotations.
Package diagram contains validation passes for view renderings and diagram layout annotations.
Package document contains validation passes for document definitions and queries.
Package document contains validation passes for document definitions and queries.
Package identity contains the validation pass over declared element identities and the workspace-wide gather it reads.
Package identity contains the validation pass over declared element identities and the workspace-wide gather it reads.
Package kit contains the reusable validation pass framework.
Package kit contains the reusable validation pass framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL