+
+# swap [container] [with] id <window>
+# swap [container] [with] con_id <con_id>
+# swap [container] [with] mark <mark>
+state SWAP:
+ 'container'
+ ->
+ 'with'
+ ->
+ mode = 'id', 'con_id', 'mark'
+ -> SWAP_ARGUMENT
+
+state SWAP_ARGUMENT:
+ arg = string
+ -> call cmd_swap($mode, $arg)
+
+state TITLE_FORMAT:
+ format = string
+ -> call cmd_title_format($format)
+
+# bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
+state BAR:
+ bar_type = 'hidden_state'
+ -> BAR_HIDDEN_STATE
+ bar_type = 'mode'
+ -> BAR_MODE
+
+state BAR_HIDDEN_STATE:
+ bar_value = 'hide', 'show', 'toggle'
+ -> BAR_W_ID
+
+state BAR_MODE:
+ bar_value = 'dock', 'hide', 'invisible', 'toggle'
+ -> BAR_W_ID
+
+state BAR_W_ID:
+ bar_id = word
+ ->
+ end
+ -> call cmd_bar($bar_type, $bar_value, $bar_id)