Paper Office
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 token
  • type: A string identifying the type of token
  • subtype: 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
= subtype

type

attributetype
= type_

value

attributevalue
= value

Functions

get_closer

funcget_closer()

Return a closing token that matches this token's type.

make_operand

funcmake_operand(value)

Create an operand token.

paramvalue

make_separator

funcmake_separator(value)

Create a separator token

paramvalue

make_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

paramvalue
paramfunc
= False

On this page