Annotation of parser3/src/main/pa_symbols.C, revision 1.2
1.1 moko 1: /** @file
2: Parser: static symbols cache implementation.
3: Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)
4: */
5:
1.2 ! moko 6: #include "pa_symbols.h"
! 7: #include "pa_vstring.h"
1.1 moko 8:
1.2 ! moko 9: volatile const char * IDENT_PA_SYMBOLS_C="$Id: pa_symbols.C,v 1.1 2016/05/24 11:55:14 moko Exp $" IDENT_PA_SYMBOLS_H;
1.1 moko 10:
11: const String *Symbols::result=Symbols::instance().add("result");
12: const String *Symbols::caller=Symbols::instance().add("caller");
13: const String *Symbols::self=Symbols::instance().add("self");
14:
15: void Symbols::add(const String &astring){
16: put_dont_replace(astring,new VString(astring));
17: }
18:
19: const String *Symbols::add(const char *astring){
20: const String *result=new String(astring);
21: put(*result,new VString(*result));
22: return result;
23: }
24:
25: Symbols &Symbols::instance(){
26: static Symbols singleton;
27: return singleton;
28: }
E-mail: