==================
Basic behavior tree
==================

behavior BasicNeeds {
    then {
        CheckHunger
        if(hungry) { EatFood }
    }
}

---

(source_file
  (declaration
    (behavior_declaration
      name: (identifier)
      body: (behavior_body
        root: (behavior_node
          (sequence_node
            (behavior_node
              (action_node
                (identifier)))
            (behavior_node
              (if_decorator_node
                condition: (expression
                  (primary_expression
                    (path
                      (path_segments
                        (identifier)))))
                child: (behavior_node
                  (action_node
                    (identifier)))))))))))

==================
Behavior with selector
==================

behavior Combat {
    choose {
        if(has_weapon) { Attack }
        Flee
    }
}

---

(source_file
  (declaration
    (behavior_declaration
      name: (identifier)
      body: (behavior_body
        root: (behavior_node
          (selector_node
            (behavior_node
              (if_decorator_node
                condition: (expression
                  (primary_expression
                    (path
                      (path_segments
                        (identifier)))))
                child: (behavior_node
                  (action_node
                    (identifier)))))
            (behavior_node
              (action_node
                (identifier)))))))))

==================
Behavior with repeat
==================

behavior Patrol {
    repeat(5) {
        WalkPath
    }
}

---

(source_file
  (declaration
    (behavior_declaration
      name: (identifier)
      body: (behavior_body
        root: (behavior_node
          (repeat_node
            params: (integer)
            child: (behavior_node
              (action_node
                (identifier)))))))))
