Skip to content

Instantly share code, notes, and snippets.

@jdmota
Last active November 22, 2021 13:09
Show Gist options
  • Save jdmota/85683e518c56676612e4ba63eaa9b3f2 to your computer and use it in GitHub Desktop.
Save jdmota/85683e518c56676612e4ba63eaa9b3f2 to your computer and use it in GitHub Desktop.
Select := id | id "." Select
JavaType := Select | JavaType "[]"
Package := "package" Select ";"
Import := "import" "static"? Select ("." "*")? ";"
Destination := id | State | DecisionState
Decision := id ":" ( id | State )
DecisionState := "<" Decision ( "," Decision )* ">"
Arguments := "(" JavaType ( "," JavaType )* ")"
Method := JavaType id Arguments ":" Destination
Methods := Method ( "," Method )*
State := "{" Methods ( "," "drop" ":" "end" )? "}"
NamedState := id "=" State
Protocol := "typestate" id "{" NamedState* "}"
Start := Package? Import* Protocol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment