Esempio n. 1
0
 /**
  * 
  * 异常处理
  */
 public function throwException($msg = '', $detail = true)
 {
     $ext = ' at line:' . ($this->line + 1) . ', col:' . ($this->col + 1) . ', pos:' . $this->pos;
     if ($detail) {
         $msg .= $ext;
     }
     parent::throwException($msg, -1);
 }
Esempio n. 2
0
 /**
  * 
  * 获取结束标签的名字
  * @param string $endTag
  */
 public static function getEndTagName($endTag = '', Fl_Base $instance)
 {
     preg_match(self::$endTagNamePattern, $endTag, $matches);
     if (is_array($matches) && $matches[1]) {
         return $matches[1];
     }
     $instance->throwException('analytic end tag error');
 }
Esempio n. 3
0
 /**
  * 
  * 获取开始或者结束标签的名字
  * @param string $tag
  */
 public static function getTagName($tag = '', Fl_Base $instance)
 {
     preg_match(self::$getTagNamePattern, $tag, $matches);
     if (is_array($matches) && $matches[1]) {
         return $matches[1];
     }
     $instance->throwException('get tagName error in `' . $tag . '`');
 }
Esempio n. 4
0
 /**
  * 
  * 异常处理
  */
 public function throwException($msg = '')
 {
     $ext = ' at line:' . ($this->line + 1) . ', col:' . ($this->col + 1) . ', pos:' . $this->pos;
     parent::throwException($msg . $ext, $code);
 }
Esempio n. 5
0
 /**
  * 
  * 抛出token的相关异常
  */
 public function throwException($msg = '', $token = false)
 {
     if ($token === false) {
         $token = $this->currentToken;
     }
     $ext = ' at line:' . strval($token['tokline']) . ', col:' . $token['tokcol'] . ', pos:' . $token['tokpos'];
     parent::throwException($msg . $ext);
 }