-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
192 lines (141 loc) · 5.16 KB
/
index.html
File metadata and controls
192 lines (141 loc) · 5.16 KB
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
<!DOCTYPE html>
<html>
<head>
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./main.css">
<link rel="shortcut icon" href="./logo/logo.png" type="image/x-icon" />
<title>Compiler | LL(1) Parser</title>
</head>
<body>
<div class='entire'>
<span class='credits'>By Erfan Azary</span>
<span class='logo'><img src='./logo/logo.png' /> <BR> Compiler</span>
<div class="main transition-all">
<div class="col">
<div class="header">Grammar</div>
<textarea name="grammar" class='grammar' placeholder="Grammar Goes Here...">
main_program -> program id ( identifier_list ) ; declarations subprogram_declarations compound_statement .
identifier_list -> id identifier_list_1
identifier_list_1 -> , id identifier_list_1|%
declarations -> declarations_1
declarations_1 -> var identifier_list : type ; declarations_1|%
type -> standard_type | array [ num .. num ] of type
standard_type -> integer | real | string
subprogram_declarations -> subprogram_declarations_1
subprogram_declarations_1 -> subprogram_declaration ; subprogram_declarations_1|%
subprogram_declaration -> subprogram_head declarations compound_statement
subprogram_head -> function id arguments : standard_type ; | procedure id arguments ;
arguments -> ( parameter_list ) | %
parameter_list -> identifier_list : type parameter_list_1
parameter_list_1 -> ; identifier_list : type parameter_list_1| %
compound_statement -> begin optional_statements end
optional_statements -> statement_list | %
statement_list -> statement statement_list_1
statement_list_1 -> ; statement statement_list_1|%
statement -> id statement_1 | compound_statement | if expression then statement else statement | while expression do statement
statement_1 -> [ expression ] tail := expression | := expression | ( expression_list ) | %
tail -> [ expression ] tail | %
expression_list -> expression expression_list_1
expression_list_1 -> , expression expression_list_1|%
expression -> simple_expression expression_1
expression_1 -> relop simple_expression |%
simple_expression -> term simple_expression_1
simple_expression_1 -> addop term simple_expression_1|%
term -> factor term_1
term_1 -> mulop factor term_1|%
factor -> id factor_1 | num | ( expression ) | not factor
factor_1 -> tail | ( expression_list )
addop -> + | -
mulop -> * | /
relop -> < | > | = | <= | >= | !=
</textarea>
</div>
<div class="col">
<div class="header">Code</div>
<textarea name="code" class='code' placeholder="Code Goes Here...">
program Lesson1Program1 (o);
var v1,v2 ,v3:integer ;
var v4,v5,v6,v7:array[2 ..10] of string;
var v8,v9,v10:string;
var v11,v12,v13:real;
function f1(af,bf,cf:integer;df,ef:string;ff,gf:array[10..19] of integer):real;
begin
end;
procedure p12proc1(g:array[0..20] of string);begin end;
function f2:integer;
begin
end;
procedure p2p5prsc12q(f: integer );
begin
end;
function f3(hf,jf,kf:real):string;begin end ;
begin
if(a>b)
then
c:=b
else
c:=123
end.
</textarea>
<button class="Parse" style="border-bottom:1px solid rgb(200,200,200);">Real Time Parse</button>
<button class="Parse">Animated Parse</button>
</div>
<div class="col full log-col">
<div class="header">Log</div>
<div class="log"></div>
<button class="clear" style="background-color:rgb(140,120,120);">Clear Log</button>
</div>
<div class="col full first-follow-col">
<div class="header">First & Follow</div>
<div class='tables first-follow'>
</div>
<button class="first-follow" style="background-color:rgb(120,140,120);">Get First & Follow</button>
</div>
<div class="col full ll1-col">
<div class="header">LL 1 Table</div>
<div class='tables ll1'>
</div>
<button class="draw-table" style="background-color:rgb(120,140,120);">Draw Table</button>
</div>
<div class="col full stack-col">
<div class="header">Stack</div>
<div class="svg-container">
<svg class='stack' xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
</svg>
</div>
</div>
<div class="col full symbols-col">
<div class="header">Symbol Table</div>
<div class='tables symbols'>
</div>
<button class="draw-table" style="background-color:rgb(120,140,120);">Draw Table</button>
</div>
</div>
<div class="animation-control transition">
<div class="options">
<span class="ratio">
<span class="num">-</span>
<span class="container">
<span class="meele"></span>
<button></button>
</span>
<span class="num">+</span>
</span>
<span class="buttons">
<button onclick='stopAnimation();'><img src="./icons/stop.png"></button>
<button onclick='handleAnimationPause();'><img src="./icons/pause.png"></button>
</span>
</div>
<div class="trace">
<span>
<span class="played"></span>
</span>
</div>
</div>
<span class='main-log'></span>
</div>
</body>
<script language="javascript" type='text/javascript' src='./jquery-3.1.1.min.js'></script>
<script language="javascript" type='text/javascript' src='./main.js'></script>
</html>