InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CHMLFiltTokenisor.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef _CHMLFiltTokenisor_H_
25 #define _CHMLFiltTokenisor_H_
26 
27 
30 typedef PMString TokenValue;
31 
32 
37 enum Token_t
38 {
43 
72  // additional tokens for CJK features (not recognised in main import provider, Apr 2003: IRP)
83 };
84 
85 // string equivalents of the token typess of (see enum Token_t above)
86 #define TOKENHEAD PMString("<CHML>")
87 #define TOKENSIZE PMString("<s ")
88 #define TOKENSTARTBOLD PMString("<b>")
89 #define TOKENENDBOLD PMString("</b>")
90 #define TOKENSTARTUNDERLINE PMString("<u>")
91 #define TOKENENDUNDERLINE PMString("</u>")
92 #define TOKENFONT PMString("<f ")
93 #define TOKENPARA PMString("<p>")
94 #define TOKENIFILE PMString ("<i ")
95 #define TOKENTBOX PMString("<t ")
96 #define TOKENALIGN PMString("<a ")
97 #define TOKENSTARTCOMMENT PMString("<c>")
98 #define TOKENENDCOMMENT PMString("</c>")
99 // Additional Japanese specific tokens
100 #define TOKENKENTEN PMString("<k>")
101 #define TOKENENDKENTEN PMString("</k>")
102 #define TOKENSYATAI PMString("<q>")
103 #define TOKENENDSYATAI PMString("</q>")
104 #define TOKENRUBY PMString("<r ")
105 
106 
118 {
119 public:
125 
128  ~CHMLFiltTokenisor(void);
129 
135  Token_t GetNextToken(TokenValue& theToken);
136 
143 
146  void ResetStream(void);
147 
154  void PushTokenBack(void);
155 
156 private:
157  // we maintain the current token, this is what we pass back to the caller
158  // of GetNextToken. Ownership remains with this class.
159  // We also maintain the current token type. This is in line with
160  // the idea of a "global" current token used within compiler technologies.
161  TokenValue fCurrentToken;
162  Token_t fCurrentTokenType;
163 
164  // we need to be able to push a token back onto the stream
165  bool token_spare;
166 
167  // the stream we are acting on
168  IPMStream* theStream;
169 };
170 
171 #endif //_CHMLFiltTokenisor_H_
172 
173 
174 // End, CHMLFiltTokenisor.h.
175 
176