File tree 1 file changed +0
-46
lines changed
1 file changed +0
-46
lines changed Original file line number Diff line number Diff line change 8
8
from enum import Enum
9
9
10
10
11
- class CharType (Enum ):
12
- NUMERIC = "NUMERIC"
13
- SIGN = "SIGN"
14
- EXPONENT = "EXPONENT"
15
- DECIMAL = "DECIMAL"
16
-
17
-
18
- class State (Enum ):
19
- INITIAL = "INITIAL"
20
- SIGNED = "SIGNED"
21
- WHOLE = "WHOLE"
22
- FRACTIONAL = "FRACTIONAL"
23
- FRACTION = "FRACTION"
24
- EXPONENTIAL = "EXPONENTIAL"
25
- EXP_SIGN = "EXP_SIGN"
26
- EXP_NUMBER = "EXP_NUMBER"
27
-
28
-
29
- state_machine : dict [State , dict [CharType , State ]] = {
30
- State .INITIAL : {
31
- CharType .NUMERIC : State .WHOLE ,
32
- CharType .SIGN : State .SIGNED ,
33
- CharType .DECIMAL : State .FRACTIONAL ,
34
- },
35
- State .SIGNED : {CharType .NUMERIC : State .WHOLE , CharType .DECIMAL : State .FRACTIONAL },
36
- State .WHOLE : {
37
- CharType .NUMERIC : State .WHOLE ,
38
- CharType .DECIMAL : State .FRACTION ,
39
- CharType .EXPONENT : State .EXPONENTIAL ,
40
- },
41
- State .FRACTIONAL : {CharType .NUMERIC : State .FRACTION },
42
- State .FRACTION : {
43
- CharType .NUMERIC : State .FRACTION ,
44
- CharType .EXPONENT : State .EXPONENTIAL ,
45
- },
46
- State .EXPONENTIAL : {
47
- CharType .NUMERIC : State .EXP_NUMBER ,
48
- CharType .SIGN : State .EXP_SIGN ,
49
- },
50
- State .EXP_SIGN : {CharType .NUMERIC : State .EXP_NUMBER },
51
- State .EXP_NUMBER : {CharType .NUMERIC : State .EXP_NUMBER },
52
- }
53
-
54
- from enum import Enum
55
-
56
-
57
11
class CharType (Enum ):
58
12
NUMERIC = "NUMERIC"
59
13
SIGN = "SIGN"
You can’t perform that action at this time.
0 commit comments