mirror of
https://git.fddl.dev/fddl/fddl.dev.git
synced 2024-12-25 15:10:26 +00:00
55 lines
684 B
Text
55 lines
684 B
Text
fddl examples.fddl
|
|
Func
|
|
Identifier("main")
|
|
LeftParen
|
|
RightParen
|
|
LeftBrace
|
|
Comment(" print statement")
|
|
Print
|
|
LeftParen
|
|
StringLiteral("hello, world in fddl")
|
|
RightParen
|
|
Semicolon
|
|
Comment(" variable declaration")
|
|
Let
|
|
Identifier("y")
|
|
Equal
|
|
Number(5.0)
|
|
Semicolon
|
|
Comment(" if statement")
|
|
If
|
|
LeftParen
|
|
Identifier("x")
|
|
Greater
|
|
Number(10.0)
|
|
RightParen
|
|
LeftBrace
|
|
Print
|
|
LeftParen
|
|
StringLiteral("x is greater than 10")
|
|
RightParen
|
|
Semicolon
|
|
RightBrace
|
|
Comment(" while loop")
|
|
While
|
|
LeftParen
|
|
Identifier("x")
|
|
Less
|
|
Number(100.0)
|
|
RightParen
|
|
LeftBrace
|
|
Print
|
|
LeftParen
|
|
Identifier("x")
|
|
RightParen
|
|
Semicolon
|
|
Let
|
|
Identifier("x")
|
|
Equal
|
|
Identifier("x")
|
|
Plus
|
|
Number(1.0)
|
|
Semicolon
|
|
RightBrace
|
|
RightBrace
|
|
EOF
|