-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
218 lines (170 loc) · 5.31 KB
/
index.html
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Fsmgen by mrkev</title>
<link href='https://fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/github-light.css">
<meta name="viewport" content="width=device-width">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pegjs/0.9.0/peg.min.js"></script>
<script src="./js/viz.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/is_js/0.8.0/is.js"></script>
<script src="download2.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.18.2/codemirror.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.18.2/codemirror.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.18.2/addon/selection/active-line.js"></script>
<style type="text/css">.CodeMirror {line-height: 1.1em; width: 100%,; height: 100%;}</style>
<!-- load MUI -->
<!-- <link href="//cdn.muicss.com/mui-0.9.1/css/mui.min.css" rel="stylesheet" type="text/css" /> -->
<style>
/**
* MUI Tabs module
*/
.mui-tabs__bar {
list-style: none;
padding-left: 0;
margin-bottom: 0;
background-color: transparent;
white-space: nowrap;
overflow-x: auto;
padding-bottom: 14px;
}
.mui-tabs__bar > li {
display: inline-block;
width:auto;
float:auto;
border-right:none;
height:auto;
}
.mui-tabs__bar > li > a {
display: block;
white-space: nowrap;
text-transform: uppercase;
font-weight: 500;
color: rgba(0, 0, 0, 0.87);
cursor: default;
height: 36px;
line-height: 40px;
padding-left: 12px;
padding-right: 12px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.mui-tabs__bar > li > a:hover {
text-decoration: none;
}
.mui-tabs__bar > li.mui--is-active {
border-bottom: 2px solid #2196F3;
}
.mui-tabs__bar > li.mui--is-active > a {
color: #2196F3;
}
.mui-tabs__bar.mui-tabs__bar--justified {
display: table;
width: 100%;
table-layout: fixed;
}
.mui-tabs__bar.mui-tabs__bar--justified > li {
display: table-cell;
}
.mui-tabs__bar.mui-tabs__bar--justified > li > a {
text-align: center;
padding-left: 0px;
padding-right: 0px;
}
.mui-tabs__pane {
display: none;
height: 100%;
overflow: scroll;
}
.mui-tabs__pane.mui--is-active {
display: block;
}
#saves { list-style-type: none; padding: 0px 12px;}
#saves li button, #saves li a { font-family: monospace; }
</style>
<script src="//cdn.muicss.com/mui-0.9.1/js/mui.min.js"></script>
<style>
svg { margin: 20px; }
textarea { width: 100%; }
.code_error { background-color: #f93; }
</style>
</head>
<body>
<div class="wrapper">
<!--******************************** HEADER. ********************************-->
<header>
<h1>Fsmgen</h1>
<ol class="mui-tabs__bar">
<li class="mui--is-active"><a data-mui-toggle="tab" data-mui-controls="pane-default-1">Quickstart</a></li>
<li><a data-mui-toggle="tab" data-mui-controls="pane-default-2">Saved</a></li>
</ol>
<div class="mui-tabs__pane mui--is-active" id="pane-default-1">
<p>Design FSMs using a DSL. Here's how;</p>
<h3>Define a state:</h3>
<pre>state q0</pre>
<h3>Connect the state to other states:</h3>
<pre>
state q0
state q1 =
| back -> q0</pre>
<h3>Define an initial state, and some final states:</h3>
<pre>
initial state q0 =
| _ -> q0
| move -> q1
| jump -> q2
state q1 =
| back -> q0
| stay -> q1
| move -> q2
final state q2 =
| stay -> q2
| restart -> q0</pre>
<p class="view"><a href="https://github.com/mrkev/fsmgen">View the Project on GitHub <small>mrkev/fsmgen</small></a></p>
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</div>
<div class="mui-tabs__pane" id="pane-default-2">
<ol id="saves"></ol>
</div>
<div class="mui-tabs__pane" id="pane-default-3">Pane-3</div>
</header>
<!--********************************* BODY. *********************************-->
<section>
<textarea name="fsm_src" id="fsm_src" rows="16">
initial state q0 =
| stay -> q0
| move -> q1
| jump -> q2
state "middle state" as q1 =
| back -> q0
| stay -> q1
| move -> q2
final state q2 =
| stay -> q2
| restart -> q0
</textarea>
<br>
<pre id="errors"></pre><button id="parse_button">Render</button>
<span id="downloads"></span>
<div id="code"></div>
<div id="d3out"></div>
<div id="svg-wrapper"></div>
<script src="util.js"></script>
<script src="typecheck.js"></script>
<script src="main.js"></script>
</section>
<!--******************************** FOOTER. ********************************-->
<footer>
</footer>
</div>
</body>
</html>