summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser.h
AgeCommit message (Collapse)Author
2018-02-21[formcalc] Minor parser cleanupschromium/3352Dan Sinclair
This CL makes minor clarity cleanups to the formcalc parser and attempts to record the productions each method is processing. Change-Id: Ie12bb55647abf06251d1734fd05d08a964a32ebc Reviewed-on: https://pdfium-review.googlesource.com/27550 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-21[formcalc] Remove the ParseBlockExpression methodDan Sinclair
In all the places we call ParseBlockExpression we really mean to parse an ExpressionList. Using ParseBlockExpression is confusing because the formcalc grammar has a BlockExpression defined which corresponds to our ParseDoExpression. This CL converts the use of ParseBlockExpression into calls to ParseExpressionList and then builds the BlockExpression class as needed. Change-Id: Iab9b6e783f01d35df905539d4dbc20ba18a7b0f9 Reviewed-on: https://pdfium-review.googlesource.com/27470 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-20[formcalc] Split literal parsing to its own methodDan Sinclair
This Cl moves the code to create literals in the AST from ParsePrimaryExpression to ParseLiteral. Change-Id: I41ba20f28f1cb1d76d753c5baec790872acdf1da Reviewed-on: https://pdfium-review.googlesource.com/27411 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-19FormCalc Assignment is not a SimpleExpressiondan sinclair
Currently the parser builds assignment statements as part of the SimpleExpression declaration. This isn't correct according to the grammar where AssignmentExpression and SimpleExpression are siblings. This CL moves the assignment calculation into the ExpExpression declaration to make it a sibling of the SimpleExpression. Change-Id: I6afac2379ab6783b84ee619863c8308ca0db454d Reviewed-on: https://pdfium-review.googlesource.com/27310 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-19Simplify CXFA_FMToken creationdan sinclair
This CL converts the CXFA_FMToken usages into an object instead of a pointer. A copy constructor has been added. The line number was removed from the token and is retrieved from the lexer where needed. Change-Id: I94c632653e9bf1439d2ddf374a816ae0d10b5b67 Reviewed-on: https://pdfium-review.googlesource.com/27192 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-16Add parse depth limit to FormCalc parserRyan Harrison
Due to the recursive nature of the FormCalc parser, deeply nested expressions can lead to memory being exhausted. This check is being added to have the parser exit early instead of running out of memory. This should reduce the number of false positives about addressing issues being found by fuzzers. BUG=chromium:752433 Change-Id: I511ecfb07e32073555e1fd1658f3b8b47f1a5a91 Reviewed-on: https://pdfium-review.googlesource.com/11170 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-27Move CXFA_FMParse to CFXA_FMParserRyan Harrison
Minor nit I had with this code and want to fix. Bug: Change-Id: I2494667d580bf982a4359153123d9e8afb75e349 Reviewed-on: https://pdfium-review.googlesource.com/9370 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>