summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmlexer.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-07-25 11:10:15 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-25 15:26:28 +0000
commit952477dbee761a6e38ce675f2095bbfc9cfd7450 (patch)
treec248f649135de60d81d87d9b0afebc153a589d69 /xfa/fxfa/fm2js/cxfa_fmlexer.h
parent364d18b13575a2b569e9fc175cb0dd60106fa954 (diff)
downloadpdfium-952477dbee761a6e38ce675f2095bbfc9cfd7450.tar.xz
Clean up data passing in FormCalc Lexerchromium/3167
This CL removes the pattern used in the lexer of passing the lexing member variables around as args to methods. Instead it uses the fact that they are member variables in the methods. This CL also includes renaming of variable and function names to remove unneeded details or make them more precise. BUG=pdfium:814 Change-Id: Id4c592338db9ff462835314252d39ab3b4b2b2ab Reviewed-on: https://pdfium-review.googlesource.com/8850 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmlexer.h')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmlexer.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.h b/xfa/fxfa/fm2js/cxfa_fmlexer.h
index b1f0552b40..c944266d37 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.h
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h
@@ -85,7 +85,7 @@ enum XFA_FM_TOKEN {
struct XFA_FMKeyword {
XFA_FM_TOKEN m_type;
- uint32_t m_uHash;
+ uint32_t m_hash;
const wchar_t* m_keyword;
};
@@ -94,12 +94,12 @@ const wchar_t* XFA_FM_KeywordToString(XFA_FM_TOKEN op);
class CXFA_FMToken {
public:
CXFA_FMToken();
- explicit CXFA_FMToken(uint32_t uLineNum);
+ explicit CXFA_FMToken(uint32_t line_num);
~CXFA_FMToken();
- CFX_WideStringC m_wstring;
+ CFX_WideStringC m_string;
XFA_FM_TOKEN m_type;
- uint32_t m_uLinenum;
+ uint32_t m_line_num;
};
class CXFA_FMLexer {
@@ -108,27 +108,27 @@ class CXFA_FMLexer {
~CXFA_FMLexer();
CXFA_FMToken* NextToken();
- bool HasError() const { return m_LexerError; }
+ bool HasError() const { return m_lexer_error; }
- void SetCurrentLine(uint32_t line) { m_uCurrentLine = line; }
- void SetToken(std::unique_ptr<CXFA_FMToken> pToken) {
- m_pToken = std::move(pToken);
+ void SetCurrentLine(uint32_t line) { m_current_line = line; }
+ void SetToken(std::unique_ptr<CXFA_FMToken> token) {
+ m_token = std::move(token);
}
- const wchar_t* GetPos() { return m_ptr; }
- void SetPos(const wchar_t* pPos) { m_ptr = pPos; }
+ const wchar_t* GetPos() { return m_cursor; }
+ void SetPos(const wchar_t* pos) { m_cursor = pos; }
private:
- const wchar_t* AdvanceForNumber(CXFA_FMToken* t, const wchar_t* p);
- const wchar_t* AdvanceForString(CXFA_FMToken* t, const wchar_t* p);
- const wchar_t* AdvanceForIdentifier(CXFA_FMToken* t, const wchar_t* p);
- const wchar_t* AdvanceForComment(const wchar_t* p);
+ void AdvanceForNumber();
+ void AdvanceForString();
+ void AdvanceForIdentifier();
+ void AdvanceForComment();
- const wchar_t* m_ptr;
+ const wchar_t* m_cursor;
const wchar_t* const m_end;
- uint32_t m_uCurrentLine;
- std::unique_ptr<CXFA_FMToken> m_pToken;
- bool m_LexerError;
+ uint32_t m_current_line;
+ std::unique_ptr<CXFA_FMToken> m_token;
+ bool m_lexer_error;
};
#endif // XFA_FXFA_FM2JS_CXFA_FMLEXER_H_