[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 class RecognizerSharedState { 3 public function __construct(){ 4 /** Track the set of token types that can follow any rule invocation. 5 * Stack grows upwards. When it hits the max, it grows 2x in size 6 * and keeps going. 7 */ 8 $this->following = array(); //Should be an array of bitsets 9 $this->_fsp = -1; 10 //public BitSet[] following = new BitSet[BaseRecognizer.INITIAL_FOLLOW_STACK_SIZE]; 11 12 /** This is true when we see an error and before having successfully 13 * matched a token. Prevents generation of more than one error message 14 * per error. 15 */ 16 $this->errorRecovery = false; 17 /** The index into the input stream where the last error occurred. 18 * This is used to prevent infinite loops where an error is found 19 * but no token is consumed during recovery...another error is found, 20 * ad naseum. This is a failsafe mechanism to guarantee that at least 21 * one token/tree node is consumed for two errors. 22 */ 23 $this->lastErrorIndex = -1; 24 /** In lieu of a return value, this indicates that a rule or token 25 * has failed to match. Reset to false upon valid token match. 26 */ 27 $this->failed=false; 28 /** Did the recognizer encounter a syntax error? Track how many. */ 29 $this->syntaxErrors=0; 30 31 /** If 0, no backtracking is going on. Safe to exec actions etc... 32 * If >0 then it's the level of backtracking. 33 */ 34 $this->backtracking = 0; 35 36 /** An array[size num rules] of Map<Integer,Integer> that tracks 37 * the stop token index for each rule. ruleMemo[ruleIndex] is 38 * the memoization table for ruleIndex. For key ruleStartIndex, you 39 * get back the stop token for associated rule or MEMO_RULE_FAILED. 40 * 41 * This is only used if rule memoization is on (which it is by default). 42 */ 43 $this->ruleMemo = null; 44 45 46 // LEXER FIELDS (must be in same state object to avoid casting 47 // constantly in generated code and Lexer object) :( 48 49 50 /** The goal of all lexer rules/methods is to create a token object. 51 * This is an instance variable as multiple rules may collaborate to 52 * create a single token. nextToken will return this object after 53 * matching lexer rule(s). If you subclass to allow multiple token 54 * emissions, then set this to the last token to be matched or 55 * something nonnull so that the auto token emit mechanism will not 56 * emit another token. 57 */ 58 $this->token = null; 59 60 /** What character index in the stream did the current token start at? 61 * Needed, for example, to get the text for current token. Set at 62 * the start of nextToken. 63 */ 64 $this->tokenStartCharIndex = -1; 65 66 /** The line on which the first character of the token resides */ 67 $this->tokenStartLine = 0; 68 69 /** The character position of first character within the line */ 70 $this->tokenStartCharPositionInLine = 0; 71 72 /** The channel number for the current token */ 73 $this->channel = 0; 74 75 /** The token type for the current token */ 76 $this->type = 0; 77 78 /** You can set the text for the current token to override what is in 79 * the input char buffer. Use setText() or can set this instance var. 80 */ 81 $this->text=null; 82 83 } 84 85 } 86 87 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |