1
// This file is part of PUMA.
2
// Copyright (C) 1999-2003 The PUMA developer team.
4
// This program is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU General Public License as
6
// published by the Free Software Foundation; either version 2 of
7
// the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public
15
// License along with this program; if not, write to the Free
16
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19
#include "Puma/Unit.h"
20
#include "Puma/Source.h"
21
#include "Puma/SysCall.h"
22
#include "Puma/FileUnit.h"
23
#include "Puma/FileSource.h"
24
#include "Puma/ErrorStream.h"
25
#include "Puma/UnitManager.h"
26
#include "Puma/Tokenizer.h"
2
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
3
#ifndef __ac_FIRST__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1__
4
#define __ac_FIRST__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1__
5
#define __ac_FIRST_FILE__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_src_UnitManager_cc__
6
#endif // __ac_FIRST__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1__
8
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
10
#line 11 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
16
typedef const char* Type;
17
enum JPType { CALL = 0x0004, EXECUTION = 0x0008, CONSTRUCTION = 0x0010, DESTRUCTION = 0x0020 };
19
void **_args; void *_result; void *_target; void *_that; void *_fptr;
20
void (*_wrapper)(Action &);
21
inline void trigger () { _wrapper (*this); }
23
struct AnyResultBuffer {};
24
template <typename T> struct ResultBuffer : public AnyResultBuffer {
25
char _data[sizeof (T)];
26
~ResultBuffer () { ((T*)_data)->T::~T(); }
27
operator T& () const { return *(T*)_data; }
29
template <typename T, typename N> struct TL {
30
typedef T type; typedef N next; enum { ARGS = next::ARGS + 1 };
32
struct TLE { enum { ARGS = 0 }; };
33
template <typename T> struct Referred { typedef T type; };
34
template <typename T> struct Referred<T &> { typedef T type; };
35
template <typename TL, int I> struct Arg {
36
typedef typename Arg<typename TL::next, I - 1>::Type Type;
37
typedef typename Referred<Type>::type ReferredType;
39
template <typename TL> struct Arg<TL, 0> {
40
typedef typename TL::type Type;
41
typedef typename Referred<Type>::type ReferredType;
43
template <class Aspect, int Index>
45
static int &instance () {
46
static int counter = 0;
49
CFlow () { instance ()++; }
50
~CFlow () { instance ()--; }
51
static bool active () { return instance () > 0; }
54
inline void * operator new (__SIZE_TYPE__, AC::AnyResultBuffer *p) { return p; }
55
inline void operator delete (void *, AC::AnyResultBuffer *) { } // for VC++
59
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
61
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
63
#line 64 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
65
#ifndef __ac_fwd_PragmaOnceUnitState__
66
#define __ac_fwd_PragmaOnceUnitState__
67
class PragmaOnceUnitState;
69
template <class JoinPoint>
70
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a0_after (JoinPoint *tjp);
71
template <class JoinPoint>
72
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a1_after (JoinPoint *tjp);
76
#ifndef __ac_need__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
77
#define __ac_need__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
80
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
81
// This file is part of PUMA.
82
// Copyright (C) 1999-2003 The PUMA developer team.
84
// This program is free software; you can redistribute it and/or
85
// modify it under the terms of the GNU General Public License as
86
// published by the Free Software Foundation; either version 2 of
87
// the License, or (at your option) any later version.
89
// This program is distributed in the hope that it will be useful,
90
// but WITHOUT ANY WARRANTY; without even the implied warranty of
91
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92
// GNU General Public License for more details.
94
// You should have received a copy of the GNU General Public
95
// License along with this program; if not, write to the Free
96
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
100
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Unit.h"
101
// This file is part of PUMA.
102
// Copyright (C) 1999-2003 The PUMA developer team.
104
// This program is free software; you can redistribute it and/or
105
// modify it under the terms of the GNU General Public License as
106
// published by the Free Software Foundation; either version 2 of
107
// the License, or (at your option) any later version.
109
// This program is distributed in the hope that it will be useful,
110
// but WITHOUT ANY WARRANTY; without even the implied warranty of
111
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112
// GNU General Public License for more details.
114
// You should have received a copy of the GNU General Public
115
// License along with this program; if not, write to the Free
116
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
123
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/List.h"
124
// This file is part of PUMA.
125
// Copyright (C) 1999-2003 The PUMA developer team.
127
// This program is free software; you can redistribute it and/or
128
// modify it under the terms of the GNU General Public License as
129
// published by the Free Software Foundation; either version 2 of
130
// the License, or (at your option) any later version.
132
// This program is distributed in the hope that it will be useful,
133
// but WITHOUT ANY WARRANTY; without even the implied warranty of
134
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
135
// GNU General Public License for more details.
137
// You should have received a copy of the GNU General Public
138
// License along with this program; if not, write to the Free
139
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
146
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ListElement.h"
147
// This file is part of PUMA.
148
// Copyright (C) 1999-2003 The PUMA developer team.
150
// This program is free software; you can redistribute it and/or
151
// modify it under the terms of the GNU General Public License as
152
// published by the Free Software Foundation; either version 2 of
153
// the License, or (at your option) any later version.
155
// This program is distributed in the hope that it will be useful,
156
// but WITHOUT ANY WARRANTY; without even the implied warranty of
157
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
158
// GNU General Public License for more details.
160
// You should have received a copy of the GNU General Public
161
// License along with this program; if not, write to the Free
162
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
165
#ifndef __list_element_h__
166
#define __list_element_h__
168
// Base class for objects that may be inserted into a List. Lists
169
// autonomously delete or copy list element. So it's necessary to
170
// define a destructor and a duplicate method in the derived
181
#line 182 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
186
class WinImportHandler;
190
class WinMemberExplSpec;
191
class WinTypeKeywords;
194
class ExtACBuilderCoupling;
195
class ExtACSyntaxCoupling;
199
class PragmaOnceUnitState;
204
#line 34 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ListElement.h"
206
#line 207 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
207
friend class ::CCExprResolve;
208
friend class ::CExprResolve;
209
friend class ::WinIfExists;
210
friend class ::WinImportHandler;
211
friend class ::WinMacros;
212
friend class ::WinAsm;
213
friend class ::WinDeclSpecs;
214
friend class ::WinMemberExplSpec;
215
friend class ::WinTypeKeywords;
216
friend class ::WinFriend;
217
friend class ::ExtAC;
218
friend class ::ExtACBuilderCoupling;
219
friend class ::ExtACSyntaxCoupling;
220
friend class ::ExtACTree;
221
friend class ::ExtACKeywords;
222
friend class ::ExtGnu;
223
friend class ::PragmaOnceUnitState;
224
friend class ::PragmaOnce;
225
friend class ::CMatchSyntax;
227
#line 34 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ListElement.h"
236
ListElement () : _belonging_to ((List*)0) {}
237
virtual ~ListElement () { assert (! _belonging_to); };
239
virtual ListElement *duplicate () = 0;
240
List *belonging_to () const { return _belonging_to; }
246
#endif /* __list_element_h__ */
248
#line 24 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/List.h"
253
#line 254 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
258
class WinImportHandler;
262
class WinMemberExplSpec;
263
class WinTypeKeywords;
266
class ExtACBuilderCoupling;
267
class ExtACSyntaxCoupling;
271
class PragmaOnceUnitState;
276
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/List.h"
278
#line 279 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
279
friend class ::CCExprResolve;
280
friend class ::CExprResolve;
281
friend class ::WinIfExists;
282
friend class ::WinImportHandler;
283
friend class ::WinMacros;
284
friend class ::WinAsm;
285
friend class ::WinDeclSpecs;
286
friend class ::WinMemberExplSpec;
287
friend class ::WinTypeKeywords;
288
friend class ::WinFriend;
289
friend class ::ExtAC;
290
friend class ::ExtACBuilderCoupling;
291
friend class ::ExtACSyntaxCoupling;
292
friend class ::ExtACTree;
293
friend class ::ExtACKeywords;
294
friend class ::ExtGnu;
295
friend class ::PragmaOnceUnitState;
296
friend class ::PragmaOnce;
297
friend class ::CMatchSyntax;
299
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/List.h"
305
List () : _first ((ListElement*)0), _last ((ListElement*)0) {}
309
List &operator = (const List &);
310
List &operator += (const List &);
311
List operator + (const List &);
315
void append (ListElement &);
316
void prepend (ListElement &);
317
void insert (ListElement *at, ListElement &element);
318
void remove (ListElement *element);
319
void kill (ListElement *from, ListElement *to = (ListElement*)0)
320
{ List discard; cut (discard, from, to); }
322
void cut (List &out, ListElement *from, ListElement *to = (ListElement*)0);
323
//List *cut (ListElement *from, ListElement *to = (ListElement*)0);
324
List *copy (ListElement *from = (ListElement*)0,
325
ListElement *to = (ListElement*)0);
326
void paste (ListElement *at, const List &l);
327
void paste_before (ListElement *at, const List &l);
328
void move (ListElement *at, List &l);
329
void move_before (ListElement *at, List &l);
331
bool empty () const { return _first == (ListElement*)0; }
332
const ListElement *first () const { return _first; }
333
const ListElement *last () const { return _last; }
334
const ListElement *next (const ListElement *element) const
335
{ return element ? element->_next : 0; }
336
const ListElement *prev (const ListElement *element) const
337
{ return element ? element->_prev : 0; }
343
#endif /* __list_h__ */
345
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Printable.h"
346
// This file is part of PUMA.
347
// Copyright (C) 1999-2003 The PUMA developer team.
349
// This program is free software; you can redistribute it and/or
350
// modify it under the terms of the GNU General Public License as
351
// published by the Free Software Foundation; either version 2 of
352
// the License, or (at your option) any later version.
354
// This program is distributed in the hope that it will be useful,
355
// but WITHOUT ANY WARRANTY; without even the implied warranty of
356
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
357
// GNU General Public License for more details.
359
// You should have received a copy of the GNU General Public
360
// License along with this program; if not, write to the Free
361
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
364
#ifndef __printable_h__
365
#define __printable_h__
374
#line 375 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
379
class WinImportHandler;
383
class WinMemberExplSpec;
384
class WinTypeKeywords;
387
class ExtACBuilderCoupling;
388
class ExtACSyntaxCoupling;
392
class PragmaOnceUnitState;
397
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Printable.h"
399
#line 400 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
400
friend class ::CCExprResolve;
401
friend class ::CExprResolve;
402
friend class ::WinIfExists;
403
friend class ::WinImportHandler;
404
friend class ::WinMacros;
405
friend class ::WinAsm;
406
friend class ::WinDeclSpecs;
407
friend class ::WinMemberExplSpec;
408
friend class ::WinTypeKeywords;
409
friend class ::WinFriend;
410
friend class ::ExtAC;
411
friend class ::ExtACBuilderCoupling;
412
friend class ::ExtACSyntaxCoupling;
413
friend class ::ExtACTree;
414
friend class ::ExtACKeywords;
415
friend class ::ExtGnu;
416
friend class ::PragmaOnceUnitState;
417
friend class ::PragmaOnce;
418
friend class ::CMatchSyntax;
420
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Printable.h"
423
virtual ~Printable () {}
424
virtual void print (ostream &os) const = 0;
428
inline ostream &operator << (ostream &os, const Printable &object) {
436
#endif /* __printable_h__ */
438
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
440
#line 441 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
442
#ifndef __ac_fwd_PragmaOnceUnitState__
443
#define __ac_fwd_PragmaOnceUnitState__
444
class PragmaOnceUnitState;
446
template <class JoinPoint>
447
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a0_after (JoinPoint *tjp);
448
template <class JoinPoint>
449
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a1_after (JoinPoint *tjp);
453
#ifndef __ac_need__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
454
#define __ac_need__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
457
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
458
// This file is part of PUMA.
459
// Copyright (C) 1999-2003 The PUMA developer team.
461
// This program is free software; you can redistribute it and/or
462
// modify it under the terms of the GNU General Public License as
463
// published by the Free Software Foundation; either version 2 of
464
// the License, or (at your option) any later version.
466
// This program is distributed in the hope that it will be useful,
467
// but WITHOUT ANY WARRANTY; without even the implied warranty of
468
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
469
// GNU General Public License for more details.
471
// You should have received a copy of the GNU General Public
472
// License along with this program; if not, write to the Free
473
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
476
#ifndef __UnitState__
477
#define __UnitState__
479
// The state of a unit:
480
// 1. modified by manipulations and not updated at the class registry
481
// 2. modified by manipulations and updated at the class registry
482
// 3. unmodified by manipulations and not updated at the class registry
483
// 4. unmodified by manipulations and updated at the class registry
489
#line 490 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
494
class WinImportHandler;
498
class WinMemberExplSpec;
499
class WinTypeKeywords;
502
class ExtACBuilderCoupling;
503
class ExtACSyntaxCoupling;
507
class PragmaOnceUnitState;
512
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
514
#line 515 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
517
#ifndef __ac_guard__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
518
#define __ac_guard__tmp_tmp_KxXqa14641_aspectc4343_svn20080409_Puma_gen45release_step1_aspects_PragmaOnceUnitState_ah__
520
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
521
// This file is part of PUMA.
522
// Copyright (C) 1999-2003 The PUMA developer team.
524
// This program is free software; you can redistribute it and/or
525
// modify it under the terms of the GNU General Public License as
526
// published by the Free Software Foundation; either version 2 of
527
// the License, or (at your option) any later version.
529
// This program is distributed in the hope that it will be useful,
530
// but WITHOUT ANY WARRANTY; without even the implied warranty of
531
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
532
// GNU General Public License for more details.
534
// You should have received a copy of the GNU General Public
535
// License along with this program; if not, write to the Free
536
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
539
#ifndef __PragmaOnceUnitState__
540
#define __PragmaOnceUnitState__
543
#line 544 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
547
class WinImportHandler;
551
class WinMemberExplSpec;
552
class WinTypeKeywords;
555
class ExtACBuilderCoupling;
556
class ExtACSyntaxCoupling;
563
#line 22 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
564
class PragmaOnceUnitState {
565
#line 566 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
568
static PragmaOnceUnitState *aspectof () {
569
static PragmaOnceUnitState __instance;
572
static PragmaOnceUnitState *aspectOf () {
577
#line 22 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
579
#line 580 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
580
friend class ::CCExprResolve;
581
friend class ::CExprResolve;
582
friend class ::WinIfExists;
583
friend class ::WinImportHandler;
584
friend class ::WinMacros;
585
friend class ::WinAsm;
586
friend class ::WinDeclSpecs;
587
friend class ::WinMemberExplSpec;
588
friend class ::WinTypeKeywords;
589
friend class ::WinFriend;
590
friend class ::ExtAC;
591
friend class ::ExtACBuilderCoupling;
592
friend class ::ExtACSyntaxCoupling;
593
friend class ::ExtACTree;
594
friend class ::ExtACKeywords;
595
friend class ::ExtGnu;
596
friend class ::PragmaOnce;
597
friend class ::CMatchSyntax;
599
#line 22 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
601
/******************************************************/
602
/* specific #pragma once unit state */
603
/******************************************************/
605
// pointcut definitions
607
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
611
#line 37 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
614
// initialize new state flag
616
#line 3 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
618
public: template<class JoinPoint> void __a0_after
619
#line 40 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
621
#line 40 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
623
#line 40 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
625
#line 626 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
627
JoinPoint *&thisJoinPoint = tjp;
629
#line 40 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
631
#line 632 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
633
typedef typename JoinPoint::That __JP_That;
634
typedef typename JoinPoint::Target __JP_Target;
635
typedef typename JoinPoint::Result __JP_Result;
637
#line 40 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
639
thisJoinPoint->that ()->_once = false;
641
#line 642 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
645
#line 42 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
648
// initialize new flag for all managed units
650
#line 3 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
652
public: template<class JoinPoint> void __a1_after
653
#line 45 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
655
#line 45 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
657
#line 45 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
659
#line 660 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
661
typedef typename JoinPoint::That __JP_That;
662
typedef typename JoinPoint::Target __JP_Target;
663
typedef typename JoinPoint::Result __JP_Result;
665
#line 45 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
667
// go through the whole unit hash table and reset the
668
// `#pragma once' state of the units
670
#line 48 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
672
for (iter = tjp->that()->_umap.begin (); iter != tjp->that()->_umap.end (); ++iter)
673
(*iter).second->state ().onlyOnce (false);
675
#line 676 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
679
#line 51 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
683
// this aspect should never be instantiated directly
684
PragmaOnceUnitState () {}
686
#line 687 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
689
template <class JoinPoint>
690
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a0_after (JoinPoint *tjp) {
691
::PragmaOnceUnitState::aspectof()->__a0_after (tjp);
693
template <class JoinPoint>
694
__attribute((always_inline)) inline void invoke_PragmaOnceUnitState_PragmaOnceUnitState_a1_after (JoinPoint *tjp) {
695
::PragmaOnceUnitState::aspectof()->__a1_after (tjp);
699
#line 56 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
703
#endif /* __PragmaOnceUnitState__ */
705
#line 8 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
709
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
711
#line 712 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
712
friend class ::CCExprResolve;
713
friend class ::CExprResolve;
714
friend class ::WinIfExists;
715
friend class ::WinImportHandler;
716
friend class ::WinMacros;
717
friend class ::WinAsm;
718
friend class ::WinDeclSpecs;
719
friend class ::WinMemberExplSpec;
720
friend class ::WinTypeKeywords;
721
friend class ::WinFriend;
722
friend class ::ExtAC;
723
friend class ::ExtACBuilderCoupling;
724
friend class ::ExtACSyntaxCoupling;
725
friend class ::ExtACTree;
726
friend class ::ExtACKeywords;
727
friend class ::ExtGnu;
728
friend class ::PragmaOnceUnitState;
729
friend class ::PragmaOnce;
730
friend class ::CMatchSyntax;
732
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
740
#line 741 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
741
public: __attribute__((always_inline)) inline void __exec_old_C1();
743
#line 37 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
746
bool isModified () const;
747
bool isUpdated () const;
748
long lastModified () const;
750
// Is modified and has to be updated.
752
void lastModified (long);
757
#line 32 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/aspects/PragmaOnceUnitState.ah"
761
bool onlyOnce ( ) const { return _once ; }
762
void onlyOnce ( bool v ) { _once = v ; }
763
#line 48 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
765
#line 766 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
767
template <typename TResult, typename TThat, typename TTarget, typename TArgs> struct TJP__ZN4Puma9UnitStateC1ERKN4PumaE9UnitState_0 {
768
typedef TJP__ZN4Puma9UnitStateC1ERKN4PumaE9UnitState_0 __TJP;
769
typedef TResult Result;
771
typedef TTarget Target;
772
enum { ARGS = TArgs::ARGS };
773
template <int I> struct Arg : AC::Arg<TArgs, I> {};
774
static const int JPID = 3280;
775
static const AC::JPType JPTYPE = (AC::JPType)16;
778
typedef void ReferredType;
783
inline That *that() {return (That*)_that;}
788
#line 48 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
790
#line 791 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
793
inline UnitState (const Puma::UnitState & arg0) : _modified (arg0._modified), _updated (arg0._updated), _lastModified (arg0._lastModified), _once (arg0._once) {
794
typedef TJP__ZN4Puma9UnitStateC1ERKN4PumaE9UnitState_0< void, ::Puma::UnitState , ::Puma::UnitState , AC::TL< const ::Puma::UnitState & , AC::TLE > > __TJP;
796
tjp._that = (__TJP::That*)this;
797
AC::invoke_PragmaOnceUnitState_PragmaOnceUnitState_a0_after<__TJP> (&tjp);
801
#line 48 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
805
#line 806 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
808
template <typename TResult, typename TThat, typename TTarget, typename TArgs> struct TJP__ZN4Puma9UnitStateC1Ev_0 {
809
typedef TJP__ZN4Puma9UnitStateC1Ev_0 __TJP;
810
typedef TResult Result;
812
typedef TTarget Target;
813
enum { ARGS = TArgs::ARGS };
814
template <int I> struct Arg : AC::Arg<TArgs, I> {};
815
static const int JPID = 3256;
816
static const AC::JPType JPTYPE = (AC::JPType)16;
819
typedef void ReferredType;
824
inline That *that() {return (That*)_that;}
829
#line 50 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
830
inline UnitState::UnitState ()
832
#line 833 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
834
typedef TJP__ZN4Puma9UnitStateC1Ev_0< void, ::Puma::UnitState , ::Puma::UnitState , AC::TLE > __TJP;
836
tjp._that = (__TJP::That*)this;
837
this->__exec_old_C1();
838
AC::invoke_PragmaOnceUnitState_PragmaOnceUnitState_a0_after<__TJP> (&tjp);
841
__attribute__((always_inline)) inline void Puma::UnitState::__exec_old_C1()
842
#line 51 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitState.h"
843
{ _modified = false; _updated = false; _lastModified = 0; }
845
inline bool UnitState::isModified () const
846
{ return _modified; }
847
inline bool UnitState::isUpdated () const
849
inline long UnitState::lastModified () const
850
{ return _lastModified; }
852
inline void UnitState::modified ()
853
{ _modified = true; _updated = false; _lastModified = 0; }
854
inline void UnitState::unmodified ()
855
{ _modified = false; }
856
inline void UnitState::updated ()
858
inline void UnitState::lastModified (long when)
859
{ _lastModified = when; }
864
#endif /* __UnitState__ */
866
#line 26 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Unit.h"
871
#line 872 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
876
class WinImportHandler;
880
class WinMemberExplSpec;
881
class WinTypeKeywords;
884
class ExtACBuilderCoupling;
885
class ExtACSyntaxCoupling;
889
class PragmaOnceUnitState;
894
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Unit.h"
895
class Unit : public List, public Printable {
896
#line 897 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
897
friend class ::CCExprResolve;
898
friend class ::CExprResolve;
899
friend class ::WinIfExists;
900
friend class ::WinImportHandler;
901
friend class ::WinMacros;
902
friend class ::WinAsm;
903
friend class ::WinDeclSpecs;
904
friend class ::WinMemberExplSpec;
905
friend class ::WinTypeKeywords;
906
friend class ::WinFriend;
907
friend class ::ExtAC;
908
friend class ::ExtACBuilderCoupling;
909
friend class ::ExtACSyntaxCoupling;
910
friend class ::ExtACTree;
911
friend class ::ExtACKeywords;
912
friend class ::ExtGnu;
913
friend class ::PragmaOnceUnitState;
914
friend class ::PragmaOnce;
915
friend class ::CMatchSyntax;
917
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Unit.h"
923
Unit () : List (), _name ((char*)0) {}
924
Unit (const List &list) : List (list), _name ((char*)0) {}
926
virtual void name (const char *);
927
char *name () const { return _name; }
928
virtual void print (ostream &os) const;
929
virtual bool isFile () const { return false; }
930
virtual bool isMacroExp () const { return false; }
931
UnitState &state () { return _state; }
937
#endif /* __unit_h__ */
939
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Source.h"
940
// This file is part of PUMA.
941
// Copyright (C) 1999-2003 The PUMA developer team.
943
// This program is free software; you can redistribute it and/or
944
// modify it under the terms of the GNU General Public License as
945
// published by the Free Software Foundation; either version 2 of
946
// the License, or (at your option) any later version.
948
// This program is distributed in the hope that it will be useful,
949
// but WITHOUT ANY WARRANTY; without even the implied warranty of
950
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
951
// GNU General Public License for more details.
953
// You should have received a copy of the GNU General Public
954
// License along with this program; if not, write to the Free
955
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
965
#line 966 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
970
class WinImportHandler;
974
class WinMemberExplSpec;
975
class WinTypeKeywords;
978
class ExtACBuilderCoupling;
979
class ExtACSyntaxCoupling;
983
class PragmaOnceUnitState;
988
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Source.h"
990
#line 991 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
991
friend class ::CCExprResolve;
992
friend class ::CExprResolve;
993
friend class ::WinIfExists;
994
friend class ::WinImportHandler;
995
friend class ::WinMacros;
996
friend class ::WinAsm;
997
friend class ::WinDeclSpecs;
998
friend class ::WinMemberExplSpec;
999
friend class ::WinTypeKeywords;
1000
friend class ::WinFriend;
1001
friend class ::ExtAC;
1002
friend class ::ExtACBuilderCoupling;
1003
friend class ::ExtACSyntaxCoupling;
1004
friend class ::ExtACTree;
1005
friend class ::ExtACKeywords;
1006
friend class ::ExtGnu;
1007
friend class ::PragmaOnceUnitState;
1008
friend class ::PragmaOnce;
1009
friend class ::CMatchSyntax;
1011
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Source.h"
1015
virtual ~Source () {}
1016
virtual int read (char *dest, int n) = 0;
1017
virtual int size () { return -1; }
1023
#endif /* __source_h__ */
1025
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
1026
// This file is part of PUMA.
1027
// Copyright (C) 1999-2003 The PUMA developer team.
1029
// This program is free software; you can redistribute it and/or
1030
// modify it under the terms of the GNU General Public License as
1031
// published by the Free Software Foundation; either version 2 of
1032
// the License, or (at your option) any later version.
1034
// This program is distributed in the hope that it will be useful,
1035
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1036
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1037
// GNU General Public License for more details.
1039
// You should have received a copy of the GNU General Public
1040
// License along with this program; if not, write to the Free
1041
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1042
// MA 02111-1307 USA
1044
#ifndef __SysCall_h__
1045
#define __SysCall_h__
1047
// Encapsulate some system calls.
1052
#include <sys/stat.h>
1054
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
27
1056
#include <string.h>
1063
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Filename.h"
1064
// This file is part of PUMA.
1065
// Copyright (C) 1999-2003 The PUMA developer team.
1067
// This program is free software; you can redistribute it and/or
1068
// modify it under the terms of the GNU General Public License as
1069
// published by the Free Software Foundation; either version 2 of
1070
// the License, or (at your option) any later version.
1072
// This program is distributed in the hope that it will be useful,
1073
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1074
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1075
// GNU General Public License for more details.
1077
// You should have received a copy of the GNU General Public
1078
// License along with this program; if not, write to the Free
1079
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1080
// MA 02111-1307 USA
1082
#ifndef __filename_h__
1083
#define __filename_h__
1086
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SmartPtr.h"
1087
// This file is part of PUMA.
1088
// Copyright (C) 1999-2003 The PUMA developer team.
1090
// This program is free software; you can redistribute it and/or
1091
// modify it under the terms of the GNU General Public License as
1092
// published by the Free Software Foundation; either version 2 of
1093
// the License, or (at your option) any later version.
1095
// This program is distributed in the hope that it will be useful,
1096
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1097
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1098
// GNU General Public License for more details.
1100
// You should have received a copy of the GNU General Public
1101
// License along with this program; if not, write to the Free
1102
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1103
// MA 02111-1307 USA
1105
#ifndef __smart_ptr_h__
1106
#define __smart_ptr_h__
1109
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/RefCnt.h"
1110
// This file is part of PUMA.
1111
// Copyright (C) 1999-2003 The PUMA developer team.
1113
// This program is free software; you can redistribute it and/or
1114
// modify it under the terms of the GNU General Public License as
1115
// published by the Free Software Foundation; either version 2 of
1116
// the License, or (at your option) any later version.
1118
// This program is distributed in the hope that it will be useful,
1119
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1120
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1121
// GNU General Public License for more details.
1123
// You should have received a copy of the GNU General Public
1124
// License along with this program; if not, write to the Free
1125
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1126
// MA 02111-1307 USA
1128
#ifndef __ref_cnt_h__
1129
#define __ref_cnt_h__
1135
#line 1136 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1137
class CCExprResolve;
1140
class WinImportHandler;
1144
class WinMemberExplSpec;
1145
class WinTypeKeywords;
1148
class ExtACBuilderCoupling;
1149
class ExtACSyntaxCoupling;
1151
class ExtACKeywords;
1153
class PragmaOnceUnitState;
1158
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/RefCnt.h"
1160
#line 1161 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1161
friend class ::CCExprResolve;
1162
friend class ::CExprResolve;
1163
friend class ::WinIfExists;
1164
friend class ::WinImportHandler;
1165
friend class ::WinMacros;
1166
friend class ::WinAsm;
1167
friend class ::WinDeclSpecs;
1168
friend class ::WinMemberExplSpec;
1169
friend class ::WinTypeKeywords;
1170
friend class ::WinFriend;
1171
friend class ::ExtAC;
1172
friend class ::ExtACBuilderCoupling;
1173
friend class ::ExtACSyntaxCoupling;
1174
friend class ::ExtACTree;
1175
friend class ::ExtACKeywords;
1176
friend class ::ExtGnu;
1177
friend class ::PragmaOnceUnitState;
1178
friend class ::PragmaOnce;
1179
friend class ::CMatchSyntax;
1181
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/RefCnt.h"
1186
RefCnt () : _counter (0) {}
1187
virtual ~RefCnt () {}
1189
void ref () { _counter++; }
1190
void deref () { _counter--; }
1191
int counter () { return _counter; }
1197
#endif /* __ref_cnt_h__ */
1199
#line 24 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SmartPtr.h"
1204
#line 1205 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1206
class CCExprResolve;
1209
class WinImportHandler;
1213
class WinMemberExplSpec;
1214
class WinTypeKeywords;
1217
class ExtACBuilderCoupling;
1218
class ExtACSyntaxCoupling;
1220
class ExtACKeywords;
1222
class PragmaOnceUnitState;
1227
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SmartPtr.h"
1229
#line 1230 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1230
friend class ::CCExprResolve;
1231
friend class ::CExprResolve;
1232
friend class ::WinIfExists;
1233
friend class ::WinImportHandler;
1234
friend class ::WinMacros;
1235
friend class ::WinAsm;
1236
friend class ::WinDeclSpecs;
1237
friend class ::WinMemberExplSpec;
1238
friend class ::WinTypeKeywords;
1239
friend class ::WinFriend;
1240
friend class ::ExtAC;
1241
friend class ::ExtACBuilderCoupling;
1242
friend class ::ExtACSyntaxCoupling;
1243
friend class ::ExtACTree;
1244
friend class ::ExtACKeywords;
1245
friend class ::ExtGnu;
1246
friend class ::PragmaOnceUnitState;
1247
friend class ::PragmaOnce;
1248
friend class ::CMatchSyntax;
1250
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SmartPtr.h"
1255
SmartPtr () : _data ((RefCnt*)0) {}
1256
~SmartPtr () { clear (); }
1257
SmartPtr (const SmartPtr ©);
1258
SmartPtr (RefCnt *rc) : _data (rc) {}
1259
SmartPtr &operator = (const SmartPtr ©);
1261
void data (RefCnt *d);
1263
RefCnt *data () const { return _data; }
1264
bool is_defined () const { return _data != (RefCnt*)0; }
1270
#endif /* __smart_ptr_h__ */
1272
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FilenameInfo.h"
1273
// This file is part of PUMA.
1274
// Copyright (C) 1999-2003 The PUMA developer team.
1276
// This program is free software; you can redistribute it and/or
1277
// modify it under the terms of the GNU General Public License as
1278
// published by the Free Software Foundation; either version 2 of
1279
// the License, or (at your option) any later version.
1281
// This program is distributed in the hope that it will be useful,
1282
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1283
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1284
// GNU General Public License for more details.
1286
// You should have received a copy of the GNU General Public
1287
// License along with this program; if not, write to the Free
1288
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1289
// MA 02111-1307 USA
1291
#ifndef __filename_info_h__
1292
#define __filename_info_h__
1295
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/DString.h"
1296
// This file is part of PUMA.
1297
// Copyright (C) 1999-2003 The PUMA developer team.
1299
// This program is free software; you can redistribute it and/or
1300
// modify it under the terms of the GNU General Public License as
1301
// published by the Free Software Foundation; either version 2 of
1302
// the License, or (at your option) any later version.
1304
// This program is distributed in the hope that it will be useful,
1305
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1306
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1307
// GNU General Public License for more details.
1309
// You should have received a copy of the GNU General Public
1310
// License along with this program; if not, write to the Free
1311
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1312
// MA 02111-1307 USA
1314
#ifndef __DString_h__
1315
#define __DString_h__
1318
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashTable.h"
1319
// This file is part of PUMA.
1320
// Copyright (C) 1999-2003 The PUMA developer team.
1322
// This program is free software; you can redistribute it and/or
1323
// modify it under the terms of the GNU General Public License as
1324
// published by the Free Software Foundation; either version 2 of
1325
// the License, or (at your option) any later version.
1327
// This program is distributed in the hope that it will be useful,
1328
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1329
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1330
// GNU General Public License for more details.
1332
// You should have received a copy of the GNU General Public
1333
// License along with this program; if not, write to the Free
1334
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1335
// MA 02111-1307 USA
1337
#ifndef __StrHashTable_h__
1338
#define __StrHashTable_h__
1341
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashKey.h"
1342
// This file is part of PUMA.
1343
// Copyright (C) 1999-2003 The PUMA developer team.
1345
// This program is free software; you can redistribute it and/or
1346
// modify it under the terms of the GNU General Public License as
1347
// published by the Free Software Foundation; either version 2 of
1348
// the License, or (at your option) any later version.
1350
// This program is distributed in the hope that it will be useful,
1351
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1352
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1353
// GNU General Public License for more details.
1355
// You should have received a copy of the GNU General Public
1356
// License along with this program; if not, write to the Free
1357
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1358
// MA 02111-1307 USA
1360
#ifndef __StrHashKey_h__
1361
#define __StrHashKey_h__
1364
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrCol.h"
1365
// This file is part of PUMA.
1366
// Copyright (C) 1999-2003 The PUMA developer team.
1368
// This program is free software; you can redistribute it and/or
1369
// modify it under the terms of the GNU General Public License as
1370
// published by the Free Software Foundation; either version 2 of
1371
// the License, or (at your option) any later version.
1373
// This program is distributed in the hope that it will be useful,
1374
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1375
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1376
// GNU General Public License for more details.
1378
// You should have received a copy of the GNU General Public
1379
// License along with this program; if not, write to the Free
1380
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1381
// MA 02111-1307 USA
1386
// Collection of functions handling strings.
1394
#line 1395 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1396
class CCExprResolve;
1399
class WinImportHandler;
1403
class WinMemberExplSpec;
1404
class WinTypeKeywords;
1407
class ExtACBuilderCoupling;
1408
class ExtACSyntaxCoupling;
1410
class ExtACKeywords;
1412
class PragmaOnceUnitState;
1417
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrCol.h"
1419
#line 1420 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1420
friend class ::CCExprResolve;
1421
friend class ::CExprResolve;
1422
friend class ::WinIfExists;
1423
friend class ::WinImportHandler;
1424
friend class ::WinMacros;
1425
friend class ::WinAsm;
1426
friend class ::WinDeclSpecs;
1427
friend class ::WinMemberExplSpec;
1428
friend class ::WinTypeKeywords;
1429
friend class ::WinFriend;
1430
friend class ::ExtAC;
1431
friend class ::ExtACBuilderCoupling;
1432
friend class ::ExtACSyntaxCoupling;
1433
friend class ::ExtACTree;
1434
friend class ::ExtACKeywords;
1435
friend class ::ExtGnu;
1436
friend class ::PragmaOnceUnitState;
1437
friend class ::PragmaOnce;
1438
friend class ::CMatchSyntax;
1440
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrCol.h"
1446
// Return true if c is a white space character.
1447
static bool isSpace (const char c);
1449
// Return true if the string consists only of spaces.
1450
static bool onlySpaces (const char *);
1452
// Return true if the two strings differ not only in spaces.
1453
static bool effectivelyDifferent (const char *, const char *);
1455
// Build a string from a unit.
1456
static char *buildString (Unit *);
1458
// Duplicate a string
1459
static char *dup (const char *);
1460
static char *dup (const char *, int);
1466
#endif /* __str_col__ */
1468
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Chain.h"
1469
// This file is part of PUMA.
1470
// Copyright (C) 1999-2003 The PUMA developer team.
1472
// This program is free software; you can redistribute it and/or
1473
// modify it under the terms of the GNU General Public License as
1474
// published by the Free Software Foundation; either version 2 of
1475
// the License, or (at your option) any later version.
1477
// This program is distributed in the hope that it will be useful,
1478
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1479
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1480
// GNU General Public License for more details.
1482
// You should have received a copy of the GNU General Public
1483
// License along with this program; if not, write to the Free
1484
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1485
// MA 02111-1307 USA
1491
// implements a simple chain
1496
using namespace std;
1503
#line 1504 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1505
class CCExprResolve;
1508
class WinImportHandler;
1512
class WinMemberExplSpec;
1513
class WinTypeKeywords;
1516
class ExtACBuilderCoupling;
1517
class ExtACSyntaxCoupling;
1519
class ExtACKeywords;
1521
class PragmaOnceUnitState;
1526
#line 34 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Chain.h"
1528
#line 1529 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1529
friend class ::CCExprResolve;
1530
friend class ::CExprResolve;
1531
friend class ::WinIfExists;
1532
friend class ::WinImportHandler;
1533
friend class ::WinMacros;
1534
friend class ::WinAsm;
1535
friend class ::WinDeclSpecs;
1536
friend class ::WinMemberExplSpec;
1537
friend class ::WinTypeKeywords;
1538
friend class ::WinFriend;
1539
friend class ::ExtAC;
1540
friend class ::ExtACBuilderCoupling;
1541
friend class ::ExtACSyntaxCoupling;
1542
friend class ::ExtACTree;
1543
friend class ::ExtACKeywords;
1544
friend class ::ExtGnu;
1545
friend class ::PragmaOnceUnitState;
1546
friend class ::PragmaOnce;
1547
friend class ::CMatchSyntax;
1549
#line 34 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Chain.h"
1554
Chain () { next = 0; }
1556
void select (Chain *c) { next = c; }
1557
Chain *select () const { return next; }
1562
next = next->select ();
1567
void insert (Chain *c) {
1577
// Chain with useage/max counter
1580
class ChainCnt : public Chain {
1586
ChainCnt (const char *n) : name (n) { max = use = 0; }
1588
cout << "max list " << name << ": " << max << endl;
1592
Chain *c = Chain::unlink ();
1598
void insert (Chain *c) {
1611
#endif /* __Chain_h__ */
1613
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashKey.h"
1618
#line 1619 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1620
class CCExprResolve;
1623
class WinImportHandler;
1627
class WinMemberExplSpec;
1628
class WinTypeKeywords;
1631
class ExtACBuilderCoupling;
1632
class ExtACSyntaxCoupling;
1634
class ExtACKeywords;
1636
class PragmaOnceUnitState;
1641
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashKey.h"
1642
class StrHashKey : public Chain {
1643
#line 1644 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1644
friend class ::CCExprResolve;
1645
friend class ::CExprResolve;
1646
friend class ::WinIfExists;
1647
friend class ::WinImportHandler;
1648
friend class ::WinMacros;
1649
friend class ::WinAsm;
1650
friend class ::WinDeclSpecs;
1651
friend class ::WinMemberExplSpec;
1652
friend class ::WinTypeKeywords;
1653
friend class ::WinFriend;
1654
friend class ::ExtAC;
1655
friend class ::ExtACBuilderCoupling;
1656
friend class ::ExtACSyntaxCoupling;
1657
friend class ::ExtACTree;
1658
friend class ::ExtACKeywords;
1659
friend class ::ExtGnu;
1660
friend class ::PragmaOnceUnitState;
1661
friend class ::PragmaOnce;
1662
friend class ::CMatchSyntax;
1664
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashKey.h"
1666
unsigned int m_Magic;
1670
StrHashKey () : m_Len (0), m_Str (0) {}
1673
StrHashKey (int m, const char *s, int l) :
1674
m_Magic (m), m_Len (l), m_Str (StrCol::dup (s, l)) {}
1675
~StrHashKey () { if (m_Str) delete[] m_Str; }
1677
unsigned int getMagic () const { return m_Magic; }
1678
unsigned int length () const { return m_Len; }
1679
const char *c_str () const { return m_Str; }
1685
#endif /* __StrHashKey_h__ */
1687
#line 23 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashTable.h"
1694
#line 1695 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1696
class CCExprResolve;
1699
class WinImportHandler;
1703
class WinMemberExplSpec;
1704
class WinTypeKeywords;
1707
class ExtACBuilderCoupling;
1708
class ExtACSyntaxCoupling;
1710
class ExtACKeywords;
1712
class PragmaOnceUnitState;
1717
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashTable.h"
1718
class StrHashTable {
1719
#line 1720 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1720
friend class ::CCExprResolve;
1721
friend class ::CExprResolve;
1722
friend class ::WinIfExists;
1723
friend class ::WinImportHandler;
1724
friend class ::WinMacros;
1725
friend class ::WinAsm;
1726
friend class ::WinDeclSpecs;
1727
friend class ::WinMemberExplSpec;
1728
friend class ::WinTypeKeywords;
1729
friend class ::WinFriend;
1730
friend class ::ExtAC;
1731
friend class ::ExtACBuilderCoupling;
1732
friend class ::ExtACSyntaxCoupling;
1733
friend class ::ExtACTree;
1734
friend class ::ExtACKeywords;
1735
friend class ::ExtGnu;
1736
friend class ::PragmaOnceUnitState;
1737
friend class ::PragmaOnce;
1738
friend class ::CMatchSyntax;
1740
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/StrHashTable.h"
1742
StrHashKey *_emptyKey;
1746
_emptyKey = insert ("");
1750
StrHashKey *empty () const { assert (_emptyKey); return _emptyKey; }
1751
StrHashKey *insert (const char *);
1752
void remove (StrHashKey *);
1755
enum { STRHASHTABLE_SIZE=0xffff };
1758
Chain m_Table[STRHASHTABLE_SIZE];
1760
StrHashKey *find (unsigned int, const char *, unsigned int);
1761
unsigned int hash (const char *, unsigned int &);
1767
#endif /* __StrHashTable_h__ */
1769
#line 23 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/DString.h"
1775
extern StrHashTable ___str_dict;
1778
#line 1779 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1780
class CCExprResolve;
1783
class WinImportHandler;
1787
class WinMemberExplSpec;
1788
class WinTypeKeywords;
1791
class ExtACBuilderCoupling;
1792
class ExtACSyntaxCoupling;
1794
class ExtACKeywords;
1796
class PragmaOnceUnitState;
1801
#line 30 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/DString.h"
1803
#line 1804 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1804
friend class ::CCExprResolve;
1805
friend class ::CExprResolve;
1806
friend class ::WinIfExists;
1807
friend class ::WinImportHandler;
1808
friend class ::WinMacros;
1809
friend class ::WinAsm;
1810
friend class ::WinDeclSpecs;
1811
friend class ::WinMemberExplSpec;
1812
friend class ::WinTypeKeywords;
1813
friend class ::WinFriend;
1814
friend class ::ExtAC;
1815
friend class ::ExtACBuilderCoupling;
1816
friend class ::ExtACSyntaxCoupling;
1817
friend class ::ExtACTree;
1818
friend class ::ExtACKeywords;
1819
friend class ::ExtGnu;
1820
friend class ::PragmaOnceUnitState;
1821
friend class ::PragmaOnce;
1822
friend class ::CMatchSyntax;
1824
#line 30 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/DString.h"
1830
m_Key = ___str_dict.empty ();
1833
DString (const char *s) {
1835
m_Key = ___str_dict.empty ();
1837
m_Key = ___str_dict.insert (s);
1841
DString (const DString &s) : m_Key (s.m_Key) {
1845
DString &operator = (const DString &s) {
1851
DString &operator = (const char *s) {
1853
m_Key = ___str_dict.empty ();
1855
m_Key = ___str_dict.insert (s);
1861
bool operator == (const DString &s) const {
1862
assert (m_Key && s.m_Key);
1863
return m_Key == s.m_Key;
1865
bool operator != (const DString &s) const {
1866
assert (m_Key && s.m_Key);
1867
return m_Key != s.m_Key;
1870
const char *c_str() const {
1872
return m_Key->c_str ();
1874
unsigned int length () const {
1876
return m_Key->length ();
1878
bool empty () const {
1880
return m_Key->length () == 0;
1882
unsigned int magic () const {
1884
return m_Key->getMagic ();
1887
operator const char *() const {
1892
static void clearDict() {
1893
___str_dict.clear ();
1900
#endif /* __DString_h__ */
1902
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FilenameInfo.h"
1907
#line 1908 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1909
class CCExprResolve;
1912
class WinImportHandler;
1916
class WinMemberExplSpec;
1917
class WinTypeKeywords;
1920
class ExtACBuilderCoupling;
1921
class ExtACSyntaxCoupling;
1923
class ExtACKeywords;
1925
class PragmaOnceUnitState;
1930
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FilenameInfo.h"
1931
class FilenameInfo : public RefCnt {
1932
#line 1933 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1933
friend class ::CCExprResolve;
1934
friend class ::CExprResolve;
1935
friend class ::WinIfExists;
1936
friend class ::WinImportHandler;
1937
friend class ::WinMacros;
1938
friend class ::WinAsm;
1939
friend class ::WinDeclSpecs;
1940
friend class ::WinMemberExplSpec;
1941
friend class ::WinTypeKeywords;
1942
friend class ::WinFriend;
1943
friend class ::ExtAC;
1944
friend class ::ExtACBuilderCoupling;
1945
friend class ::ExtACSyntaxCoupling;
1946
friend class ::ExtACTree;
1947
friend class ::ExtACKeywords;
1948
friend class ::ExtGnu;
1949
friend class ::PragmaOnceUnitState;
1950
friend class ::PragmaOnce;
1951
friend class ::CMatchSyntax;
1953
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FilenameInfo.h"
1960
FilenameInfo () : _path ((const char*)0), _root ((const char*)0) {}
1962
void name (const char *n);
1963
// void name (const DString &dsn) { _name = dsn; }
1964
const char *name () const { return _name.c_str (); }
1965
const char *path ();
1966
const char *root ();
1967
bool is_absolute () const;
1968
bool operator == (const FilenameInfo &rc) const {
1969
return _name == rc._name;
1976
#endif /* __filename_info_h__ */
1978
#line 26 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Filename.h"
1983
#line 1984 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
1985
class CCExprResolve;
1988
class WinImportHandler;
1992
class WinMemberExplSpec;
1993
class WinTypeKeywords;
1996
class ExtACBuilderCoupling;
1997
class ExtACSyntaxCoupling;
1999
class ExtACKeywords;
2001
class PragmaOnceUnitState;
2006
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Filename.h"
2007
class Filename : public SmartPtr, public Printable {
2008
#line 2009 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2009
friend class ::CCExprResolve;
2010
friend class ::CExprResolve;
2011
friend class ::WinIfExists;
2012
friend class ::WinImportHandler;
2013
friend class ::WinMacros;
2014
friend class ::WinAsm;
2015
friend class ::WinDeclSpecs;
2016
friend class ::WinMemberExplSpec;
2017
friend class ::WinTypeKeywords;
2018
friend class ::WinFriend;
2019
friend class ::ExtAC;
2020
friend class ::ExtACBuilderCoupling;
2021
friend class ::ExtACSyntaxCoupling;
2022
friend class ::ExtACTree;
2023
friend class ::ExtACKeywords;
2024
friend class ::ExtGnu;
2025
friend class ::PragmaOnceUnitState;
2026
friend class ::PragmaOnce;
2027
friend class ::CMatchSyntax;
2029
#line 29 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Filename.h"
2031
FilenameInfo *info () const { return (FilenameInfo*)data (); }
2035
Filename (const char *n) { name (n); }
2036
Filename &operator = (const char *n) { name (n); return *this; }
2037
bool operator ~ () const { return info () != 0; }
2038
void name (const char *n);
2039
const char *name () const;
2040
const char *path () const;
2041
const char *root () const;
2042
bool is_absolute () const;
2043
bool operator == (const Filename &f) const;
2044
bool operator != (const Filename &f) const { return !(*this == f); }
2045
virtual void print (ostream &os) const { if (info ()) os << name (); }
2051
#endif /* __filename_h__ */
2053
#line 38 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
2059
#line 2060 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2061
class CCExprResolve;
2064
class WinImportHandler;
2068
class WinMemberExplSpec;
2069
class WinTypeKeywords;
2072
class ExtACBuilderCoupling;
2073
class ExtACSyntaxCoupling;
2075
class ExtACKeywords;
2077
class PragmaOnceUnitState;
2082
#line 42 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
2084
#line 2085 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2085
friend class ::CCExprResolve;
2086
friend class ::CExprResolve;
2087
friend class ::WinIfExists;
2088
friend class ::WinImportHandler;
2089
friend class ::WinMacros;
2090
friend class ::WinAsm;
2091
friend class ::WinDeclSpecs;
2092
friend class ::WinMemberExplSpec;
2093
friend class ::WinTypeKeywords;
2094
friend class ::WinFriend;
2095
friend class ::ExtAC;
2096
friend class ::ExtACBuilderCoupling;
2097
friend class ::ExtACSyntaxCoupling;
2098
friend class ::ExtACTree;
2099
friend class ::ExtACKeywords;
2100
friend class ::ExtGnu;
2101
friend class ::PragmaOnceUnitState;
2102
friend class ::PragmaOnce;
2103
friend class ::CMatchSyntax;
2105
#line 42 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
2107
friend class SysCall;
2115
bool is_dir () const {
2117
return _S_IFDIR & _info.st_mode;
2119
return S_ISDIR (_info.st_mode);
2122
time_t modi_time () const { return _info.st_mtime; }
2123
int size () const { return _info.st_size; }
2129
DIR (long h) : _handle (h) {}
2133
typedef DIR *DirHandle;
2134
typedef FILE *FileHandle;
2139
#line 2140 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2141
class CCExprResolve;
2144
class WinImportHandler;
2148
class WinMemberExplSpec;
2149
class WinTypeKeywords;
2152
class ExtACBuilderCoupling;
2153
class ExtACSyntaxCoupling;
2155
class ExtACKeywords;
2157
class PragmaOnceUnitState;
2162
#line 74 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
2164
#line 2165 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2165
friend class ::CCExprResolve;
2166
friend class ::CExprResolve;
2167
friend class ::WinIfExists;
2168
friend class ::WinImportHandler;
2169
friend class ::WinMacros;
2170
friend class ::WinAsm;
2171
friend class ::WinDeclSpecs;
2172
friend class ::WinMemberExplSpec;
2173
friend class ::WinTypeKeywords;
2174
friend class ::WinFriend;
2175
friend class ::ExtAC;
2176
friend class ::ExtACBuilderCoupling;
2177
friend class ::ExtACSyntaxCoupling;
2178
friend class ::ExtACTree;
2179
friend class ::ExtACKeywords;
2180
friend class ::ExtGnu;
2181
friend class ::PragmaOnceUnitState;
2182
friend class ::PragmaOnce;
2183
friend class ::CMatchSyntax;
2185
#line 74 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/SysCall.h"
2187
static void printerror (ErrorSink *, const char *,
2188
const char * = (const char *)0);
2189
static void printerror (ErrorSink *, const char *, int);
2194
// create temporary file name, needs to be freed by caller
2195
static const char* mktemp (const char *prefix, ErrorSink * = (ErrorSink *)0);
2197
// open/create/close file with exclusive file locking
2198
static int open_excl (const char *, int, ErrorSink * = (ErrorSink *)0);
2199
static int create_excl (const char *, int, ErrorSink * = (ErrorSink *)0);
2200
static bool close_excl (int, ErrorSink * = (ErrorSink *)0);
2202
// open/create/close file
2203
static int open (const char *, int, ErrorSink * = (ErrorSink *)0);
2204
static int create (const char *, int, ErrorSink * = (ErrorSink *)0);
2205
static bool close (int, ErrorSink * = (ErrorSink *)0);
2207
// read from file descriptor
2208
static long read (int, void *, size_t, ErrorSink * = (ErrorSink *)0);
2211
static bool stat (const char *, FileInfo &, ErrorSink * = (ErrorSink *)0);
2212
static bool fstat (int, FileInfo &, ErrorSink * = (ErrorSink *)0);
2213
static char* readlink (const char*, char*, size_t, ErrorSink * = (ErrorSink *)0);
2215
// open/close file stream
2216
static FileHandle fopen (const char *, const char *, ErrorSink * = (ErrorSink *)0);
2217
static bool fclose (FileHandle, ErrorSink * = (ErrorSink *)0);
2219
// open/close directory stream
2220
static DirHandle opendir (const char *, ErrorSink * = (ErrorSink *)0);
2221
static bool closedir (DirHandle, ErrorSink * = (ErrorSink *)0);
2223
// read from directory stream
2224
static const char *readdir (DirHandle, ErrorSink * = (ErrorSink *)0);
2227
static bool chdir (const char *, ErrorSink * = (ErrorSink *)0);
2230
static bool mkdir (const char *, ErrorSink * = (ErrorSink *)0);
2232
// get current working directory
2233
static char *getcwd (char *, size_t, ErrorSink * = (ErrorSink *)0);
2236
static time_t time (time_t *, ErrorSink * = (ErrorSink *)0);
2238
// platform depended path handling
2239
static void MakeUnixPath (char*);
2240
static void MakeDosPath (char*);
2243
// normalize an absolute Win32 filename of an exisiting file
2244
static bool normalize (Filename filename, Filename &norm, ErrorSink *err);
2247
// return a canonical path name for an exisiting file
2248
static bool canonical (Filename filename, Filename &result, ErrorSink * = 0);
2254
#endif /* __SysCall_h__ */
2256
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileUnit.h"
2257
// This file is part of PUMA.
2258
// Copyright (C) 1999-2003 The PUMA developer team.
2260
// This program is free software; you can redistribute it and/or
2261
// modify it under the terms of the GNU General Public License as
2262
// published by the Free Software Foundation; either version 2 of
2263
// the License, or (at your option) any later version.
2265
// This program is distributed in the hope that it will be useful,
2266
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2267
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2268
// GNU General Public License for more details.
2270
// You should have received a copy of the GNU General Public
2271
// License along with this program; if not, write to the Free
2272
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2273
// MA 02111-1307 USA
2275
#ifndef __FileUnit__
2276
#define __FileUnit__
2278
// Special Unit for files. Knows its last save location and the
2279
// absolute path of the corresponding file.
2282
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileUnit.h"
2289
#line 2290 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2291
class CCExprResolve;
2294
class WinImportHandler;
2298
class WinMemberExplSpec;
2299
class WinTypeKeywords;
2302
class ExtACBuilderCoupling;
2303
class ExtACSyntaxCoupling;
2305
class ExtACKeywords;
2307
class PragmaOnceUnitState;
2312
#line 32 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileUnit.h"
2313
class FileUnit : public Unit {
2314
#line 2315 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2315
friend class ::CCExprResolve;
2316
friend class ::CExprResolve;
2317
friend class ::WinIfExists;
2318
friend class ::WinImportHandler;
2319
friend class ::WinMacros;
2320
friend class ::WinAsm;
2321
friend class ::WinDeclSpecs;
2322
friend class ::WinMemberExplSpec;
2323
friend class ::WinTypeKeywords;
2324
friend class ::WinFriend;
2325
friend class ::ExtAC;
2326
friend class ::ExtACBuilderCoupling;
2327
friend class ::ExtACSyntaxCoupling;
2328
friend class ::ExtACTree;
2329
friend class ::ExtACKeywords;
2330
friend class ::ExtGnu;
2331
friend class ::PragmaOnceUnitState;
2332
friend class ::PragmaOnce;
2333
friend class ::CMatchSyntax;
2335
#line 32 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileUnit.h"
2337
char *_lastLocation;
2338
char *_absolutePath;
2346
FileUnit (const List &);
2347
virtual ~FileUnit ();
2349
virtual void name (const char *);
2350
void setLocation (const char *);
2352
char *lastLocation () const;
2353
char *absolutePath () const;
2354
bool isFile () const;
2356
// Generates the absolute pathname to the file.
2357
static char *absolutePath (const char *);
2358
static char *resolvePath (const char *);
2360
// File belongs to given project?
2361
bool belongsTo (Project &);
2364
inline FileUnit::FileUnit () :
2366
_lastLocation ((char*)0),
2367
_absolutePath ((char*)0),
2371
inline FileUnit::FileUnit (Unit &unit) :
2373
_lastLocation ((char*)0),
2374
_absolutePath ((char*)0),
2378
inline FileUnit::FileUnit (const List &list) :
2380
_lastLocation ((char*)0),
2381
_absolutePath ((char*)0),
2385
inline FileUnit::~FileUnit ()
2386
{ if (_lastLocation) delete[] _lastLocation;
2387
if (_absolutePath) delete[] _absolutePath; }
2389
inline char *FileUnit::lastLocation () const
2390
{ return _lastLocation; }
2391
inline char *FileUnit::absolutePath () const
2392
{ return _absolutePath; }
2393
inline bool FileUnit::isFile () const
2399
#endif /* __FileUnit__ */
2401
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileSource.h"
2402
// This file is part of PUMA.
2403
// Copyright (C) 1999-2003 The PUMA developer team.
2405
// This program is free software; you can redistribute it and/or
2406
// modify it under the terms of the GNU General Public License as
2407
// published by the Free Software Foundation; either version 2 of
2408
// the License, or (at your option) any later version.
2410
// This program is distributed in the hope that it will be useful,
2411
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2412
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2413
// GNU General Public License for more details.
2415
// You should have received a copy of the GNU General Public
2416
// License along with this program; if not, write to the Free
2417
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2418
// MA 02111-1307 USA
2420
#ifndef __file_source_h__
2421
#define __file_source_h__
2424
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSink.h"
2425
// This file is part of PUMA.
2426
// Copyright (C) 1999-2003 The PUMA developer team.
2428
// This program is free software; you can redistribute it and/or
2429
// modify it under the terms of the GNU General Public License as
2430
// published by the Free Software Foundation; either version 2 of
2431
// the License, or (at your option) any later version.
2433
// This program is distributed in the hope that it will be useful,
2434
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2435
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2436
// GNU General Public License for more details.
2438
// You should have received a copy of the GNU General Public
2439
// License along with this program; if not, write to the Free
2440
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2441
// MA 02111-1307 USA
2443
#ifndef __error_sink_h__
2444
#define __error_sink_h__
2446
// This is an interface for classes that may be used to consume error
2447
// messages during a process where many errors can occur like parsing
2449
// The error information is handed over to the ErrorSink in stream-like
2450
// style. Different severities of errors are predefined and can be used
2451
// to classify error information that follows. Also a location can be
2452
// handed over to the ErrorSink to specify where the error was found
2453
// (filename, line, etc.). The error information itself can be of any
2454
// standard data type or anything that is "Printable".
2455
// Specializations of this class could either build and print error
2456
// messages or collect them for a later processing.
2459
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSeverity.h"
2460
// This file is part of PUMA.
2461
// Copyright (C) 1999-2003 The PUMA developer team.
2463
// This program is free software; you can redistribute it and/or
2464
// modify it under the terms of the GNU General Public License as
2465
// published by the Free Software Foundation; either version 2 of
2466
// the License, or (at your option) any later version.
2468
// This program is distributed in the hope that it will be useful,
2469
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2470
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2471
// GNU General Public License for more details.
2473
// You should have received a copy of the GNU General Public
2474
// License along with this program; if not, write to the Free
2475
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2476
// MA 02111-1307 USA
2478
#ifndef __error_severity_h__
2479
#define __error_severity_h__
2481
// Severity of errors: represented by a short integer and a text
2487
#line 2488 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2489
class CCExprResolve;
2492
class WinImportHandler;
2496
class WinMemberExplSpec;
2497
class WinTypeKeywords;
2500
class ExtACBuilderCoupling;
2501
class ExtACSyntaxCoupling;
2503
class ExtACKeywords;
2505
class PragmaOnceUnitState;
2510
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSeverity.h"
2511
class ErrorSeverity {
2512
#line 2513 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2513
friend class ::CCExprResolve;
2514
friend class ::CExprResolve;
2515
friend class ::WinIfExists;
2516
friend class ::WinImportHandler;
2517
friend class ::WinMacros;
2518
friend class ::WinAsm;
2519
friend class ::WinDeclSpecs;
2520
friend class ::WinMemberExplSpec;
2521
friend class ::WinTypeKeywords;
2522
friend class ::WinFriend;
2523
friend class ::ExtAC;
2524
friend class ::ExtACBuilderCoupling;
2525
friend class ::ExtACSyntaxCoupling;
2526
friend class ::ExtACTree;
2527
friend class ::ExtACKeywords;
2528
friend class ::ExtGnu;
2529
friend class ::PragmaOnceUnitState;
2530
friend class ::PragmaOnce;
2531
friend class ::CMatchSyntax;
2533
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSeverity.h"
2535
unsigned short _severity;
2539
ErrorSeverity (unsigned short s = 0, const char* t = (const char*)0) :
2540
_severity (s), _text (t) {}
2541
ErrorSeverity (const ErrorSeverity &s) :
2542
_severity (s._severity), _text (s._text) {}
2543
ErrorSeverity &operator =(const ErrorSeverity &s)
2544
{ _severity = s._severity; _text = s._text; return *this; }
2546
int operator < (const ErrorSeverity &s) const
2547
{ return _severity < s._severity; }
2548
int operator > (const ErrorSeverity &s) const
2549
{ return _severity > s._severity; }
2550
int operator <= (const ErrorSeverity &s) const
2551
{ return _severity < s._severity || _severity == s._severity; }
2552
int operator >= (const ErrorSeverity &s) const
2553
{ return _severity > s._severity || _severity == s._severity; }
2554
int operator == (const ErrorSeverity &s) const
2555
{ return _severity == s._severity; }
2556
int operator != (const ErrorSeverity &s) const
2557
{ return _severity != s._severity; }
2558
const char *text () const
2562
extern const ErrorSeverity sev_none;
2563
extern const ErrorSeverity sev_message;
2564
extern const ErrorSeverity sev_warning;
2565
extern const ErrorSeverity sev_error;
2566
extern const ErrorSeverity sev_fatal;
2571
#endif /* __error_severity_h__ */
2573
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Location.h"
2574
// This file is part of PUMA.
2575
// Copyright (C) 1999-2003 The PUMA developer team.
2577
// This program is free software; you can redistribute it and/or
2578
// modify it under the terms of the GNU General Public License as
2579
// published by the Free Software Foundation; either version 2 of
2580
// the License, or (at your option) any later version.
2582
// This program is distributed in the hope that it will be useful,
2583
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2584
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2585
// GNU General Public License for more details.
2587
// You should have received a copy of the GNU General Public
2588
// License along with this program; if not, write to the Free
2589
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2590
// MA 02111-1307 USA
2592
#ifndef __location_h__
2593
#define __location_h__
2596
#line 24 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Location.h"
2601
#line 2602 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2603
class CCExprResolve;
2606
class WinImportHandler;
2610
class WinMemberExplSpec;
2611
class WinTypeKeywords;
2614
class ExtACBuilderCoupling;
2615
class ExtACSyntaxCoupling;
2617
class ExtACKeywords;
2619
class PragmaOnceUnitState;
2624
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Location.h"
2626
#line 2627 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2627
friend class ::CCExprResolve;
2628
friend class ::CExprResolve;
2629
friend class ::WinIfExists;
2630
friend class ::WinImportHandler;
2631
friend class ::WinMacros;
2632
friend class ::WinAsm;
2633
friend class ::WinDeclSpecs;
2634
friend class ::WinMemberExplSpec;
2635
friend class ::WinTypeKeywords;
2636
friend class ::WinFriend;
2637
friend class ::ExtAC;
2638
friend class ::ExtACBuilderCoupling;
2639
friend class ::ExtACSyntaxCoupling;
2640
friend class ::ExtACTree;
2641
friend class ::ExtACKeywords;
2642
friend class ::ExtGnu;
2643
friend class ::PragmaOnceUnitState;
2644
friend class ::PragmaOnce;
2645
friend class ::CMatchSyntax;
2647
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Location.h"
2654
Location () : _filename (), _line (0), _column (0) {}
2655
Location (Filename f, int l, int c = 0) { setup (f, l, c); }
2656
void setup (Filename f, int l, int c = 0) {
2661
const Filename &filename () const { return _filename; }
2662
int line () const { return _line; }
2663
int column () const { return _column; }
2664
bool operator == (const Location &l) const {
2665
return filename () == l.filename () && line () == l.line () &&
2666
column () == l.column ();
2668
bool operator != (const Location &l) const { return ! (*this == l); }
2669
bool operator < (const Location &l) const {
2670
// TODO: does it make sense to compare the filenames? better assert?
2671
if (filename () != l.filename ())
2673
return line () < l.line () && column () < l.column ();
2677
inline std::ostream &operator << (std::ostream &os, const Location &loc) {
2678
#ifdef VISUAL_STUDIO
2679
os << loc.filename () << "(" << loc.line () << ")";
2681
os << loc.filename () << ":" << loc.line ();
2687
#endif /* __location_h__ */
2689
#line 38 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSink.h"
2694
#line 2695 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2696
class CCExprResolve;
2699
class WinImportHandler;
2703
class WinMemberExplSpec;
2704
class WinTypeKeywords;
2707
class ExtACBuilderCoupling;
2708
class ExtACSyntaxCoupling;
2710
class ExtACKeywords;
2712
class PragmaOnceUnitState;
2717
#line 41 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSink.h"
2719
#line 2720 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2720
friend class ::CCExprResolve;
2721
friend class ::CExprResolve;
2722
friend class ::WinIfExists;
2723
friend class ::WinImportHandler;
2724
friend class ::WinMacros;
2725
friend class ::WinAsm;
2726
friend class ::WinDeclSpecs;
2727
friend class ::WinMemberExplSpec;
2728
friend class ::WinTypeKeywords;
2729
friend class ::WinFriend;
2730
friend class ::ExtAC;
2731
friend class ::ExtACBuilderCoupling;
2732
friend class ::ExtACSyntaxCoupling;
2733
friend class ::ExtACTree;
2734
friend class ::ExtACKeywords;
2735
friend class ::ExtGnu;
2736
friend class ::PragmaOnceUnitState;
2737
friend class ::PragmaOnce;
2738
friend class ::CMatchSyntax;
2740
#line 41 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorSink.h"
2743
virtual ~ErrorSink () {}
2744
virtual ErrorSink &operator << (const char *) = 0;
2745
virtual ErrorSink &operator << (long) = 0;
2746
virtual ErrorSink &operator << (unsigned) = 0;
2747
virtual ErrorSink &operator << (int) = 0;
2748
virtual ErrorSink &operator << (short) = 0;
2749
virtual ErrorSink &operator << (char) = 0;
2750
virtual ErrorSink &operator << (double) = 0;
2751
virtual ErrorSink &operator << (const ErrorSeverity &) = 0;
2752
virtual ErrorSink &operator << (Location) = 0;
2753
virtual ErrorSink &operator << (const Printable &) = 0;
2754
virtual ErrorSink &operator << (void (*f)(ErrorSink &)) = 0;
2755
virtual void endMessage () = 0;
2758
void endMessage (ErrorSink &);
2763
#endif /* __error_sink_h__ */
2765
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FdSource.h"
2766
// This file is part of PUMA.
2767
// Copyright (C) 1999-2003 The PUMA developer team.
2769
// This program is free software; you can redistribute it and/or
2770
// modify it under the terms of the GNU General Public License as
2771
// published by the Free Software Foundation; either version 2 of
2772
// the License, or (at your option) any later version.
2774
// This program is distributed in the hope that it will be useful,
2775
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2776
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2777
// GNU General Public License for more details.
2779
// You should have received a copy of the GNU General Public
2780
// License along with this program; if not, write to the Free
2781
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2782
// MA 02111-1307 USA
2784
#ifndef __fd_source_h__
2785
#define __fd_source_h__
2788
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FdSource.h"
2793
#line 2794 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2795
class CCExprResolve;
2798
class WinImportHandler;
2802
class WinMemberExplSpec;
2803
class WinTypeKeywords;
2806
class ExtACBuilderCoupling;
2807
class ExtACSyntaxCoupling;
2809
class ExtACKeywords;
2811
class PragmaOnceUnitState;
2816
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FdSource.h"
2817
class FdSource : public Source {
2818
#line 2819 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2819
friend class ::CCExprResolve;
2820
friend class ::CExprResolve;
2821
friend class ::WinIfExists;
2822
friend class ::WinImportHandler;
2823
friend class ::WinMacros;
2824
friend class ::WinAsm;
2825
friend class ::WinDeclSpecs;
2826
friend class ::WinMemberExplSpec;
2827
friend class ::WinTypeKeywords;
2828
friend class ::WinFriend;
2829
friend class ::ExtAC;
2830
friend class ::ExtACBuilderCoupling;
2831
friend class ::ExtACSyntaxCoupling;
2832
friend class ::ExtACTree;
2833
friend class ::ExtACKeywords;
2834
friend class ::ExtGnu;
2835
friend class ::PragmaOnceUnitState;
2836
friend class ::PragmaOnce;
2837
friend class ::CMatchSyntax;
2839
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FdSource.h"
2844
FdSource () : _fd (-1) {}
2845
FdSource (int fdesc) : _fd (fdesc) {}
2846
virtual ~FdSource () {}
2848
virtual int read (char *dest, int n)
2849
{ return SysCall::read (_fd, dest, n); }
2851
void fd (int fdesc) { _fd = fdesc; }
2852
int fd () { return _fd; }
2856
return (SysCall::fstat (_fd, fileinfo)) ? fileinfo.size () : -1;
2863
#endif /* __fd_source_h__ */
2865
#line 27 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileSource.h"
2872
#line 2873 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2874
class CCExprResolve;
2877
class WinImportHandler;
2881
class WinMemberExplSpec;
2882
class WinTypeKeywords;
2885
class ExtACBuilderCoupling;
2886
class ExtACSyntaxCoupling;
2888
class ExtACKeywords;
2890
class PragmaOnceUnitState;
2895
#line 32 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileSource.h"
2896
class FileSource : public FdSource {
2897
#line 2898 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2898
friend class ::CCExprResolve;
2899
friend class ::CExprResolve;
2900
friend class ::WinIfExists;
2901
friend class ::WinImportHandler;
2902
friend class ::WinMacros;
2903
friend class ::WinAsm;
2904
friend class ::WinDeclSpecs;
2905
friend class ::WinMemberExplSpec;
2906
friend class ::WinTypeKeywords;
2907
friend class ::WinFriend;
2908
friend class ::ExtAC;
2909
friend class ::ExtACBuilderCoupling;
2910
friend class ::ExtACSyntaxCoupling;
2911
friend class ::ExtACTree;
2912
friend class ::ExtACKeywords;
2913
friend class ::ExtGnu;
2914
friend class ::PragmaOnceUnitState;
2915
friend class ::PragmaOnce;
2916
friend class ::CMatchSyntax;
2918
#line 32 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/FileSource.h"
2921
FileSource (const char *name, ErrorSink *err = (ErrorSink*)0)
2922
{ fd (SysCall::open (name, O_RDONLY, err)); }
2924
{ SysCall::close (fd ()); }
2926
virtual int read (char *dest, int n)
2927
{ return FdSource::read (dest, n); }
2933
#endif /* __file_source_h__ */
2935
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorStream.h"
2936
// This file is part of PUMA.
2937
// Copyright (C) 1999-2003 The PUMA developer team.
2939
// This program is free software; you can redistribute it and/or
2940
// modify it under the terms of the GNU General Public License as
2941
// published by the Free Software Foundation; either version 2 of
2942
// the License, or (at your option) any later version.
2944
// This program is distributed in the hope that it will be useful,
2945
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2946
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2947
// GNU General Public License for more details.
2949
// You should have received a copy of the GNU General Public
2950
// License along with this program; if not, write to the Free
2951
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2952
// MA 02111-1307 USA
2954
#ifndef __error_stream_h__
2955
#define __error_stream_h__
2957
// An ErrorStream is a special ErrorSink that prints out an error message
2958
// as soon as it complete. It also stores the maximum error severity.
2959
// The ErrorStream can be reset to it's initial state.
2963
#line 30 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorStream.h"
2964
using namespace std;
2970
#line 2971 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2972
class CCExprResolve;
2975
class WinImportHandler;
2979
class WinMemberExplSpec;
2980
class WinTypeKeywords;
2983
class ExtACBuilderCoupling;
2984
class ExtACSyntaxCoupling;
2986
class ExtACKeywords;
2988
class PragmaOnceUnitState;
2993
#line 35 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorStream.h"
2994
class ErrorStream : public ErrorSink {
2995
#line 2996 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
2996
friend class ::CCExprResolve;
2997
friend class ::CExprResolve;
2998
friend class ::WinIfExists;
2999
friend class ::WinImportHandler;
3000
friend class ::WinMacros;
3001
friend class ::WinAsm;
3002
friend class ::WinDeclSpecs;
3003
friend class ::WinMemberExplSpec;
3004
friend class ::WinTypeKeywords;
3005
friend class ::WinFriend;
3006
friend class ::ExtAC;
3007
friend class ::ExtACBuilderCoupling;
3008
friend class ::ExtACSyntaxCoupling;
3009
friend class ::ExtACTree;
3010
friend class ::ExtACKeywords;
3011
friend class ::ExtGnu;
3012
friend class ::PragmaOnceUnitState;
3013
friend class ::PragmaOnce;
3014
friend class ::CMatchSyntax;
3016
#line 35 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/ErrorStream.h"
3019
ErrorSeverity _max_severity;
3020
ErrorSeverity _curr_severity;
3022
bool _have_location;
3023
std::ostringstream *_msg;
3030
ErrorStream (std::ostream &s = cerr) : _ostream (&s), _msg ((std::ostringstream*)0)
3031
{ reset (); _silently = false; }
3032
virtual ~ErrorStream () { delete _msg; }
3034
ErrorStream &operator << (const char *);
3035
ErrorStream &operator << (long);
3036
ErrorStream &operator << (unsigned);
3037
ErrorStream &operator << (int);
3038
ErrorStream &operator << (short);
3039
ErrorStream &operator << (char);
3040
ErrorStream &operator << (double);
3041
ErrorStream &operator << (const ErrorSeverity &);
3042
ErrorStream &operator << (Location);
3043
ErrorStream &operator << (const Printable &);
3044
ErrorStream &operator << (void (*f)(ErrorSink &));
3051
ErrorSeverity severity () const { return _max_severity; }
3057
#endif /* __error_stream_h__ */
3059
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3060
// This file is part of PUMA.
3061
// Copyright (C) 1999-2003 The PUMA developer team.
3063
// This program is free software; you can redistribute it and/or
3064
// modify it under the terms of the GNU General Public License as
3065
// published by the Free Software Foundation; either version 2 of
3066
// the License, or (at your option) any later version.
3068
// This program is distributed in the hope that it will be useful,
3069
// but WITHOUT ANY WARRANTY; without even the implied warranty of
3070
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3071
// GNU General Public License for more details.
3073
// You should have received a copy of the GNU General Public
3074
// License along with this program; if not, write to the Free
3075
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3076
// MA 02111-1307 USA
3078
#ifndef __UnitManager__
3079
#define __UnitManager__
3081
// Class UnitManager helps you to have control of all units built.
3084
#line 25 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3088
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3089
using namespace std;
3091
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3100
#line 3101 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
3102
class CCExprResolve;
3105
class WinImportHandler;
3109
class WinMemberExplSpec;
3110
class WinTypeKeywords;
3113
class ExtACBuilderCoupling;
3114
class ExtACSyntaxCoupling;
3116
class ExtACKeywords;
3118
class PragmaOnceUnitState;
3123
#line 38 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3125
#line 3126 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
3126
friend class ::CCExprResolve;
3127
friend class ::CExprResolve;
3128
friend class ::WinIfExists;
3129
friend class ::WinImportHandler;
3130
friend class ::WinMacros;
3131
friend class ::WinAsm;
3132
friend class ::WinDeclSpecs;
3133
friend class ::WinMemberExplSpec;
3134
friend class ::WinTypeKeywords;
3135
friend class ::WinFriend;
3136
friend class ::ExtAC;
3137
friend class ::ExtACBuilderCoupling;
3138
friend class ::ExtACSyntaxCoupling;
3139
friend class ::ExtACTree;
3140
friend class ::ExtACKeywords;
3141
friend class ::ExtGnu;
3142
friend class ::PragmaOnceUnitState;
3143
friend class ::PragmaOnce;
3144
friend class ::CMatchSyntax;
3146
#line 38 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3149
typedef map<string, Unit*> UMap;
3151
ErrorStream *_err; // For error messages.
3152
list<Unit*> _nonames; // Noname units list.
3153
mutable UMap _umap; // Named units, map supports fast lookup by name
3154
typedef UMap::value_type UMapPair;
3155
Tokenizer *_tokenizer; // File scanner.
3158
UnitManager (ErrorStream &err) : _err (&err), _tokenizer (0) {}
3160
// Destructor: Delete all units.
3161
virtual ~UnitManager ();
3163
// Get the unit hash table.
3164
UMap &getTable () const { return _umap; }
3165
typedef UMap::iterator UMapIter;
3167
// Get/Set the file scanner that is used by newUnit
3168
Tokenizer *tokenizer () const { return _tokenizer; }
3169
void tokenizer (Tokenizer *t) { _tokenizer = t; }
3171
// Add a unit to manager.
3172
void addUnit (Unit *unit);
3174
// Remove (and destroy) a unit from hash table. If the name
3175
// is NULL remove all (but not the nonames).
3176
void removeUnit (const char *name = (const char*) 0, bool = false,
3177
bool destroy = true) const;
3179
// Empty a unit. Don't remove from hash table.
3180
// Preserve the last save location information.
3181
void closeUnit (const char *name = (const char*) 0, bool = false) const;
3183
// Build and add a new unit.
3184
Unit *newUnit (const char *, Source *in = (Source*) 0, bool = false);
3186
// Get a unit by name.
3187
Unit *getUnit (const char *name, bool = false) const;
3189
// Print given unit to the given outstream. If no
3190
// name is given, print all units.
3191
void print (const char *name = (const char*) 0, bool = false,
3192
ostream &out = cout) const;
3194
// Destroy all noname units.
3195
void removeNonames ();
3197
// Initialize the unit manager and the managed
3198
// units for the next parse process.
3200
#line 3201 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
3201
public: __attribute__((always_inline)) inline void __exec_old_init();
3203
#line 90 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/UnitManager.h"
3210
#endif /* __UnitManager__ */
3212
#line 1 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Tokenizer.h"
3213
// This file is part of PUMA.
3214
// Copyright (C) 1999-2003 The PUMA developer team.
3216
// This program is free software; you can redistribute it and/or
3217
// modify it under the terms of the GNU General Public License as
3218
// published by the Free Software Foundation; either version 2 of
3219
// the License, or (at your option) any later version.
3221
// This program is distributed in the hope that it will be useful,
3222
// but WITHOUT ANY WARRANTY; without even the implied warranty of
3223
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3224
// GNU General Public License for more details.
3226
// You should have received a copy of the GNU General Public
3227
// License along with this program; if not, write to the Free
3228
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3229
// MA 02111-1307 USA
3231
#ifndef __Tokenizer_h__
3232
#define __Tokenizer_h__
3234
// Tokenizer interface. Tokenizer read input from a "Source" and
3235
// form tokens, which used to fill a "Unit".
3238
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Tokenizer.h"
3243
#line 3244 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
3245
class CCExprResolve;
3248
class WinImportHandler;
3252
class WinMemberExplSpec;
3253
class WinTypeKeywords;
3256
class ExtACBuilderCoupling;
3257
class ExtACSyntaxCoupling;
3259
class ExtACKeywords;
3261
class PragmaOnceUnitState;
3266
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Tokenizer.h"
3268
#line 3269 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step2/src/UnitManager.cc"
3269
friend class ::CCExprResolve;
3270
friend class ::CExprResolve;
3271
friend class ::WinIfExists;
3272
friend class ::WinImportHandler;
3273
friend class ::WinMacros;
3274
friend class ::WinAsm;
3275
friend class ::WinDeclSpecs;
3276
friend class ::WinMemberExplSpec;
3277
friend class ::WinTypeKeywords;
3278
friend class ::WinFriend;
3279
friend class ::ExtAC;
3280
friend class ::ExtACBuilderCoupling;
3281
friend class ::ExtACSyntaxCoupling;
3282
friend class ::ExtACTree;
3283
friend class ::ExtACKeywords;
3284
friend class ::ExtGnu;
3285
friend class ::PragmaOnceUnitState;
3286
friend class ::PragmaOnce;
3287
friend class ::CMatchSyntax;
3289
#line 31 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/inc/Puma/Tokenizer.h"
3292
virtual ~Tokenizer () {}
3293
virtual void fill_unit (Source &in, Unit &unit) = 0;
3299
#endif /* __Tokenizer_h__ */
3301
#line 28 "/tmp/tmp.KxXqa14641/aspectc++.svn20080409/Puma/gen-release/step1/src/UnitManager.cc"
28
3302
#include <assert.h>