Module: regex

Methods

(static) concat(graph1, graph2) → {string}

performs the concatenation operation on two graphs
Parameters:
Name Type Description
graph1 string the first graph
graph2 string the second graph
Source:
Returns:
the new resulting graph of the concatenation operation
Type
string

(static) getPrecendence(key) → {Number}

given an operator, gets the operator's precedence
Parameters:
Name Type Description
key string the operator to get the predecence of
Source:
Returns:
the predecence of the operator as an int
Type
Number

(static) injectConcatSymbols(expressionString) → {string}

inserts omitted concatenation symbols in regular expression
Parameters:
Name Type Description
expressionString string the string to inject concatenation symbols in
Source:
Returns:
the string with concatenation symbols inserted
Type
string

(static) kleene(graph) → {string}

performs the union operation on two graphs
Parameters:
Name Type Description
graph string the graph
Source:
Returns:
the new resulting graph of the kleene operation
Type
string

(static) shunting_yard(string) → {string}

applies the shunting-yard algorithm to convert regular expression to postfix notation
Parameters:
Name Type Description
string string the string to convert to postfix
Source:
Returns:
the string in postfix notation
Type
string

(static) union(graph1, graph2) → {string}

performs the union operation on two graphs
Parameters:
Name Type Description
graph1 string the first graph
graph2 string the second graph
Source:
Returns:
the new resulting graph of the union operation
Type
string