| 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_SIMPLEEXPRESSION_H_ | 7 #ifndef XFA_FXFA_FM2JS_XFA_SIMPLEEXPRESSION_H_ |
| 8 #define XFA_FXFA_FM2JS_XFA_SIMPLEEXPRESSION_H_ | 8 #define XFA_FXFA_FM2JS_XFA_SIMPLEEXPRESSION_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "core/fxcrt/fx_basic.h" | 13 #include "core/fxcrt/fx_basic.h" |
| 13 #include "xfa/fxfa/fm2js/xfa_lexer.h" | 14 #include "xfa/fxfa/fm2js/xfa_lexer.h" |
| 14 | 15 |
| 15 #define RUNTIMEFUNCTIONRETURNVALUE \ | 16 #define RUNTIMEFUNCTIONRETURNVALUE \ |
| 16 (FX_WSTRC(L"foxit_xfa_formcalc_runtime_func_return_value")) | 17 (FX_WSTRC(L"foxit_xfa_formcalc_runtime_func_return_value")) |
| 17 #define EXCLAMATION_IN_IDENTIFIER \ | 18 #define EXCLAMATION_IN_IDENTIFIER \ |
| 18 (FX_WSTRC(L"foxit_xfa_formcalc__exclamation__")) | 19 (FX_WSTRC(L"foxit_xfa_formcalc__exclamation__")) |
| 19 | 20 |
| 20 enum XFA_FM_SimpleExpressionType { | 21 enum XFA_FM_SimpleExpressionType { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 222 |
| 222 class CXFA_FMNotExpression : public CXFA_FMUnaryExpression { | 223 class CXFA_FMNotExpression : public CXFA_FMUnaryExpression { |
| 223 public: | 224 public: |
| 224 CXFA_FMNotExpression(uint32_t line, CXFA_FMSimpleExpression* pExp); | 225 CXFA_FMNotExpression(uint32_t line, CXFA_FMSimpleExpression* pExp); |
| 225 ~CXFA_FMNotExpression() override {} | 226 ~CXFA_FMNotExpression() override {} |
| 226 void ToJavaScript(CFX_WideTextBuf& javascript) override; | 227 void ToJavaScript(CFX_WideTextBuf& javascript) override; |
| 227 }; | 228 }; |
| 228 | 229 |
| 229 class CXFA_FMCallExpression : public CXFA_FMUnaryExpression { | 230 class CXFA_FMCallExpression : public CXFA_FMUnaryExpression { |
| 230 public: | 231 public: |
| 231 CXFA_FMCallExpression(uint32_t line, | 232 CXFA_FMCallExpression( |
| 232 CXFA_FMSimpleExpression* pExp, | 233 uint32_t line, |
| 233 CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pArguments, | 234 CXFA_FMSimpleExpression* pExp, |
| 234 bool bIsSomMethod); | 235 std::vector<std::unique_ptr<CXFA_FMSimpleExpression>>&& pArguments, |
| 236 bool bIsSomMethod); |
| 235 ~CXFA_FMCallExpression() override; | 237 ~CXFA_FMCallExpression() override; |
| 236 | 238 |
| 237 bool IsBuildInFunc(CFX_WideTextBuf* funcName); | 239 bool IsBuildInFunc(CFX_WideTextBuf* funcName); |
| 238 uint32_t IsMethodWithObjParam(const CFX_WideStringC& methodName); | 240 uint32_t IsMethodWithObjParam(const CFX_WideStringC& methodName); |
| 239 void ToJavaScript(CFX_WideTextBuf& javascript) override; | 241 void ToJavaScript(CFX_WideTextBuf& javascript) override; |
| 240 | 242 |
| 241 private: | 243 private: |
| 242 bool m_bIsSomMethod; | 244 bool m_bIsSomMethod; |
| 243 CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* m_pArguments; | 245 std::vector<std::unique_ptr<CXFA_FMSimpleExpression>> m_Arguments; |
| 244 }; | 246 }; |
| 245 | 247 |
| 246 class CXFA_FMDotAccessorExpression : public CXFA_FMBinExpression { | 248 class CXFA_FMDotAccessorExpression : public CXFA_FMBinExpression { |
| 247 public: | 249 public: |
| 248 CXFA_FMDotAccessorExpression(uint32_t line, | 250 CXFA_FMDotAccessorExpression(uint32_t line, |
| 249 CXFA_FMSimpleExpression* pAccessor, | 251 CXFA_FMSimpleExpression* pAccessor, |
| 250 XFA_FM_TOKEN op, | 252 XFA_FM_TOKEN op, |
| 251 CFX_WideStringC wsIdentifier, | 253 CFX_WideStringC wsIdentifier, |
| 252 CXFA_FMSimpleExpression* pIndexExp); | 254 CXFA_FMSimpleExpression* pIndexExp); |
| 253 ~CXFA_FMDotAccessorExpression() override; | 255 ~CXFA_FMDotAccessorExpression() override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 class CXFA_FMMethodCallExpression : public CXFA_FMBinExpression { | 291 class CXFA_FMMethodCallExpression : public CXFA_FMBinExpression { |
| 290 public: | 292 public: |
| 291 CXFA_FMMethodCallExpression(uint32_t line, | 293 CXFA_FMMethodCallExpression(uint32_t line, |
| 292 CXFA_FMSimpleExpression* pAccessorExp1, | 294 CXFA_FMSimpleExpression* pAccessorExp1, |
| 293 CXFA_FMSimpleExpression* pCallExp); | 295 CXFA_FMSimpleExpression* pCallExp); |
| 294 ~CXFA_FMMethodCallExpression() override {} | 296 ~CXFA_FMMethodCallExpression() override {} |
| 295 void ToJavaScript(CFX_WideTextBuf& javascript) override; | 297 void ToJavaScript(CFX_WideTextBuf& javascript) override; |
| 296 }; | 298 }; |
| 297 | 299 |
| 298 #endif // XFA_FXFA_FM2JS_XFA_SIMPLEEXPRESSION_H_ | 300 #endif // XFA_FXFA_FM2JS_XFA_SIMPLEEXPRESSION_H_ |
| OLD | NEW |