aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx
blob: fe32626eb42dd5f415a4463f86e3ae43366bf1bc (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// file      : tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx
// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#include <iostream>

#include "test-pimpl.hxx"

using namespace std;

namespace test
{
  // root_pimpl
  //

  void root_pimpl::
  pre ()
  {
    cout << "root start" << endl;
  }

  void root_pimpl::
  expression ()
  {
    cout << "root->expression" << endl;
  }

  void root_pimpl::
  post_root ()
  {
    cout << "root end" << endl;
  }

  // expression_pimpl
  //

  void expression_pimpl::
  pre ()
  {
    cout << "expression begin" << endl;
  }

  void expression_pimpl::
  post_expression ()
  {
    cout << "expression end" << endl;
  }

  // recursive_pimpl
  //

  void recursive_pimpl::
  pre ()
  {
    cout << "recursive start" << endl;
  }

  void recursive_pimpl::
  expression ()
  {
    cout << "recursive->expression event" << endl;
  }

  void recursive_pimpl::
  post_expression ()
  {
    cout << "recursive: post_expression override" << endl;
    post_recursive ();
  }

  void recursive_pimpl::
  post_recursive ()
  {
    cout << "recursive end" << endl;
  }

  // value_pimpl
  //

  void value_pimpl::
  pre ()
  {
    cout << "value begin" << endl;
  }

  void value_pimpl::
  constant (int)
  {
    cout << "value->constant" << endl;
  }

  void value_pimpl::
  post_expression ()
  {
    cout << "value: post_expression override" << endl;
    post_value ();
  }

  void value_pimpl::
  post_value ()
  {
    cout << "value end" << endl;
  }

  // value_a_pimpl
  //

  void value_a_pimpl::
  pre ()
  {
    cout << "value_a begin" << endl;
  }

  void value_a_pimpl::
  post_value ()
  {
    cout << "value_a: post_value override" << endl;
    post_value_a ();
  }

  void value_a_pimpl::
  post_value_a ()
  {
    cout << "value_a end" << endl;
  }

  // value_b_pimpl
  //

  void value_b_pimpl::
  pre ()
  {
    cout << "value_b begin" << endl;
  }

  void value_b_pimpl::
  post_value ()
  {
    cout << "value_b: post_value override" << endl;
    post_value_b ();
  }

  void value_b_pimpl::
  post_value_b ()
  {
    cout << "value_b end" << endl;
  }
}