-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
112 lines (101 loc) · 3.18 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Synchronous nano-go process analyzer</title>
<script src="jsbridge.js"></script>
<!-- CodeMirror -->
<link rel="stylesheet" href="codemirror-5.5.0/lib/codemirror.css">
<link rel="stylesheet" href="codemirror-5.5.0/theme/eclipse.css">
<link rel="stylesheet" href="codemirror-5.5.0/addon/lint/lint.css">
<link rel="stylesheet" href="codemirror-5.5.0/doc/docs.css">
<script src="codemirror-5.5.0/lib/codemirror.js"></script>
<script src="codemirror-5.5.0/addon/lint/lint.js"></script>
<script src="codemirror-5.5.0/addon/selection/active-line.js"></script>
<script src="codemirror-5.5.0/mode/go/go.js"></script>
<!-- <script src="lib/codemirror-3.24/mode/clike/clike.js"></script> -->
<style>
.CodeMirror {
font-size: 12pt;
height: auto;
}
.CodeMirror-scroll {
overflow-y: hidden;
// overflow-x: auto;
}
</style>
</head>
<body>
<h1>Synchronous Nano-Go Process Analyzer</h1>
<div style="padding: 20px; border: 1px solid #000000; width: 95%;">
<!-- Left-hand side editor -->
<div style="display:inline-block; vertical-align:top; width:50%;">
<h3>Input processes:</h3>
<p>
<form align="left" style="overflow:auto;">
<textarea id="texteditor" name="texteditor">package main
func main() {
ch := make(chan int);
go func() { ch <-42 }()
var x int;
x = <- ch;
print(x)
} </textarea>
</form>
</p>
<p>
<button type="button" id="analyze">Analyze</button>
<select id="prog-select">
<option value="send-recv">send-receive</option>
<option value="nondet">non-determinism</option>
<option value="order">order</option>
<option value="constant">constant</option>
<option value="deadlock-simple">deadlock-simple</option>
<option value="deadlock-gopherlyzer">deadlock-gopherlyzer</option>
<option value="chains">chains</option>
<option value="loop">loop</option>
<option value="loopext">loopext</option>
<option value="nontermination">non-termination</option>
</select>
</p>
</div>
<div style="display:inline-block; vertical-align:top; padding: 0px 50px; width:40%;">
<h3>Supported syntax:</h3>
<pre>
e ::= i | ( e ) | x | - e
| e + e | e - e | e * e | e % e
b ::= true | false | ! b | ( b )
| e == e | e <= e | e < e | b && b
recvstmt ::= x = <- ch | <- ch
sendstmt ::= ch <- e
stmt ::= x = e
| recvstmt
| sendstmt
| if b block else block
| for [test] block
| select { selcase* }
| print(e)
stmts ::= stmt [;]
| stmt ; stmts
| { stmts }
block ::= { stmts } | {}
selcase ::= case recvstmt : [stmts]
| case sendstmt : [stmts]
chdecl ::= x := make(chan int)
func ::= go func() { [body] } ()
body ::= var x int [;] body
| stmts
prog ::= package main
func main() { chdecl+ func+ body }
</pre>
</div>
<div style="clear:both"></div>
<p>
<b>Result</b>: <i><div id="result"> </div></i>
</p>
</div>
<script src="index.js"></script>
</body>
</html>