Functions
The following functions are available globally.
-
Concatenates two production strings
Declaration
Swift
public func <+> (lhs: ProductionString, rhs: ProductionString) -> ProductionStringParameters
lhsFirst production string
rhsSecond production string
Return Value
Concatenation of the given production strings
-
Concatenates a production string and a symbol
Declaration
Swift
public func <+> (lhs: ProductionString, rhs: Symbol) -> ProductionStringParameters
lhsA production string
rhsA symbol
Return Value
Concatenation of the production string and symbol
-
Concatenates a production string and a symbol
Declaration
Swift
public func <+> (lhs: Symbol, rhs: ProductionString) -> ProductionStringParameters
lhsA symbol
rhsA production string
Return Value
Concatenation of the production string and symbol
-
Concatenates two production symbols into a production string
Declaration
Swift
public func <+> (lhs: Symbol, rhs: Symbol) -> ProductionStringParameters
lhsFirst symbol
rhsSecond symbol
Return Value
Concatenation of the given symbols
-
Concatenates every possible production of the first production result with every possible production of the second production result
Declaration
Swift
public func <+> (lhs: ProductionResult, rhs: ProductionResult) -> ProductionResultParameters
lhsFirst production result
rhsSecond production result
Return Value
Every possible concatenation of the production strings in the given production results
-
Concatenates every production string of the production result with the given production string
Declaration
Swift
public func <+> (lhs: ProductionResult, rhs: ProductionString) -> ProductionResultParameters
lhsProduction result
rhsProduction string
Return Value
Concatenation of every production string in the production result with the given production string
-
Concatenates the given production string with every production string of the production result
Declaration
Swift
public func <+> (lhs: ProductionString, rhs: ProductionResult) -> ProductionResultParameters
lhsProduction string
rhsProduction result
Return Value
Concatenation of the given production string with every production string in the production result
-
Generates a production result containing every production string of the given production results
Declaration
Swift
public func <|> (lhs: ProductionResult, rhs: ProductionResult) -> ProductionResultParameters
lhsFirst production result
rhsSecond production result
Return Value
Joined production result of the given production results
-
Generates a production result containing every production of the left production result and the production string
Declaration
Swift
public func <|> (lhs: ProductionResult, rhs: ProductionString) -> ProductionResultParameters
lhsProduction result
rhsProduction string
Return Value
A production result generated by merging the left production result with the right production string
-
Generates a production result containing the left production string and every production of the right production string
Declaration
Swift
public func <|> (lhs: ProductionString, rhs: ProductionResult) -> ProductionResultParameters
lhsProduction string
rhsProduction result
Return Value
A production result generated by merging the left production string with the right production result
-
Generates a production result containing the left and right production string
Declaration
Swift
public func <|> (lhs: ProductionString, rhs: ProductionString) -> ProductionResultParameters
lhsFirst production string
rhsSecond production string
Return Value
A production result containing the left and right production string
-
Generates a production result containing the left production string and the right symbol
Declaration
Swift
public func <|> (lhs: ProductionString, rhs: Symbol) -> ProductionResultParameters
lhsProduction string
rhsSymbol
Return Value
A production result allowing the left production string and the right symbol
-
Generates a production result containing the left symbol and the right production string
Declaration
Swift
public func <|> (lhs: Symbol, rhs: ProductionString) -> ProductionResultParameters
lhsSymbol
rhsProduction string
Return Value
A production result allowing the left symbol and the right production string
-
Generates a production result by appending the right symbol to the left production result
Declaration
Swift
public func <|> (lhs: ProductionResult, rhs: Symbol) -> ProductionResultParameters
lhsProduction result
rhsSymbol
Return Value
A production result allowing every production string of the left production result and the right symbol
-
Generates a production result by appending the left symbol to the right production result
Declaration
Swift
public func <|> (lhs: Symbol, rhs: ProductionResult) -> ProductionResultParameters
lhsSymbol
rhsProduction result
Return Value
A production result allowing the left symbol and every production string of the right production result
-
Generates a production result containing the left and right symbol
Declaration
Swift
public func <|> (lhs: Symbol, rhs: Symbol) -> ProductionResultParameters
lhsLeft symbol
rhsRight symbol
Return Value
A production result allowing either the left or the right symbol
-
Generates a production from a given non-terminal and produced sequence of symbols
Declaration
Swift
public func --> (lhs: NonTerminal, rhs: ProductionString) -> ProductionParameters
lhsNon-terminal pattern
rhsProduced string of symbols
Return Value
Production with the given pattern and generated result
-
Generates a set of productions from a given non-terminal and produced result
Declaration
Swift
public func --> (lhs: NonTerminal, rhs: ProductionResult) -> [Production]Parameters
lhsNon-terminal pattern
rhsCollection of possible produced strings of symbols
Return Value
Productions with the given pattern and generated results
-
Generates a production from the given non-terminal to the given symbol
Declaration
Swift
public func --> (lhs: NonTerminal, rhs: Symbol) -> ProductionParameters
lhsNon-terminal pattern
rhsProduced symbol
Return Value
Production with the given pattern generating the given symbol
-
Creates a new non-regular terminal symbol
Note: The value of the terminal string may not overlap partially with any other non-terminal contained in a grammar.
Declaration
Swift
public func t(_ value: String) -> SymbolParameters
valueValue of the terminal symbol
Return Value
A terminal symbol with the given value
-
Creates a new non-terminal symbol
Declaration
Swift
public func n(_ name: String) -> SymbolParameters
nameName of the non-terminal symbol
Return Value
A non-terminal symbol with the given name
-
Creates a new regular terminal symbol
Note: The value of the terminal string may not overlap partially with any other non-terminal contained in a grammar. For regular terminals, it it may be deriable to add word boundary markers:
\b.Throws
An error indicating that the given regular expression is invalidDeclaration
Swift
public func rt(_ value: String) throws -> SymbolParameters
valueRegular value of the terminal
Return Value
A regular terminal symbol
-
Determines if two syntax trees are equal to each other.
This function returns true, if both trees have the same structure, equal keys in equal nodes and equal leafs
Declaration
Swift
public func == <Element, LeafElement>(lhs: SyntaxTree<Element, LeafElement>, rhs: SyntaxTree<Element, LeafElement>) -> Bool where Element : Equatable, LeafElement : EquatableParameters
lhsFirst tree to compare
rhsSecond tree to compare
Return Value
A boolean value indicating whether the provided trees are equal to each other
View on GitHub
Functions Reference