StyleRule

class StyleRule(    val pattern: ValidatedStylePattern,     val instructions: NybbleArray,     literals: List<String>)

A StyleRule is a pattern-matching program produced by a StylePatternCompiler. A runtime stylesheet aggregates all rules that should be considered when determining how Avail source text should be rendered.

Author

Todd L Smith

Parameters

pattern
instructions

The instructions that implement the pattern-matching program.

literals

The literal values recorded by the compiler, corresponding to the fixed style classifiers embedded in the pattern. Will be interned prior to internal storage, to accelerate matching during execution.

Constructors

Link copied to clipboard
fun StyleRule(    pattern: ValidatedStylePattern,     instructions: NybbleArray,     literals: List<String>)

Construct a StyleRule.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun literalAt(index: Int): String

Answer the literal value at the requested index. Should generally only be invoked by a StyleRuleInstruction during its execution.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val initialContext: StyleRuleContext

The initial StyleRuleContext for running the receiver.

Link copied to clipboard
val instructions: NybbleArray

The instructions that implement the pattern-matching program.

Link copied to clipboard
val pattern: ValidatedStylePattern
Link copied to clipboard
val renderingContext: ValidatedRenderingContext

The validated rendering context to apply when this rule is not obsoleted by a more specific rule during aggregate matching.

Link copied to clipboard
val source: String

The source text whence the rule was compiled.