OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_FM2JS_XFA_LEXER_H_ | 7 #ifndef XFA_FXFA_FM2JS_XFA_LEXER_H_ |
8 #define XFA_FXFA_FM2JS_XFA_LEXER_H_ | 8 #define XFA_FXFA_FM2JS_XFA_LEXER_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const FX_WCHAR*& pEnd); | 112 const FX_WCHAR*& pEnd); |
113 void Comment(const FX_WCHAR* p, const FX_WCHAR*& pEnd); | 113 void Comment(const FX_WCHAR* p, const FX_WCHAR*& pEnd); |
114 XFA_FM_TOKEN IsKeyword(const CFX_WideStringC& p); | 114 XFA_FM_TOKEN IsKeyword(const CFX_WideStringC& p); |
115 void SetCurrentLine(uint32_t line) { m_uCurrentLine = line; } | 115 void SetCurrentLine(uint32_t line) { m_uCurrentLine = line; } |
116 void SetToken(CXFA_FMToken* pToken) { | 116 void SetToken(CXFA_FMToken* pToken) { |
117 if (m_pToken.get() != pToken) | 117 if (m_pToken.get() != pToken) |
118 m_pToken.reset(pToken); | 118 m_pToken.reset(pToken); |
119 } | 119 } |
120 const FX_WCHAR* SavePos() { return m_ptr; } | 120 const FX_WCHAR* SavePos() { return m_ptr; } |
121 void RestorePos(const FX_WCHAR* pPos) { m_ptr = pPos; } | 121 void RestorePos(const FX_WCHAR* pPos) { m_ptr = pPos; } |
122 void Error(XFA_FM_ERRMSG msg, ...); | 122 void Error(const FX_WCHAR* msg, ...); |
123 FX_BOOL HasError() const; | 123 FX_BOOL HasError() const; |
124 | 124 |
125 protected: | 125 protected: |
126 CXFA_FMToken* Scan(); | 126 CXFA_FMToken* Scan(); |
127 | 127 |
128 const FX_WCHAR* m_ptr; | 128 const FX_WCHAR* m_ptr; |
129 uint32_t m_uCurrentLine; | 129 uint32_t m_uCurrentLine; |
130 std::unique_ptr<CXFA_FMToken> m_pToken; | 130 std::unique_ptr<CXFA_FMToken> m_pToken; |
131 CXFA_FMErrorInfo* m_pErrorInfo; | 131 CXFA_FMErrorInfo* m_pErrorInfo; |
132 }; | 132 }; |
133 | 133 |
134 #endif // XFA_FXFA_FM2JS_XFA_LEXER_H_ | 134 #endif // XFA_FXFA_FM2JS_XFA_LEXER_H_ |
OLD | NEW |