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-10-31 13:31:10 +00:00
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(while
|
2023-10-18 21:52:56 +00:00
|
|
|
(expression
|
2023-10-31 13:31:10 +00:00
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
2023-10-18 21:52:56 +00:00
|
|
|
(expression
|
2023-10-31 17:04:22 +00:00
|
|
|
(function_call
|
2023-10-31 19:21:13 +00:00
|
|
|
(built_in_function
|
|
|
|
(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-10-31 13:31:10 +00:00
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
2023-10-31 09:51:37 +00:00
|
|
|
(statement
|
2023-10-31 13:31:10 +00:00
|
|
|
(while
|
2023-10-31 10:21:21 +00:00
|
|
|
(expression
|
2023-10-31 13:31:10 +00:00
|
|
|
(logic
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(logic_operator)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
2023-10-31 19:21:13 +00:00
|
|
|
(integer))))))))))))))
|