16 lines
316 B
Python
16 lines
316 B
Python
from regex import lit, concat, bar, star
|
|
from regex_to_nfa import to_nfa
|
|
from nfa_to_regex import to_regex
|
|
|
|
def main():
|
|
regex = concat(bar(lit('foo'), lit('bar')), bar(lit('baz'), lit('qux')))
|
|
print(regex)
|
|
|
|
nfa = to_nfa(regex)
|
|
regex_prime = to_regex(nfa)
|
|
|
|
print(regex_prime)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|