~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/src/Token.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "Puma/Token.h"
20
20
#include "Puma/CTokens.h"
21
21
#include "Puma/CCommentTokens.h"
22
 
#include "Puma/CWhitespaceTokens.h"
23
22
#include "Puma/CWildcardTokens.h"
24
23
#include "Puma/PreMacroOpTokens.h"
25
24
#include "Puma/PreParser.h"
63
62
  _cont_lines = 0;
64
63
  _real_type = t;
65
64
  _type = get_general_type ();
66
 
  const char *static_text = get_static_text ();
67
 
  _text = static_text ? static_text : txt;
68
65
  is_comment_internal ();
69
66
  is_core_internal ();
 
67
  const char *static_text = get_static_text ();
 
68
  if (static_text || ! txt)
 
69
    _text = 0;
 
70
  else
 
71
    _text = StrCol::dup (txt);
70
72
}
71
73
 
72
74
 
76
78
  _flags = t._flags;
77
79
  _type = t._type;
78
80
  _real_type = t._real_type;
79
 
  _text = t._text;
 
81
  if (t._text)
 
82
    _text = StrCol::dup (t._text);
 
83
  else
 
84
    _text = 0;
80
85
  _cont_lines = t._cont_lines ? new Array<int> (*t._cont_lines) : 0;
81
86
}
82
87
 
84
89
Token::~Token () {
85
90
  if (_cont_lines) {
86
91
    delete _cont_lines;
87
 
  }
88
 
}
89
 
    
 
92
    _cont_lines = 0;
 
93
  }
 
94
  if (_text) {
 
95
    delete[] _text;
 
96
    _text = 0;
 
97
  }
 
98
}
 
99
 
 
100
 
 
101
DString &Token::dtext () const {
 
102
  if (_dtext.empty ())
 
103
    _dtext = text ();
 
104
  return _dtext;
 
105
}
 
106
 
 
107
 
 
108
const char *Token::text () const {
 
109
  return _text ? _text : get_static_text ();
 
110
}
 
111
 
90
112
 
91
113
int Token::get_general_type () const {
92
114
  switch (_real_type) {
129
151
  if (_cont_lines) {
130
152
    delete _cont_lines;
131
153
  }
 
154
  if (_text) {
 
155
    delete[] _text;
 
156
  }
132
157
 
133
158
  _language = id;
134
159
  _cont_lines = 0;
135
160
  _real_type = t;
136
161
  _type = get_general_type ();
137
 
  const char *static_text = get_static_text ();
138
 
  _text = static_text ? static_text : txt;
139
162
  is_comment_internal ();
140
163
  is_core_internal ();
 
164
  const char *static_text = get_static_text ();
 
165
  _text = static_text || ! txt ? 0 : StrCol::dup (txt);
141
166
}
142
167
 
143
168
 
144
169
char *Token::get_static_text () const { 
145
 
  if (is_preprocessor () || is_directive ())
 
170
  if (!(is_core () || is_wildcard ()) ||
 
171
      (is_identifier () && !is_keyword ()))
146
172
    return 0;
147
173
 
148
174
  switch (_real_type) {