Skip to content

TTokenType

Type representing different token types in expression parsing

Declaration

Source position: fpexprpars.pp line 34

type
  TTokenType = (ttPlus,ttMinus,ttLessThan,ttLargerThan,ttEqual,ttDiv,
              ttMod,ttMul,ttLeft,ttRight,ttLessThanEqual,
              ttLargerThanEqual,ttunequal,ttNumber,ttString,
              ttIdentifier,ttComma,ttAnd,ttOr,ttXor,ttTrue,ttFalse,
              ttNot,ttif,ttCase,ttPower,ttEOF)

Values

Value Description
ttPlus Plus operator token (+)
ttMinus Minus operator token (-)
ttLessThan Less than comparison operator token (<)
ttLargerThan Greater than comparison operator token (>)
ttEqual Equality comparison operator token (=)
ttDiv Division operator token (/)
ttMod Modulo operator token (mod)
ttMul Multiplication operator token (*)
ttLeft Left parenthesis token (()
ttRight Right parenthesis token ())
ttLessThanEqual Less than or equal comparison operator token (<=)
ttLargerThanEqual Greater than or equal comparison operator token (>=)
ttunequal Inequality comparison operator token (<>)
ttNumber Numeric literal token
ttString String literal token
ttIdentifier Identifier token (variable or function name)
ttComma Comma separator token (,)
ttAnd Logical AND operator token (and)
ttOr Logical OR operator token (or)
ttXor Logical XOR operator token (xor)
ttTrue Boolean true literal token
ttFalse Boolean false literal token
ttNot Logical NOT operator token (not)
ttif Conditional if keyword token
ttCase Case conditional keyword token
ttPower Power/exponentiation operator token (**)
ttEOF End of file token marking end of input

Description

This enumeration defines all possible token types that can be encountered during expression parsing and lexical analysis. Each token type represents a fundamental unit of the expression language, from operators and keywords to literals and identifiers.

The token types are organized into several categories:

  • Arithmetic operators: ttPlus, ttMinus, ttMul, ttDiv, ttMod, ttPower
  • Comparison operators: ttEqual, ttUnequal, ttLessThan, ttLargerThan, ttLessThanEqual, ttLargerThanEqual
  • Logical operators: ttAnd, ttOr, ttXor, ttNot
  • Literals: ttNumber, ttString, ttTrue, ttFalse
  • Structure tokens: ttLeft, ttRight, ttComma
  • Keywords: ttIf, ttCase
  • Special tokens: ttIdentifier, ttEOF

The TFPExpressionScanner uses these token types to categorize input text during the lexical analysis phase of expression parsing.