aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/v2script/AiBehaviorGrammar.hpp
blob: 7fcd13d596f0d0d2b7f5b9b59950c1f4f31e4502 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp>

#include <lexy/callback/forward.hpp>
#include <lexy/dsl.hpp>

#include "ModifierGrammar.hpp"

namespace ovdl::v2script::grammar {
   struct AiBehaviorList {
      static constexpr auto rule = lexy::dsl::list(lexy::dsl::p<FactorStatement> | lexy::dsl::p<ModifierStatement>);

      static constexpr auto value = lexy::as_list<ast::AssignStatementList>;
   };

   struct AiBehaviorBlock {
      static constexpr auto rule = dsl::curly_bracketed.opt(lexy::dsl::p<AiBehaviorList>);

      static constexpr auto value = construct_list<ast::ListValue>;
   };
}