%%{init: {'securityLevel': 'loose', 'theme':'base', 'themeVariables': { 'fontFamily': 'Fira Code', 'fontSize': '32px'}}}%%
graph LR
    E1[IllegalDecimalException]
    E2[IllegalIndentifierException]
    E3[IllegalSymbolException]

    S1([init])
    S2([2])
    S3{{set token}}
    S4([4])
    S5{{set token}}
    S6([6])
    S7([7])
    S8([8])
    S9{{set token}}
    S10{{set token}}
    S11([11])
    S12{{set token}}

    S1 -- t --> S2
    S2 -.-> E1
    S2 -- ure --> S3
    S3 ==> S1

    S1 -- f --> S4
    S4 -.-> E1
    S4 -- alse --> S5
    S5 ==> S1

    S1 -- 0-9 --> S6
    S6 -- 0-9 --> S6
    S6 -.-> E2
    S6 -- e/E --> S7
    S7 -- 0-9/- --> S8
    S7 -.-> E2
    S8 -- 0-9 --> S8
    S8 --> S9
    S9 ==> S1

    S1 -- single-op --> S10
    S1 -.-> E3
    S10 ==> S1

    S1 -- multi-op --> S11
    S11 -- multi-op --> S12
    S11 -.-> E3
    S12 ==> S1

    subgraph Boolean
        S2
        S3
        S4
        S5
    end
    subgraph Number
        S6
        S7
        S8
        S9
    end
    subgraph Operator
        S10
        S11
        S12
    end
    subgraph Error
        E1
        E2
        E3
    end

    classDef Error fill:#f00
    class E1,E2,E3 Error

    classDef Final fill:#0f0
    class S3,S5,S9,S10,S12 Final

    style S1 fill:#ff0