summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/ast/ast_fixed.cpp
blob: 3048fd0f0bc2f80e7df65bf3e194ceb43295a3da (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "ast_fixed.h"

#include "ast_visitor.h"

AST_Fixed::AST_Fixed (UTL_ScopedName *name,
                      AST_Expression *digits,
                      AST_Expression *scale)
  : COMMON_Base (),
    AST_Decl (AST_Decl::NT_fixed, name, true),
    AST_Type (AST_Decl::NT_fixed, name),
    AST_ConcreteType (AST_Decl::NT_fixed, name),
    pd_digits (digits),
    pd_scale (scale)
{
}

AST_Fixed::~AST_Fixed ()
{
}

void AST_Fixed::dump (ACE_OSTREAM_TYPE &os)
{
  dump_i (os, "fixed<");
  pd_digits->dump (os);
  dump_i (os, ", ");
  pd_scale->dump (os);
  dump_i (os, ">");
}

void AST_Fixed::destroy ()
{
  pd_digits->destroy ();
  delete pd_digits;
  pd_digits = nullptr;

  pd_scale->destroy ();
  delete pd_scale;
  pd_scale = nullptr;

  AST_ConcreteType::destroy ();
}

int AST_Fixed::ast_accept (ast_visitor *visitor)
{
  return visitor->visit_fixed (this);
}

AST_Expression *AST_Fixed::digits ()
{
  return pd_digits;
}

AST_Expression *AST_Fixed::scale ()
{
  return pd_scale;
}