Annotation of parser3/src/include/pa_symbols.h, revision 1.2
1.1 moko 1: /** @file
2: Parser: static symbols cache.
3:
4: Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)
5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
6: */
7:
8: #ifndef PA_SYMBOLS_H
9: #define PA_SYMBOLS_H
10:
1.2 ! moko 11: #define IDENT_PA_SYMBOLS_H "$Id: pa_symbols.h,v 1.1 2016/05/24 11:55:13 moko Exp $"
1.1 moko 12:
13: #include "pa_common.h"
14:
1.2 ! moko 15: // cache symbols for faster comparation
! 16: #define SYMBOLS_CACHING
! 17:
! 18: #ifdef SYMBOLS_CACHING
! 19: #define SYMBOLS_EQ(a,b) (&(a)==&(b)) // pointer comparation
! 20: #else
! 21: #define SYMBOLS_EQ(a,b) ((a)==(b)) // string comparation
! 22: #endif
! 23:
1.1 moko 24: class Symbols: public HashStringValue{
25: public:
26:
1.2 ! moko 27: static const String result;
! 28: static const String caller;
! 29: static const String self;
! 30:
! 31: #ifdef SYMBOLS_CACHING
1.1 moko 32: void add(const String &astring);
1.2 ! moko 33: void set(const String &astring);
1.1 moko 34:
35: static Symbols &instance();
1.2 ! moko 36: static void init();
! 37: #endif
1.1 moko 38:
39: };
40:
1.2 ! moko 41: #ifdef SYMBOLS_CACHING
! 42: extern Symbols *symbols;
! 43: #endif
! 44:
1.1 moko 45: #endif
E-mail: