Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame state variables #229

Open
frame-lang opened this issue Apr 21, 2024 · 0 comments
Open

Frame state variables #229

frame-lang opened this issue Apr 21, 2024 · 0 comments
Assignees

Comments

@frame-lang
Copy link
Owner

#StatesFC

    -machine-

    $S1
        |e1|
            var s:$ = $S2()
            foo() ? s = $S3() :|
            -> $(s) ^

    $S2 

    $S3 
        |e|
            // ternary expression
            var s:$ = foo() ? $S1() : $S2() :|
            -> $S4(s) ^
    
    // The transpiler should track z as possibly being either S1 or S2
    // and render appropriately.  
    $S4 [z:$] 
        var count = 0

        |f|
            -> $(z) ^ 
        |e|
            count = count + 1 
            count > 4 ? -> $S5 ^ :|
            -> $(z) ^ // transition to self 

    $S5
        var s:$ = nil 

        |e|

            // transition label, exit args, state args, enter args
            s = $S6(-> "foo", <(1), $(2), >(3)) ^
        |e1|
            s.-> = "bar" 
            s.< = (4)
            s.$ = (5)
            s.> = (6) 
            -> $(s) ^

    -actions-

    get_state [x] : $ {
        x ? ^($S7()) : ^($S8()) :| 
    }
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant