Skip to content

Commit 97fe43a

Browse files
committed
Updated readme.md
1 parent e8453b5 commit 97fe43a

File tree

1 file changed

+37
-24
lines changed

1 file changed

+37
-24
lines changed

README.md

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,61 @@
22
Basic compiler written in java
33

44
How to run this :-
5+
56
Using Eclipse -
7+
68
Import project into eclipse and edit code in Compiler/code.pc and compile Main.java to execute
79

810
This includes basic operations like +(addition), -(subtraction), *(multiplication), /(division)
911

1012
Data types and variables
13+
1114
Example :-
12-
For integer
13-
a = 4
1415

15-
For float
16-
a=4.2
16+
For integer,
17+
18+
a = 4
19+
20+
For float,
21+
22+
a=4.2
1723

18-
For String
19-
a="Hello World"
24+
For string,
25+
26+
a="Hello World"
2027

2128
Implicit Functions
29+
2230
1.print() -- print function
23-
print("Hello World")
24-
Result :- Hello World
31+
32+
print("Hello World")
33+
Result :- Hello World
2534

2635
2.println() -- println function --> prints the data then move to the newline
27-
println(3+5.3)
28-
Result :- 8.3
36+
37+
println(3+5.3)
38+
Result :- 8.3
2939

3040
String Manipulation : -
41+
3142
1.String concatenation
32-
str="Hello " + 4.5
33-
println(str)
34-
Result :- Hello 4.5
43+
44+
str="Hello " + 4.5
45+
println(str)
46+
Result :- Hello 4.5
3547
OR
36-
str="Hello "
37-
str=str+"World "+4
38-
println(str)
39-
Result :- Hello World 4
48+
str="Hello "
49+
str=str+"World "+4
50+
println(str)
51+
Result :- Hello World 4
4052

4153
2.String Repeat
42-
str="Hello"*3
43-
println(str)
44-
Result :- HelloHelloHello
54+
55+
str="Hello"*3
56+
println(str)
57+
Result :- HelloHelloHello
4558
OR
46-
str="hello"
47-
str=str*4
48-
println(str)
49-
Resutl :- hellohellohellohello
59+
str="hello"
60+
str=str*4
61+
println(str)
62+
Resutl :- hellohellohellohello

0 commit comments

Comments
 (0)