-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTutorial
More file actions
379 lines (304 loc) · 11.6 KB
/
Copy pathTutorial
File metadata and controls
379 lines (304 loc) · 11.6 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
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
📘 DotWeb5 Tutorial
====================
Unit 1: Introduction to the DotWeb5 Programming Language
=======================================================
🔍 Definition
===============
DotWeb5 is a programming language designed for:
- Code security
- Console-based applications
- Learnability and simplicity
- Advanced software development
- Remote X applications
- Web applications
- Machine learning
It is symbolized by a ⭐ star icon and is used with frameworks like Scroll Framework within the DotWeb5 ecosystem.
🧠 About DotWeb5
==================
DotWeb5 was invented by Wilmix Jemin J in 2013, evolving from Java and DOTWEB3.0. Earlier versions of Java (JDK 1.7 and JDK 1.8) were vulnerable to source code extraction using tools like JAD decompiler.
We are grateful to our friends, including Venkat, GitHub, and many others, for their support in this journey.
⚠️ Limitations of Java and C#
==============================
- Java .class files are easily decompiled using tools like JAD.
- This makes Java less secure for compiler development.
- DotWeb5 was created to overcome these limitations and is ideal for building data structures and compilers.
- It accepts .java7 files and translates them into DotWeb5 class files, which are incomprehensible to hackers.
- DotWeb5 is not focused on GUI development (e.g., Java Swing).
❓ Can You Build a Compiler Like Java?
=======================================
Yes. You can use Java to build a Java-like compiler or any other compiler. While some may criticize this approach, it is valid according to the principles of compiler design.
The same logic applies to building compilers for C or other languages.
However, I personally avoid GUI frameworks like Java Swing or J2EE due to misinformation spread by competitors or malicious actors, which could harm my products.
🛠️ My Compiler Design Journey
==============================
- At age 21, I built a compiler using VC++.
- Later, I developed a mini compiler in Java.
🚀 Why DotWeb5 Is More Advanced Than Other Languages
====================================================
- DotWeb5 and Java/J2EE are both fluent and expressive, like natural English.
- DotWeb5 helps reduce lines of code, improving productivity.
- Both follow camelCase conventions and integrate beautifully with IDEs like IntelliJ IDEA.
- The creator of DotWeb5 is not interested in robotics, as it may replace human roles.
- We support AI, but not robots.
📘 DotWeb5 Programming Modules
==============================
DotWeb5 is divided into two modules:
- DotWeb5 – Module 1
- DotWeb5 – Module 2
🔍 About DotWeb5 Modules
=========================
DotWeb5 keywords are designed to resemble those in Java, making it easy for Java professionals and companies to learn and adopt. While most syntax is familiar, DotWeb5 introduces several attractive and unique constructs.
DotWeb5 is used in:
- Console applications
- Web applications
- Machine learning
- Data science
- Remote X applications
Module 1 is primarily used by Java and DotWeb5 professionals. The Remote X Application module will be released after the Machine Learning and Data Science modules are finalized.
🔐 DotWeb5 Reserved Keywords – Module 1
========================================
DotWeb5 includes a set of reserved keywords that cannot be used as variable names, method names, class names, or other identifiers.
✅ Keyword Overview
===================
<Pre>
<code>
<table bgcolor=black>
<JAVA7> </JAVA7> abstract assert
boolean break byte case
<CATCH> char <CLASS> continue
default do double else
enum <--- final <FINALLY>
float for if -->
<IMPORT> instanceof int interface
long native new <PACKAGE>
private protected public return
short <SHARED> <SUPER> switch
synchronized <IS> throw throws
transient <TRY> void volatile
while
</table>
</code>
</pre>
🧪 Sample Program: testme.java7
<Pre>
<code>
<table bgcolor=black>
<JAVA7>
public <CLASS> testme
//--> Runnable
<--- <Thread>
<%
public <SHARED> int sum() {
int b;
return (2 + 3);
}
public synchronized void <RUN> {
<TRY> {
<PRINTLINE>("Under Weight is less than 15. Your health is worst = " + sum());
<Thread>.sleep(1000);
throw new Exception();
}
<CATCH> (Exception e) {
<PRINTLINE>("" + e);
}
}
<MAIN>
<%
<TRY> {
testme t <NEW> testme();
t.start();
testme t1 <NEW> testme();
t1.start();
int value = 15;
if (value >= 15) {
assert value >= 25 : "Underweight";
<PRINTLINE>("Value is " + value);
} else {
<PRINTLINE>("Under Weight is less than 15");
}
}
<CATCH> (Exception e) {
<PRINTLINE>("" + e);
}
<FINALLY> {
<PRINTLINE>("Note: Please enter accurately");
}
%>
</JAVA7>
</table>
</code>
</Pre>
🖥️ Output
==========
<Pre>
<code>
<table bgcolor=black>
Value is 15
Under Weight is less than 15. Your health is worst = 5
Under Weight is less than 15. Your health is worst = 5
Note: Please enter accurately
java.lang.Exception
java.lang.Exception
</table>
</code>
</Pre>
📘 DotWeb5 Reserved Keywords – Module 2
========================================
DotWeb5 includes a set of reserved keywords that cannot be used as variable names, method names, class names, or other identifiers. In Module 2, developers can build prototype software such as .exe files for console-based DotWeb5 programs. This module is designed to be familiar to DotWeb5 and Java/J2EE professionals.
🔐 Keyword Reference (Total: 50 Keywords)
=========================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DotWeb5 Reserved Keywords – Module 2</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
h1 {
color: #333;
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
background-color: #fff;
}
th, td {
border: 1px solid #ccc;
padding: 10px;
text-align: left;
vertical-align: top;
}
th {
background-color: #e0e0e0;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
caption {
caption-side: top;
font-size: 1.2em;
margin-bottom: 10px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>DotWeb5 Reserved Keywords – Module 2</h1>
<table>
<caption>Keyword Reference Table</caption>
<tr>
<th>Keyword</th>
<th>Description</th>
</tr>
<tr><td><ABSTRACT></td><td>Declares an abstract class</td></tr>
<tr><td><BREAK></td><td>Exits a loop</td></tr>
<tr><td><CASE></td><td>Used as an option in switch statements</td></tr>
<tr><td><CATCH></td><td>Handles exceptions</td></tr>
<tr><td><CLASS></td><td>Declares a class (collection of objects)</td></tr>
<tr><td><CONTINUE></td><td>Skips to the next loop iteration</td></tr>
<tr><td><DO> <WHILE></td><td>Creates a do-while loop</td></tr>
<tr><td><ELSE></td><td>Follows an <IF> condition</td></tr>
<tr><td><ENUM></td><td>Declares a group of constants</td></tr>
<tr><td><FINALLY></td><td>Executes regardless of exceptions</td></tr>
<tr><td><FOR></td><td>Creates a for loop</td></tr>
<tr><td><FOREACH></td><td>Iterates over collections (arrays, lists, sets)</td></tr>
<tr><td><GOTO></td><td>Jumps to labeled code</td></tr>
<tr><td><IF></td><td>Conditional logic</td></tr>
<tr><td>is</td><td>Checks object type compatibility</td></tr>
<tr><td><IN></td><td>Checks if an element exists</td></tr>
<tr><td><OBJECT></td><td>Represents an instance of a class</td></tr>
<tr><td><INTERFACE></td><td>Enables multiple inheritance</td></tr>
<tr><td><DEFAULT></td><td>Default case in switch statements</td></tr>
<tr><td><BASE></td><td>Calls base class methods</td></tr>
<tr><td><LOCK></td><td>Ensures thread-safe execution</td></tr>
<tr><td><PACK></td><td>Declares a package (namespace)</td></tr>
<tr><td><NEW></td><td>Instantiates a class</td></tr>
<tr><td><OPERATOR></td><td>Used for operator overloading</td></tr>
<tr><td><READONLY></td><td>Declares read-only variables</td></tr>
<tr><td><RET></td><td>Returns a value</td></tr>
<tr><td><SIZEOF></td><td>Returns memory size of a variable</td></tr>
<tr><td><TYPEOF></td><td>Gets the type of an object</td></tr>
<tr><td>void</td><td>Declares a method with no return value</td></tr>
<tr><td>Shared</td><td>Calls static methods without creating objects</td></tr>
<tr><td><STR></td><td>Represents a string</td></tr>
<tr><td><STRUCT></td><td>Declares a structured record</td></tr>
<tr><td><SWITCH></td><td>Selects among multiple code blocks</td></tr>
<tr><td><IS></td><td>Refers to the current object</td></tr>
<tr><td><TRY></td><td>Begins a try block</td></tr>
<tr><td><THROW></td><td>Throws an exception</td></tr>
<tr><td><USE></td><td>Imports DotWeb5 libraries or packages</td></tr>
<tr><td><VIRTUAL></td><td>Declares methods that can be overridden</td></tr>
<tr><td><VOLATILE></td><td>Enables synchronized variable access across threads</td></tr>
<tr><td><WHILE></td><td>Creates a while loop</td></tr>
<tr><td><JAVA7></td><td>Loads I/O packages for Java/J2EE compatibility</td></tr>
<tr><td><JAVA></td><td>Loads I/O packages for console/web apps</td></tr>
<tr><td><HEAPJ7></td><td>Stores large data objects to prevent memory overflow</td></tr>
<tr><td><CONVERTARRAYLIST></td><td>Converts strings to ArrayList</td></tr>
<tr><td><OVERRIDE></td><td>Overrides parent class methods</td></tr>
<tr><td>bool</td><td>Boolean type (true/false)</td></tr>
<tr><td>get / set</td><td>Accessors for retrieving and assigning values</td></tr>
<tr><td><OAKJAVA7SECURITY></td><td>Secures DotWeb5 executable files</td></tr>
</table>
</body>
</html>
💎 Diamond Modules
===================
DotWeb5 Module 1 and Module 2 together form the Diamond Module, which supports .java7 programs. When compiled using the WEBC7 compiler, a .java7 file will generate:
- .jclass file
- .exe file
WEBC7 is an open-source compiler available for DotWeb5 professionals to practice and build secure applications.
🔐 Security Module
===================
A third module focused on security is available in the DotWeb5 Enterprise Edition. It includes advanced features for protecting executable files and managing secure environments.
🧪 Example: Operator Overloading and Structure in DotWeb5
==========================================================
<Pre>
<code>
<table bgcolor=black>
<CLASS> Calculator
{
int a = 5;
int b = 10;
<OPERATOR> + (Calculator c1, Calculator c2)
{
Calculator result = <NEW> Calculator();
result.a = c1.a + c2.a;
result.b = c1.b + c2.b;
<RET> result;
}
<STRUCT> display()
{
<PRINTLINE>("Sum A: " + a);
<PRINTLINE>("Sum B: " + b);
}
}
<MAIN>
{
Calculator obj1 = <NEW> Calculator();
Calculator obj2 = <NEW> Calculator();
Calculator obj3 = obj1 + obj2;
obj3.display();
}
</table>
</code>
</Pre>
🖥️ Output
==========
<Pre>
<code>
<table bgcolor=black>
Sum A: 10
Sum B: 20
</table>
</code>
</Pre>
Note:
=====
This Dotweb5.0 tutorial is under construction