2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
While Loop
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
while true {
|
|
|
|
(output "This is a bad idea...")
|
|
|
|
}
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-11-30 00:23:42 +00:00
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-31 09:51:37 +00:00
|
|
|
Nested While Loop
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 13:31:10 +00:00
|
|
|
while (true) {
|
|
|
|
while (x > 0) {
|
2023-10-31 09:51:37 +00:00
|
|
|
x -= 1
|
|
|
|
}
|
2023-10-18 21:52:56 +00:00
|
|
|
}
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(logic
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(logic_operator)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))))))))))
|