File: CTPP2Compiler.hpp

package info (click to toggle)
ctpp2 2.8.3-20.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,548 kB
  • sloc: cpp: 21,074; ansic: 413; makefile: 76; php: 24; perl: 20; sh: 4
file content (624 lines) | stat: -rw-r--r-- 21,174 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
/*-
 * Copyright (c) 2004 - 2011 CTPP Team
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the CTPP Team nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *      CTPP2Compiler.hpp
 *
 * $CTPP$
 */
#ifndef _CTPP2_COMPILER_HPP__
#define _CTPP2_COMPILER_HPP__ 1

/**
  @file CTPP2Compiler.hpp
  @brief CTPP2 temlate-to-bytecode compiler
*/

#include "CTPP2SymbolTable.hpp"
#include "CTPP2Syntax.h"
#include "CTPP2VMDebugInfo.hpp"
#include "CTPP2VMOpcodeCollector.hpp"

#include "STLMap.hpp"
#include "STLString.hpp"

namespace CTPP // C++ Template Engine
{
// FWD
class HashTable;
class StaticText;
class StaticData;
class CTPP2Parser;

/**
  @class CTPP2Compiler CTPP2Parser.hpp <CTPP2Parser.hpp>
  @brief CTRPP2 compiler
*/
class CTPP2DECL CTPP2Compiler
{
public:
	/**
	  @brief Constructor
	  @param oIVMOpcodeCollector - code segment collector
	  @param oISyscalls - syscalls segment
	  @param oIStaticData - static data segment
	  @param oIStaticText - static text segment
	  @param oIHashTable - hash table
	*/
	CTPP2Compiler(VMOpcodeCollector  & oIVMOpcodeCollector,
	              StaticText         & oISyscalls,
	              StaticData         & oIStaticData,
	              StaticText         & oIStaticText,
	              HashTable          & oIHashTable);

	/**
	  @brief Store template source name
	  @param szName -  name
	  @param iNameLength - name length
	  @return Name Id in static text segment, or -1 if any error occured
	*/
	INT_32 StoreSourceName(CCHAR_P        szName,
	                       const UINT_32  iNameLength);

