File: StarTypeValueRefParser.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 (38 lines) | stat: -rw-r--r-- 1,284 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
#include "ValueRefParser.h"

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

#include "../universe/System.h"

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

        variable_name
            %=   tok.StarType_
            |    tok.NextOlderStarType_
            |    tok.NextYoungerStarType_
            ;

        enum_expr
            =   tok.Blue_      [ _val = StarType::STAR_BLUE ]
            |   tok.White_     [ _val = StarType::STAR_WHITE ]
            |   tok.Yellow_    [ _val = StarType::STAR_YELLOW ]
            |   tok.Orange_    [ _val = StarType::STAR_ORANGE ]
            |   tok.Red_       [ _val = StarType::STAR_RED ]
            |   tok.Neutron_   [ _val = StarType::STAR_NEUTRON ]
            |   tok.BlackHole_ [ _val = StarType::STAR_BLACK ]
            |   tok.NoStar_    [ _val = StarType::STAR_NONE ]
            ;

        // complex_expr left empty, as no direct complex variable
        // expressions are available available that return a StarType
    }
} }