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 |
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 |
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 |
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 |
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 |
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 |
Returns:
the new resulting graph of the union operation
- Type
- string