paper-xlsxAPI referenceformula.tokenizer
Token
paper-xlsx 0.2.1 API reference
A token in an Excel formula.
Tokens have three attributes:
value: The string value parsed that led to this tokentype: A string identifying the type of tokensubtype: A string identifying subtype of the token (optional, and defaults to "")
Token(value, type_, subtype='')Attributes
ARG
attributeARG= 'ARG'ARRAY
attributeARRAY= 'ARRAY'CLOSE
attributeCLOSE= 'CLOSE'ERROR
attributeERROR= 'ERROR'FUNC
attributeFUNC= 'FUNC'LITERAL
attributeLITERAL= 'LITERAL'LOGICAL
attributeLOGICAL= 'LOGICAL'NUMBER
attributeNUMBER= 'NUMBER'OPEN
attributeOPEN= 'OPEN'OPERAND
attributeOPERAND= 'OPERAND'OP_IN
attributeOP_IN= 'OPERATOR-INFIX'OP_POST
attributeOP_POST= 'OPERATOR-POSTFIX'OP_PRE
attributeOP_PRE= 'OPERATOR-PREFIX'PAREN
attributePAREN= 'PAREN'RANGE
attributeRANGE= 'RANGE'ROW
attributeROW= 'ROW'SEP
attributeSEP= 'SEP'TEXT
attributeTEXT= 'TEXT'WSPACE
attributeWSPACE= 'WHITE-SPACE'subtype
attributesubtype= subtypetype
attributetype= type_value
attributevalue= valueFunctions
get_closer
funcget_closer()Return a closing token that matches this token's type.
make_operand
funcmake_operand(value)Create an operand token.
paramvaluemake_separator
funcmake_separator(value)Create a separator token
paramvaluemake_subexp
funcmake_subexp(value, func=False)Create a subexpression token.
value: The value of the token
func: If True, force the token to be of type FUNC
paramvalueparamfunc= False