-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
141 lines (129 loc) · 4.17 KB
/
index.html
File metadata and controls
141 lines (129 loc) · 4.17 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
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<meta name="description" content="">
<meta property="og:title" content="">
<meta property="og:type" content="">
<meta property="og:url" content="">
<meta property="og:image" content="">
<meta property="og:image:alt" content="">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="icon.png">
<link rel="manifest" href="site.webmanifest">
<meta name="theme-color" content="#fafafa">
</head>
<body>
<!-- Add your site or application content here -->
<p>Welcome to my custom MultiScript(A programming language developed for this project) compiler. It is named this because it will be able to be compiled to many different languages.<br>
Currently, it only has basic features and can only be compiled to Javascript, Python, and C</p>
<table>
<tr>
<th>Implemented Features</th>
<th>Planned Features</th>
</tr>
<tr>
<td>
<ul>
<li>Variables</li>
<li>Arithmatic Operators (+, -, /, *)</li>
<li>Logical Operators (==, <, >, ||, &&, !, <=, >=, !=)</li>
<li>If statements</li>
<li>Functions</li>
<li>Printing</li>
<li>Compiling to Javascript</li>
<li>Compiling to Python</li>
<li>Compiling to C</li>
<li>While Loops</li>
<li>/Macros</li>
<li>/Language targeted code</li>
</ul>
</td>
<td>
<ul>
<li>/Better Error Handling</li>
<li>/?(1:1)struct</li>
<li>/?(1:2)Arrays</li>
<li>Objects</li>
<li>Classes</li>
<li>For loops</li>
<li>Member access</li>
<li>More complete semantic analysis</li>
<li>Add Type Checking (Partially implemented but not enabled)</li>
<li>Valid code checking (Partially implemented but not enabled)</li>
</ul>
</td>
</tr>
</table>
<p>Scroll down to view programming guide</p>
<label for="langauge">Choose a target langauge:</label>
<select id="langauge" name="langauge">
<option value="C">C</option>
<option value="Python">Python</option>
<option value="Javascript">Javascript</option>
</select>
<button id="run">Compile</button>
</br>
<div id="lang">
<span>
<p>Code</p>
<textarea id="code" rows="30px" cols="75px" ></textarea>
</span>
<span>
<p>Output</p>
<textarea id="output" rows="30px" cols="50px" ></textarea>
</span>
<script src="js/SemanticAnalyzer.js"></script>
<script src="js/CustomImplementation.js"></script>
<script src="js/Parser.js"></script>
<script src="js/LanguageCodeGenerator.js"></script>
<script src="js/Test.js"></script>
</div>
<p>To create a variable called <variable name> do.<br><code>var <type> <variable name></code><br>
To set the value of a variable do.<br><code><variable name> = <value></code><br>
You also can create and assign a variable at the same time<br><code>var <type> <variable name> = <value></code></p>
<br>
<p>Here are a few examples</p>
<code>//Printing a + b Outputs 10<br>var int a = 3;<br>var int b = 7;<br>println a + b;</code>
<br><br>
<code>
//If statement Outputs 12<br>
var int a = 3; var int b = 4;<br>
if (a < b) {<br>
println a*b;<br>
}
</code>
<p>Strings</p>
<code>//Printing "Hello World!"<br>
var string message = "Hello World!";<br>
println "Hello World!";<br>
println message;
</code>
<br><br>
<code>
//Methods also work //Method returns 5<br>
func int add(int a, int b){<br>
return a + b;<br>
}<br>
a(3, 2);
</code>
<br><br>
<code>
//Python only code<br>
@target("python") println "Hello World!";
</code>
<br><br>
<code>
//Macros inject code into where they are used<br>
macro example{<br>
println test;<br>
}<br>
var string test = "Hello";<br>
#example
</code>
</body>
</html>