104 lines
2.7 KiB
Plaintext
104 lines
2.7 KiB
Plaintext
================================================================================
|
|
Simple Logic
|
|
================================================================================
|
|
|
|
true && false
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(value
|
|
(boolean)))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(boolean)))))))
|
|
|
|
================================================================================
|
|
Logic Sequence
|
|
================================================================================
|
|
|
|
1 == 2 || false
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(value
|
|
(integer)))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(integer)))))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(boolean)))))))
|
|
|
|
================================================================================
|
|
Complex Logic Sequence
|
|
================================================================================
|
|
|
|
(length(suspects) == 1)
|
|
&& (length(rooms) == 1)
|
|
&& (length(weapons) == 1)
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(function_call
|
|
(function_expression
|
|
(identifier
|
|
(built_in_function)))
|
|
(expression
|
|
(identifier))))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(integer)))))
|
|
(logic_operator)
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(function_call
|
|
(function_expression
|
|
(identifier
|
|
(built_in_function)))
|
|
(expression
|
|
(identifier))))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(integer)))))))
|
|
(logic_operator)
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(function_call
|
|
(function_expression
|
|
(identifier
|
|
(built_in_function)))
|
|
(expression
|
|
(identifier))))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(integer)))))))))
|