File: PlanetEnvironmentValueRefParser.cpp

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (30 lines) | stat: -rw-r--r-- 982 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "ValueRefParser.h"

#include "EnumParser.h"
#include "EnumValueRefRules.h"

#include "../universe/Species.h"

namespace parse { namespace detail {
    planet_environment_parser_rules::planet_environment_parser_rules(
        const parse::lexer& tok,
        Labeller& label,
        const condition_parser_grammar& condition_parser
    ) :
        enum_value_ref_rules("PlanetEnvironment", tok, label, condition_parser)
    {
        boost::spirit::qi::_val_type _val;

        variable_name
            %=  tok.PlanetEnvironment_
            ;

        enum_expr
            =   tok.Uninhabitable_  [ _val = PlanetEnvironment::PE_UNINHABITABLE ]
            |   tok.Hostile_        [ _val = PlanetEnvironment::PE_HOSTILE ]
            |   tok.Poor_           [ _val = PlanetEnvironment::PE_POOR ]
            |   tok.Adequate_       [ _val = PlanetEnvironment::PE_ADEQUATE ]
            |   tok.Good_           [ _val = PlanetEnvironment::PE_GOOD ]
            ;
    }
}}