ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
FormulaToken.php
Go to the documentation of this file.
1 <?php
29 /*
30 PARTLY BASED ON:
31  Copyright (c) 2007 E. W. Bachtal, Inc.
32 
33  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
34  and associated documentation files (the "Software"), to deal in the Software without restriction,
35  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
36  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
37  subject to the following conditions:
38 
39  The above copyright notice and this permission notice shall be included in all copies or substantial
40  portions of the Software.
41 
42  The software is provided "as is", without warranty of any kind, express or implied, including but not
43  limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
44  no event shall the authors or copyright holders be liable for any claim, damages or other liability,
45  whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
46  software or the use or other dealings in the software.
47 
48  http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
49  http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
50 */
51 
52 
61  /* Token types */
62  const TOKEN_TYPE_NOOP = 'Noop';
63  const TOKEN_TYPE_OPERAND = 'Operand';
64  const TOKEN_TYPE_FUNCTION = 'Function';
65  const TOKEN_TYPE_SUBEXPRESSION = 'Subexpression';
66  const TOKEN_TYPE_ARGUMENT = 'Argument';
67  const TOKEN_TYPE_OPERATORPREFIX = 'OperatorPrefix';
68  const TOKEN_TYPE_OPERATORINFIX = 'OperatorInfix';
69  const TOKEN_TYPE_OPERATORPOSTFIX = 'OperatorPostfix';
70  const TOKEN_TYPE_WHITESPACE = 'Whitespace';
71  const TOKEN_TYPE_UNKNOWN = 'Unknown';
72 
73  /* Token subtypes */
74  const TOKEN_SUBTYPE_NOTHING = 'Nothing';
75  const TOKEN_SUBTYPE_START = 'Start';
76  const TOKEN_SUBTYPE_STOP = 'Stop';
77  const TOKEN_SUBTYPE_TEXT = 'Text';
78  const TOKEN_SUBTYPE_NUMBER = 'Number';
79  const TOKEN_SUBTYPE_LOGICAL = 'Logical';
80  const TOKEN_SUBTYPE_ERROR = 'Error';
81  const TOKEN_SUBTYPE_RANGE = 'Range';
82  const TOKEN_SUBTYPE_MATH = 'Math';
83  const TOKEN_SUBTYPE_CONCATENATION = 'Concatenation';
84  const TOKEN_SUBTYPE_INTERSECTION = 'Intersection';
85  const TOKEN_SUBTYPE_UNION = 'Union';
86 
92  private $_value;
93 
99  private $_tokenType;
100 
106  private $_tokenSubType;
107 
116  {
117  // Initialise values
118  $this->_value = $pValue;
119  $this->_tokenType = $pTokenType;
120  $this->_tokenSubType = $pTokenSubType;
121  }
122 
128  public function getValue() {
129  return $this->_value;
130  }
131 
137  public function setValue($value) {
138  $this->_value = $value;
139  }
140 
146  public function getTokenType() {
147  return $this->_tokenType;
148  }
149 
156  $this->_tokenType = $value;
157  }
158 
164  public function getTokenSubType() {
165  return $this->_tokenSubType;
166  }
167 
174  $this->_tokenSubType = $value;
175  }
176 }