[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/antlr/ -> TokenStream.php (source)

   1  <?php
   2  /*
   3   [The "BSD licence"]
   4   Copyright (c) 2005-2008 Terence Parr
   5   All rights reserved.
   6  
   7   Redistribution and use in source and binary forms, with or without
   8   modification, are permitted provided that the following conditions
   9   are met:
  10   1. Redistributions of source code must retain the above copyright
  11      notice, this list of conditions and the following disclaimer.
  12   2. Redistributions in binary form must reproduce the above copyright
  13      notice, this list of conditions and the following disclaimer in the
  14      documentation and/or other materials provided with the distribution.
  15   3. The name of the author may not be used to endorse or promote products
  16      derived from this software without specific prior written permission.
  17  
  18   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28  */
  29  
  30  /** A stream of tokens accessing tokens from a TokenSource */
  31  interface TokenStream extends IntStream {
  32      /** Get Token at current input pointer + i ahead where i=1 is next Token.
  33       *  i<0 indicates tokens in the past.  So -1 is previous token and -2 is
  34       *  two tokens ago. LT(0) is undefined.  For i>=n, return Token.EOFToken.
  35       *  Return null for LT(0) and any index that results in an absolute address
  36       *  that is negative.
  37       */
  38      public function LT($k);
  39  
  40      /** Get a token at an absolute index i; 0..n-1.  This is really only
  41       *  needed for profiling and debugging and token stream rewriting.
  42       *  If you don't want to buffer up tokens, then this method makes no
  43       *  sense for you.  Naturally you can't use the rewrite stream feature.
  44       *  I believe DebugTokenStream can easily be altered to not use
  45       *  this method, removing the dependency.
  46       */
  47  	public function get($i);
  48  
  49      /** Where is this stream pulling tokens from?  This is not the name, but
  50       *  the object that provides Token objects.
  51       */
  52  	public function getTokenSource();
  53  
  54      /** Return the text of all tokens from start to stop, inclusive.
  55       *  If the stream does not buffer all the tokens then it can just
  56       *  return "" or null;  Users should not access $ruleLabel.text in
  57       *  an action of course in that case.
  58       */
  59  	public function toStringBetween($start, $stop);
  60      
  61  
  62      /** Because the user is not required to use a token with an index stored
  63       *  in it, we must provide a means for two token objects themselves to
  64       *  indicate the start/end location.  Most often this will just delegate
  65       *  to the other toString(int,int).  This is also parallel with
  66       *  the TreeNodeStream.toString(Object,Object).
  67       */
  68  	public function toStringBetweenTokens($start, $stop);
  69  }
  70  
  71  ?>


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1