YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
SContext.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2012 - 2013.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #ifndef NPL_INC_SContext_h_
29 #define NPL_INC_SContext_h_ 1
30 
31 #include "NPL/Lexical.h"
32 #include "YSLib/Core/ValueNode.h"
33 #include "YSLib/Service/yftext.h"
34 
36 
37 
38 
39 using YSLib::TextFile;
40 using YSLib::ValueNode;
42 
43 typedef list<string> TokenList;
44 typedef TokenList::iterator TLIter;
45 typedef TokenList::const_iterator TLCIter;
46 
47 
53 {
54 private:
56 
57 public:
58  Session(const string&);
60  Session(const TextFile&);
61  DefGetter(const, TokenList, TokenList, Tokenize(llex.Literalize()))
62 };
63 
64 
69 YSL_BEGIN_NAMESPACE(SContext)
70 
71 
80 YF_API TLCIter
81 Validate(TLCIter b, TLCIter e);
82 
93 YF_API TLCIter
94 Reduce(ValueNode& node, TLCIter b, TLCIter e);
95 
96 
102 YF_API void
103 Analyze(ValueNode&, const TokenList&);
104 YF_API void
105 Analyze(ValueNode&, const Session&);
106 YF_API void
107 Analyze(ValueNode&, const string&);
108 template<typename _type>
109 ValueNode
110 Analyze(const _type& arg)
111 {
112  ValueNode root;
113 
114  Analyze(root, arg);
115 
116  return root;
117 }
119 
120 YSL_END_NAMESPACE(SContext)
121 
123 
124 #endif
125