-
Notifications
You must be signed in to change notification settings - Fork 2
/
_table.go.erb
46 lines (39 loc) · 1.05 KB
/
_table.go.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package vte
// THIS FILE WAS AUTO-GENERATED. DO NOT MODIFY.
const (
<% state_names.each.with_index(0) do |name, i| -%>
<%= name %>State State = <%= i %>
<% end -%>
<% action_names.each.with_index(0) do |name, i| -%>
<%= name %>Action Action = <%= i %>
<% end -%>
)
var (
stateNames = []string{
<% state_names.each do |name| -%>
"<%= name %>State",
<% end -%>
}
stateTable = [][]byte{
<% table.each.with_index do |actions, i| -%>
{ //State <%= state_names[i] %>State = <%= i %>
<% actions.each.with_index do |act, j| -%>
<% if act == 0 -%>
<%= act %>, // <%= "%02X" % j %>
<% else -%>
<%= act[0]%>State | (<%= act[1]%>Action << 4), // <%= "%02X" % j %>
<% end -%>
<% end -%>
},
<% end -%>
}
exitActions = []byte {
<% state_names.each.with_index do |name, i| -%>
<% if exit_actions[i] -%>
<%= exit_actions[i] %>Action, //<%= name %>State
<% else -%>
0, //<%= name %>State
<% end -%>
<% end -%>
}
)