2023-10-18 21:52:56 +00:00
|
|
|
==================
|
|
|
|
While Loop
|
|
|
|
==================
|
|
|
|
|
|
|
|
while true {
|
|
|
|
(output "This is a bad idea...")
|
|
|
|
}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(root
|
2023-10-31 09:51:37 +00:00
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(statement
|
2023-10-18 21:52:56 +00:00
|
|
|
(expression
|
2023-10-31 09:51:37 +00:00
|
|
|
(tool
|
2023-10-18 21:52:56 +00:00
|
|
|
(expression
|
2023-10-31 09:51:37 +00:00
|
|
|
(value
|
|
|
|
(string)))))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
==================
|
2023-10-31 09:51:37 +00:00
|
|
|
Nested While Loop
|
2023-10-18 21:52:56 +00:00
|
|
|
==================
|
|
|
|
|
2023-10-31 09:51:37 +00:00
|
|
|
while true {
|
|
|
|
x = 4
|
|
|
|
while x > 0 {
|
|
|
|
x -= 1
|
|
|
|
}
|
2023-10-18 21:52:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(root
|
2023-10-31 09:51:37 +00:00
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
2023-10-18 21:52:56 +00:00
|
|
|
(expression
|
|
|
|
(value
|
2023-10-31 09:51:37 +00:00
|
|
|
(integer)))
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(logic
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(logic_operator)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))
|
2023-10-18 21:52:56 +00:00
|
|
|
(statement
|
2023-10-31 09:51:37 +00:00
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))))))))))
|