#pragma once #include #include #include #include #include #include #include #include #include #include #include "v2script/AiBehaviorGrammar.hpp" #include "v2script/TriggerGrammar.hpp" // Decision Grammar Definitions // namespace ovdl::v2script::grammar { struct DecisionStatement { using potential = fkeyword_rule<"potential", lexy::dsl::p>; using allow = fkeyword_rule<"allow", lexy::dsl::p>; using effect = fkeyword_rule<"effect", lexy::dsl::p>; using ai_will_do = fkeyword_rule<"ai_will_do", lexy::dsl::p>; using helper = dsl::rule_helper; struct List { static constexpr auto rule = dsl::curly_bracketed.opt_list(helper::p | lexy::dsl::p>); static constexpr auto value = lexy::as_list >> construct_list; }; static constexpr auto rule = dsl::p> >> (helper::flags + lexy::dsl::equal_sign + lexy::dsl::p); static constexpr auto value = construct; }; struct DecisionList { static constexpr auto rule = ovdl::dsl::keyword<"political_decisions">(id) >> (lexy::dsl::equal_sign >> lexy::dsl::curly_bracketed.opt_list(lexy::dsl::p)); static constexpr auto value = lexy::as_list; }; struct DecisionFile { // Allow arbitrary spaces between individual tokens. static constexpr auto whitespace = whitespace_specifier | comment_specifier; static constexpr auto rule = lexy::dsl::position + lexy::dsl::terminator(lexy::dsl::eof).opt_list(lexy::dsl::p); static constexpr auto value = lexy::concat >> construct; }; }