ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FormulaToken.php
Go to the documentation of this file.
1 <?php
2 
4 
28 {
29  // Token types
30  const TOKEN_TYPE_NOOP = 'Noop';
31  const TOKEN_TYPE_OPERAND = 'Operand';
32  const TOKEN_TYPE_FUNCTION = 'Function';
33  const TOKEN_TYPE_SUBEXPRESSION = 'Subexpression';
34  const TOKEN_TYPE_ARGUMENT = 'Argument';
35  const TOKEN_TYPE_OPERATORPREFIX = 'OperatorPrefix';
36  const TOKEN_TYPE_OPERATORINFIX = 'OperatorInfix';
37  const TOKEN_TYPE_OPERATORPOSTFIX = 'OperatorPostfix';
38  const TOKEN_TYPE_WHITESPACE = 'Whitespace';
39  const TOKEN_TYPE_UNKNOWN = 'Unknown';
40 
41  // Token subtypes
42  const TOKEN_SUBTYPE_NOTHING = 'Nothing';
43  const TOKEN_SUBTYPE_START = 'Start';
44  const TOKEN_SUBTYPE_STOP = 'Stop';
45  const TOKEN_SUBTYPE_TEXT = 'Text';
46  const TOKEN_SUBTYPE_NUMBER = 'Number';
47  const TOKEN_SUBTYPE_LOGICAL = 'Logical';
48  const TOKEN_SUBTYPE_ERROR = 'Error';
49  const TOKEN_SUBTYPE_RANGE = 'Range';
50  const TOKEN_SUBTYPE_MATH = 'Math';
51  const TOKEN_SUBTYPE_CONCATENATION = 'Concatenation';
52  const TOKEN_SUBTYPE_INTERSECTION = 'Intersection';
53  const TOKEN_SUBTYPE_UNION = 'Union';
54 
60  private $value;
61 
67  private $tokenType;
68 
74  private $tokenSubType;
75 
83  public function __construct($pValue, $pTokenType = self::TOKEN_TYPE_UNKNOWN, $pTokenSubType = self::TOKEN_SUBTYPE_NOTHING)
84  {
85  // Initialise values
86  $this->value = $pValue;
87  $this->tokenType = $pTokenType;
88  $this->tokenSubType = $pTokenSubType;
89  }
90 
96  public function getValue()
97  {
98  return $this->value;
99  }
100 
106  public function setValue($value): void
107  {
108  $this->value = $value;
109  }
110 
116  public function getTokenType()
117  {
118  return $this->tokenType;
119  }
120 
126  public function setTokenType($value): void
127  {
128  $this->tokenType = $value;
129  }
130 
136  public function getTokenSubType()
137  {
138  return $this->tokenSubType;
139  }
140 
146  public function setTokenSubType($value): void
147  {
148  $this->tokenSubType = $value;
149  }
150 }
PARTLY BASED ON: Copyright (c) 2007 E.
setTokenType($value)
Set Token Type (represented by TOKEN_TYPE_*).
getTokenSubType()
Get Token SubType (represented by TOKEN_SUBTYPE_*).
setTokenSubType($value)
Set Token SubType (represented by TOKEN_SUBTYPE_*).
getTokenType()
Get Token Type (represented by TOKEN_TYPE_*).
__construct($pValue, $pTokenType=self::TOKEN_TYPE_UNKNOWN, $pTokenSubType=self::TOKEN_SUBTYPE_NOTHING)
Create a new FormulaToken.