Bug 60984

Summary: FormulaParser includes function names to the arguments for unknown functions
Product: POI Reporter: Efthimia <e.aivaloglou>
Component: SS CommonAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.15-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

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.