-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample1.py
36 lines (22 loc) · 820 Bytes
/
example1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from automatabpp import *
email_to_test = ""
def test_email():
for char in email_to_test:
OPERATION.run(char)
OPERATION.stop()
BEHAVIOUR.load_behaviour_from_graph("email/email.graphml", "E-Mail validation machine")
@EXECUTION.state
def GARBAGE(**_):
print("{} IS NOT A VALID EMAIL".format(email_to_test))
@EXECUTION.state
def EMAIL(**_):
print("{} IS A VALID EMAIL".format(email_to_test))
# ...............................................................................
# ---------- DEFINITIONS COMPLETE - RUNNING THE PROGRAM -------------------------
# ...............................................................................
OPERATION.start()
email_to_test = "a_valid@email.example"
test_email()
OPERATION.reset()
email_to_test = "an._invalid@email@example-"
test_email()