Sign in Join
FPDoc Onlineexperiment

TTokenType enumeration

In unit fpExprPars

Type representing different token types in expression parsing

Declaration

pascal
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)

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.

Values

ttPlusPlus operator token (+)
ttMinusMinus operator token (-)
ttLessThanLess than comparison operator token (<)
ttLargerThanGreater than comparison operator token (>)
ttEqualEquality comparison operator token (=)
ttDivDivision operator token (/)
ttModModulo operator token (mod)
ttMulMultiplication operator token (*)
ttLeftLeft parenthesis token (()
ttRightRight parenthesis token ())
ttLessThanEqualLess than or equal comparison operator token (<=)
ttLargerThanEqualGreater than or equal comparison operator token (>=)
ttunequalInequality comparison operator token (<>)
ttNumberNumeric literal token
ttStringString literal token
ttIdentifierIdentifier token (variable or function name)
ttCommaComma separator token (,)
ttAndLogical AND operator token (and)
ttOrLogical OR operator token (or)
ttXorLogical XOR operator token (xor)
ttTrueBoolean true literal token
ttFalseBoolean false literal token
ttNotLogical NOT operator token (not)
ttifConditional if keyword token
ttCaseCase conditional keyword token
ttPowerPower/exponentiation operator token (**)
ttEOFEnd of file token marking end of input

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.