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 10:21:21 +00:00
|
|
|
(integer)))))
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(logic
|
2023-10-31 09:51:37 +00:00
|
|
|
(expression
|
2023-10-31 10:21:21 +00:00
|
|
|
(identifier))
|
|
|
|
(logic_operator)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
2023-10-18 21:52:56 +00:00
|
|
|
(statement
|
2023-10-31 10:21:21 +00:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))))))))
|