示例#1
0
 public GlrWorker(GlrTableParser outer, int id, int[][][][] parseTable, int errorId, int eosId, int[] errorSentinels, IList <GlrWorker> workers, LookAheadEnumerator tokenEnum)
 {
     _Outer          = outer;
     Id              = id;
     _parseTable     = parseTable;
     _errorId        = errorId;
     _eosId          = eosId;
     _tokenEnum      = tokenEnum;
     _stack          = new List <int>();
     Index           = 0;
     _tupleIndex     = 0;
     _workers        = workers;
     _errorSentinels = errorSentinels;
     ErrorTokens     = new Queue <Token>();
     _continuation   = false;
     NodeType        = LRNodeType.Initial;
 }
示例#2
0
 public GlrWorker(GlrTableParser outer, GlrWorker worker, int tupleIndex)
 {
     _Outer          = outer;
     _parseTable     = worker._parseTable;
     _errorId        = worker._errorId;
     _eosId          = worker._eosId;
     _errorSentinels = worker._errorSentinels;
     ErrorTokens     = new Queue <Token>(worker.ErrorTokens);
     _tokenEnum      = worker._tokenEnum;
     _stack          = new List <int>(worker._stack.Count);
     _stack.AddRange(worker._stack);
     Index        = worker.Index;
     _tupleIndex  = tupleIndex;
     NodeType     = worker.NodeType;
     Id           = outer.NextWorkerId;
     CurrentToken = worker.CurrentToken;
     ++outer.NextWorkerId;
     _continuation = true;
     _workers      = worker._workers;
 }