	/**
	  @brief  Send variable to standard output collector
	  @param oDebugInfo - debug information object
	*/
	INT_32 OutputVariable(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Send text data to standard output collector
	  @param vBuffer - data
	  @param iBufferLength - data size
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OutputStaticData(CCHAR_P              vBuffer,
	                        const UINT_32        iBufferLength,
	                        const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Send integer value to standard output collector
	  @param iData - value to print
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OutputStaticData(const INT_64       & iData,
	                        const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Send floating point value to standard output collector
	  @param sData - value to print
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OutputStaticData(const W_FLOAT      & sData,
	                        const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Change visibility scope of CDT data (for ARRAY iterating)
	  @param szScopeName - ARRAY name
	  @param iScopeNameLength - Length of ARRAY name
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ChangeScope(CCHAR_P              szScopeName,
	                   const UINT_32        iScopeNameLength,
	                   const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Reset scope to previous CDT data (for ARRAY iterating)
	  @param iIP - instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ResetScope(const UINT_32        iIP,
	                  const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Execute system call such as HREF_PARAM, FORM_PARAM, etc
	  @param szSyscallName - syscall name
	  @param iSyscallNameLength - Length of syscall name
	  @param iArgNum - number of arguments
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ExecuteSyscall(CCHAR_P              szSyscallName,
	                      const UINT_32        iSyscallNameLength,
	                      const UINT_32        iArgNum,
	                      const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Prepare before push hash or array variable
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PreparePushComplexVariable(const VMDebugInfo & oDebugInfo);

	/**
	  @brief Clear after push hash or array variable
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ClearPushComplexVariable(const VMDebugInfo & oDebugInfo);

	/**
	  @brief Push block's variable into stack
	  @param iIdx - stack position
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushBlockVariable(const UINT_32 iIdx,
	                         const VMDebugInfo & oDebugInfo = VMDebugInfo());

    /**
      @brief Prepare local scope for searching variable
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
    */
    INT_32 PrepareLocalScope(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Push variable into stack
	  @param szVariableName - variable name
	  @param iVariableNameLength - Length of variable name
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushVariable(CCHAR_P              szVariableName,
	                    const UINT_32        iVariableNameLength,
	                    const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Push integer value into stack
	  @param iVariable - value to push
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushInt(const INT_64       & iVariable,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Push Float value into stack
	  @param dVariable - value to push
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushFloat(const W_FLOAT      & dVariable,
	                 const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Push string variable into stack
	  @param szData - data
	  @param iDataLength - data length
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushString(CCHAR_P              szData,
	                  const UINT_32        iDataLength,
	                  const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Pop variable from stack
	  @param iVars - number of variables to clear from stack
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PopVariable(const INT_32         iVars = 1,
	                   const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Check existence of stack variable
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ExistStackVariable(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Check existence of AR register variable
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ExistARReg(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Call block by name
	  @param sBlockName - block name
	  @param bIsVariable - is true if block name is variable, not plain text
	  @param iArgCount - number of arguments
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 CallBlock(const STLW::string   & sBlockName,
	                 const bool           & bIsVariable,
	                 const UINT_32          iArgCount,
	                 const VMDebugInfo    & oDebugInfo = VMDebugInfo());

	/**
	  @brief Start of block
	  @param sBlockName - block name
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 StartBlock(const STLW::string  & sBlockName,
	                  const VMDebugInfo   & oDebugInfo = VMDebugInfo());

	/**
	  @brief End of block
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 EndBlock(const UINT_32 iDepth, const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Prepare call block
	  @param oDebugInfo - debug information object
	*/
	void PrepareCallBlock(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	// ////////////////////////////////////////////////////////////////////////////////

	/**
	  @brief Get system call by id
	  @param szSyscallName - syscall name
	  @param iSyscallNameLength - Length of syscall name
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 GetSyscallId(CCHAR_P         szSyscallName,
	                    const UINT_32   iSyscallNameLength);

	/**
	  @brief Get last instruction number
	*/
	UINT_32 GetCodeSize() const;

	/**
	  @brief Get instruction by instruction number
	  @param iIP - instruction number
	  @return pointer to instruction or NULL if instruction does not exist
	*/
	VMInstruction * GetInstruction(const UINT_32   iIP);

	/**
	  @brief Remove last instruction from code segment
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RemoveInstruction();

	/**
	  @brief Addition
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpAdd(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Substraction
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpSub(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Multiplication
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpMul(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Dividion
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpDiv(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Integer dividion
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpIDiv(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief MOD
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpMod(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Negation
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpNeg(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Logical Negation
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpNot(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Comparison
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpCmp(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief String comparison
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 OpSCmp(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Store variable in scope
	  @param sNS - namespace
	  @param oDebugInfo - debug information object
	  @return Variable scope Id
	*/
	INT_32 StoreScopedVariable(CCHAR_P              szNS,
	                           const UINT_32        iNSLength,
	                           const VMDebugInfo  & oDebugInfo);

	/**
	  @brief Push variable into stack
	  @param szVariableName - variable name
	  @param iVariableNameLength - variable name length
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushScopedVariable(CCHAR_P              szName,
	                          const UINT_32        iNameLength,
	                          CCHAR_P              szFullVariable,
	                          const UINT_32        iFullVariableLength,
	                          const VMDebugInfo  & oDebugInfo);

	/**
	  @brief Push variable on stack into stack
	  @param iStackPos - stack position
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 PushStackVariable(const INT_32         iStackPos,
	                         const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Indirect call
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 IndirectCall(const VMDebugInfo  & oDebugInfo);

	/**
	  @brief Unconditional jump
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 UncondJump(const UINT_32        iIP,
	                  const VMDebugInfo  & oDebugInfo = VMDebugInfo());
	/**
	  @brief Jump if NOT Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 NEJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 EQJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Greater
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 GTJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Greater Or Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 GEJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Less
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 LTJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Less Or Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 LEJump(const UINT_32        iIP,
	              const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Unconditional jump
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RUncondJump(const UINT_32        iIP,
	                   const VMDebugInfo  & oDebugInfo = VMDebugInfo());
	/**
	  @brief Jump if NOT Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RNEJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 REQJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Greater
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RGTJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Greater Or Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RGEJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Less
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RLTJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Jump if Less Or Equal
	  @param iIP - new instruction pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 RLEJump(const UINT_32        iIP,
	               const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Clear stack
	  @param iStackPointer - stack pointer
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 ClearStack(const UINT_32        iStackPointer = 0,
	                  const VMDebugInfo  & oDebugInfo = VMDebugInfo());

	/**
	  @brief Stop execution
	  @param oDebugInfo - debug information object
	  @return instruction pointer if success, -1 if any error occured
	*/
	INT_32 Halt(const VMDebugInfo & oDebugInfo = VMDebugInfo());

	/**
	  @brief Decrease stack depth
	*/
	void DecrDepth();

	/**
	  @bref Increase stack depth
	*/
	void IncrDepth();

	/**
	  @brief A destructor
	*/
	~CTPP2Compiler() throw();

private:
	friend class CTPP2Parser;

	struct SymbolTableRec
	{
		/** Relative depth of stack */
		UINT_32         stack_depth;
		/** Scope number            */
		UINT_32         scope_number;

		inline SymbolTableRec(UINT_32  iStackDepth = 0,
		                      UINT_32  iScopeNumber = 0): stack_depth(iStackDepth),
		                                                  scope_number(iScopeNumber)
		{ ;; }
	};

	/** Current stack usage factor */
	UINT_32                            iStackDepth;
	UINT_32                            iScopeNumber;
	/** RRegisters are dirty; need to */
	bool                               bRegsAreDirty;

	/** Symbol table               */
	SymbolTable<SymbolTableRec>        oSymbolTable;
	/** Opcodes collector          */
	VMOpcodeCollector                & oVMOpcodeCollector;
	/** Syscalls                   */
	StaticText                       & oSyscalls;
	/** Static data segment        */
	StaticData                       & oStaticData;
	/** Static text segment        */
	StaticText                       & oStaticText;
	/** Hash table for calls       */
	HashTable                        & oHashTable;

	/** Syscall cache              */
	STLW::map<STLW::string,  UINT_32>  mSyscalls;
	/** Id of stored 0 to compare  */
	UINT_32                            iZeroId;
	/** Id of stored 1 to compare  */
	UINT_32                            iOneId;
	/** Current block stack depth  */
	UINT_32                            iCurrBlockStackDepth;
	/** Saved stack depths for blocks */
	STLW::vector<UINT_32>              vSavedStackDepths;
};

} // namespace CTPP
#endif // _CTPP2_COMPILER_H__
// End.