00001 <?php 00002 /**************************************************************************** 00003 * Copyright (C) 2008-2009 by Vladlen Y. Koshelev * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Lesser General Public License as * 00007 * published by the Free Software Foundation; either version 3 of the * 00008 * License, or (at your option) any later version. * 00009 * * 00010 ****************************************************************************/ 00011 00015 final class OqlToken 00016 { 00017 const NEW_LINE = 1; 00018 const STRING = 2; 00019 const NUMBER = 3; 00020 const BOOLEAN = 4; 00021 const NULL = 5; 00022 const SUBSTITUTION = 6; 00023 const KEYWORD = 7; 00024 const AGGREGATE_FUNCTION = 8; 00025 const IDENTIFIER = 9; 00026 const PARENTHESES = 10; 00027 const PUNCTUATION = 11; 00028 const COMPARISON_OPERATOR = 12; 00029 const ARITHMETIC_OPERATOR = 13; 00030 00031 private $value = null; 00032 private $rawValue = null; 00033 private $type = null; 00034 private $line = null; 00035 private $position = null; 00036 00040 public static function create() 00041 { 00042 return new self; 00043 } 00044 00048 public static function make($value, $rawValue, $type, $line, $position) 00049 { 00050 return 00051 self::create()-> 00052 setValue($value)-> 00053 setRawValue($rawValue)-> 00054 setType($type)-> 00055 setLine($line)-> 00056 setPosition($position); 00057 } 00058 00062 public function setValue($value) 00063 { 00064 $this->value = $value; 00065 00066 return $this; 00067 } 00068 00069 public function getValue() 00070 { 00071 return $this->value; 00072 } 00073 00077 public function setRawValue($rawValue) 00078 { 00079 $this->rawValue = $rawValue; 00080 00081 return $this; 00082 } 00083 00084 public function getRawValue() 00085 { 00086 return $this->rawValue; 00087 } 00088 00092 public function setType($type) 00093 { 00094 $this->type = $type; 00095 00096 return $this; 00097 } 00098 00099 public function getType() 00100 { 00101 return $this->type; 00102 } 00103 00107 public function setLine($line) 00108 { 00109 $this->line = $line; 00110 00111 return $this; 00112 } 00113 00114 public function getLine() 00115 { 00116 return $this->line; 00117 } 00118 00122 public function setPosition($position) 00123 { 00124 $this->position = $position; 00125 00126 return $this; 00127 } 00128 00129 public function getPosition() 00130 { 00131 return $this->position; 00132 } 00133 } 00134 ?>