Element

public class Element : Codable

Element

  • The annotations defined as RuleAnnotations

    Declaration

    Swift

    public var ruleAnnotations: RuleAnnotations { get }
  • True if the element is skipping

    Declaration

    Swift

    public var isVoid: Bool { get }
  • True if it is a scanning element

    Declaration

    Swift

    public var isTransient: Bool { get }
  • True if the element is lookahead

    Declaration

    Swift

    public var isLookahead: Bool { get }
  • True if the element is negated

    Declaration

    Swift

    public var isNegated: Bool { get }
  • Returns the token name (if any) of the element

    Declaration

    Swift

    public var token: TokenType? { get }
  • The Kind of the rule

    Declaration

    Swift

    public var kind: Behaviour.Kind { get }
  • The Cardinality of the match

    Declaration

    Swift

    public var cardinality: Cardinality { get }
  • The Behaviour of the rule

    Declaration

    Swift

    public var behaviour: Behaviour { get }
  • Determines if the Element directly references the supplied identifier (references it at a point where it is possible the scan head has not moved.

    Declaration

    Swift

    public func directlyReferences(_ identifier: String, grammar: STLR.Grammar) -> Bool

    Parameters

    identifier

    The identifier that may be referenced

    grammar

    The grammar both the identifier and this element is in

    Return Value

    true if the identifier could be referenced before the scan head has moved

  • Undocumented

    Declaration

    Swift

    func directlyReferences(_ identifier: String, grammar: STLR.Grammar, closedList: inout [String]) -> Bool
  • Determines if the Element references the supplied identifier (that is the identifier appears in the element or some part of an expression that forms the element.

    Declaration

    Swift

    func references(_ identifier: String, grammar: STLR.Grammar) -> Bool

    Parameters

    identifier

    The identifier that may be referenced

    grammar

    The grammar both the identifier and this element is in

    Return Value

    true if the identifier is referenced

  • Undocumented

    Declaration

    Swift

    func references(_ identifier: String, grammar: STLR.Grammar, closedList: inout [String]) -> Bool
  • Undocumented

    Declaration

    Swift

    func expression(for tokenName: String, in grammar: STLR.Grammar) throws -> STLR.Expression