summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_fmparse.h
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-11-28 12:31:13 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-28 12:31:13 -0800
commiteb9625c04876c45862fb30e48a4fd6d5998db0e9 (patch)
tree67725226cdf317ff35213da6761dfc0455ec69fb /xfa/fxfa/fm2js/xfa_fmparse.h
parentc92e26defaa636b0d2ec9b9de0f88c6153ad7ed3 (diff)
downloadpdfium-eb9625c04876c45862fb30e48a4fd6d5998db0e9.tar.xz
Use unique pointers in CXFA_FMParse
Replaced CXFA_FMParse's returns to be unique pointers to prevent leaks. Review-Url: https://codereview.chromium.org/2530933002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fmparse.h')
-rw-r--r--xfa/fxfa/fm2js/xfa_fmparse.h50
1 files changed, 26 insertions, 24 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.h b/xfa/fxfa/fm2js/xfa_fmparse.h
index 0283edaed0..5f8022f270 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.h
+++ b/xfa/fxfa/fm2js/xfa_fmparse.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_FM2JS_XFA_FMPARSE_H_
#include <memory>
+#include <vector>
#include "xfa/fxfa/fm2js/xfa_expression.h"
#include "xfa/fxfa/fm2js/xfa_lexer.h"
@@ -21,30 +22,31 @@ class CXFA_FMParse {
void NextToken();
void Check(XFA_FM_TOKEN op);
void Error(uint32_t lineNum, const FX_WCHAR* msg, ...);
- CFX_ArrayTemplate<CXFA_FMExpression*>* ParseTopExpression();
- CXFA_FMExpression* ParseFunction();
- CXFA_FMExpression* ParseExpression();
- CXFA_FMExpression* ParseVarExpression();
- CXFA_FMExpression* ParseExpExpression();
- CXFA_FMExpression* ParseBlockExpression();
- CXFA_FMExpression* ParseIfExpression();
- CXFA_FMExpression* ParseWhileExpression();
- CXFA_FMExpression* ParseForExpression();
- CXFA_FMExpression* ParseForeachExpression();
- CXFA_FMExpression* ParseDoExpression();
- CXFA_FMSimpleExpression* ParseParenExpression();
- CXFA_FMSimpleExpression* ParseSimpleExpression();
- CXFA_FMSimpleExpression* ParseSubassignmentInForExpression();
- CXFA_FMSimpleExpression* ParseLogicalOrExpression();
- CXFA_FMSimpleExpression* ParseLogicalAndExpression();
- CXFA_FMSimpleExpression* ParseEqualityExpression();
- CXFA_FMSimpleExpression* ParseRelationalExpression();
- CXFA_FMSimpleExpression* ParseAddtiveExpression();
- CXFA_FMSimpleExpression* ParseMultiplicativeExpression();
- CXFA_FMSimpleExpression* ParseUnaryExpression();
- CXFA_FMSimpleExpression* ParsePrimaryExpression();
- CXFA_FMSimpleExpression* ParsePostExpression(CXFA_FMSimpleExpression* e);
- CXFA_FMSimpleExpression* ParseIndexExpression();
+ std::vector<std::unique_ptr<CXFA_FMExpression>> ParseTopExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseFunction();
+ std::unique_ptr<CXFA_FMExpression> ParseExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseVarExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseExpExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseBlockExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseIfExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseWhileExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseForExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseForeachExpression();
+ std::unique_ptr<CXFA_FMExpression> ParseDoExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseParenExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseSimpleExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseSubassignmentInForExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseLogicalOrExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseLogicalAndExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseEqualityExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseRelationalExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseAddtiveExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseMultiplicativeExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseUnaryExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParsePrimaryExpression();
+ std::unique_ptr<CXFA_FMSimpleExpression> ParsePostExpression(
+ std::unique_ptr<CXFA_FMSimpleExpression> e);
+ std::unique_ptr<CXFA_FMSimpleExpression> ParseIndexExpression();
private:
std::unique_ptr<CXFA_FMLexer> m_lexer;