logos calculator example
This commit is contained in:
parent
d974798fcb
commit
0c30f0022d
9 changed files with 414 additions and 22 deletions
39
syntax.akai
39
syntax.akai
|
|
@ -1,3 +1,20 @@
|
|||
class Position:
|
||||
// Properties
|
||||
var int: x
|
||||
var int: y
|
||||
|
||||
// Constructor
|
||||
Position(_x, _y) {
|
||||
x = _x
|
||||
y = _y
|
||||
}
|
||||
|
||||
// Inheritance
|
||||
class Cat derive Animal:
|
||||
/*
|
||||
code goes here
|
||||
*/
|
||||
|
||||
fun helloWorld() {
|
||||
// Variables either dynamically or statically typed
|
||||
var String: test = "I'm a string"
|
||||
|
|
@ -6,4 +23,24 @@ fun helloWorld() {
|
|||
var bar = foo + 10
|
||||
|
||||
print("Hello World " + bar)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Keywords/ Tokens:
|
||||
- class
|
||||
- fun
|
||||
- var
|
||||
- bool
|
||||
- if
|
||||
- else
|
||||
- (
|
||||
- )
|
||||
- {
|
||||
- }
|
||||
- :
|
||||
- +
|
||||
- -
|
||||
- /
|
||||
- *
|
||||
- =
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue