Bug 60984 - FormulaParser includes function names to the arguments for unknown functions
Summary: FormulaParser includes function names to the arguments for unknown functions
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.15-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 12:59 UTC by Efthimia
Modified: 2017-06-16 20:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Efthimia 2017-04-13 12:59:42 UTC
When parsing 2-argument formula _xll.HEAT($B3,$C3), FormulaParser creates an org.apache.poi.ss.formula.ptg.FuncVarPtg [#external# nArgs=3] token with _numberOfArgs = 3 and 3 children, the first of which contains the function name (a org.apache.poi.ss.formula.ptg.NameXPxg [sheet=null ! name=_xll.HEAT] token).

_xll.HEAT is an Excel add-in function, but he same applies to UDF functions, eg for formula myUDF(23, F4).

Is this intentional? The parse tree structure does not seem correct, because it is inconsistent with the case of build-in Excel functions, whose arguments in the parse tree only include actual arguments and not the function name.
Comment 1 Javen O'Neal 2017-06-16 20:46:03 UTC
Yes, external functions include the function name as the first token. This is correct.
Adding are essentially a collection of UDFs. I believe this is how functions in the AnalysisToolPak are parsed into tokens.