File: PlanetTypeValueRefParser.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 (42 lines) | stat: -rw-r--r-- 1,547 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
31
32
33
34
35
36
37
38
39
40
41
42
#include "ValueRefParser.h"

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

#include "../universe/Planet.h"

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

        variable_name
            %=   tok.PlanetType_
            |    tok.OriginalType_
            |    tok.NextCloserToOriginalPlanetType_
            |    tok.NextBestPlanetType_
            |    tok.NextBetterPlanetType_
            |    tok.ClockwiseNextPlanetType_
            |    tok.CounterClockwiseNextPlanetType_
            ;

        enum_expr
            =   tok.Swamp_      [ _val = PlanetType::PT_SWAMP ]
            |   tok.Toxic_      [ _val = PlanetType::PT_TOXIC ]
            |   tok.Inferno_    [ _val = PlanetType::PT_INFERNO ]
            |   tok.Radiated_   [ _val = PlanetType::PT_RADIATED ]
            |   tok.Barren_     [ _val = PlanetType::PT_BARREN ]
            |   tok.Tundra_     [ _val = PlanetType::PT_TUNDRA ]
            |   tok.Desert_     [ _val = PlanetType::PT_DESERT ]
            |   tok.Terran_     [ _val = PlanetType::PT_TERRAN ]
            |   tok.Ocean_      [ _val = PlanetType::PT_OCEAN ]
            |   tok.Asteroids_  [ _val = PlanetType::PT_ASTEROIDS ]
            |   tok.GasGiant_   [ _val = PlanetType::PT_GASGIANT ]
            ;
    }
}