Project

General

Profile

root / trunk / compiler / cppAst / ast / expressions / LeafExpression.hpp @ 10

1 7 krennw
/**
2
  *
3
  *                  OOAS Compiler - C++ AST
4
  *
5
  * Copyright 2015, AIT Austrian Institute of Technology.
6
  * All rights reserved.
7
  *
8
  * SEE THE "LICENSE" FILE FOR THE TERMS UNDER WHICH THIS FILE IS PROVIDED.
9
  *
10
  * If you modify the file please update the list of contributors below to in-
11
  * clude your name. Please also stick to the coding convention of using TABs
12
  * to do the basic (block-level) indentation and spaces for anything after
13
  * that. (Enable the display of special chars and it should be pretty obvious
14
  * what this means.) Also, remove all trailing whitespace.
15
  *
16
  * Contributors:
17
  *               Willibald Krenn (AIT)
18
  *               Stephan Zimmerer (AIT)
19
  *               Christoph Czurda (AIT)
20
  *
21
  */
22 2 krennw
23
24
25
26
#pragma once
27
28
#include <ast/expressions/Expression.hpp>
29
30
namespace Ast {
31
32
enum class LeafTypeEnum {
33
        unset = 0,
34
        _bool = 1,
35
        integer  = 2,
36
        real  = 3,
37
        chr  = 4,
38
        qval = 5,
39
        reference = 6,
40
        identifier = 7,
41
        type = 8,
42
        complex = 9
43
};
44
45
class LeafExpression
46
        : public Expression
47
{
48
protected:
49
        LeafTypeEnum m_valueType;
50
51
        LeafExpression(LeafTypeEnum lt, ExpressionKind kind):
52
                Expression(kind),
53
                m_valueType (lt)
54
        {};
55
        LeafExpression(const LeafExpression &toCopy):
56
                Expression(toCopy),
57
                m_valueType (toCopy.m_valueType)
58
        {};
59
public:
60
        ~LeafExpression() override {};
61
62
        LeafTypeEnum valueType() const {return m_valueType;};
63
};
64
}