public void Consume() { for (int i = 0; i < _Depth - 1; i++) { // oldvalue = newvalue _Buffer[i] = _Buffer[i + 1]; } try { // set new value if (_Pos == _Code.Length) { // read next symbol frm buffer // end buffers _Buffer[_Depth - 1] = 0; } else { _Buffer[_Depth - 1] = _Code[_Pos++]; } } catch (Exception e) { ApprenticeObject.ReportException(e); } }
public void consume() { for (int i = 0; i < k - 1; i++) { _TokenStack[i] = _TokenStack[i + 1]; } try { _TokenStack[k - 1] = _Lexer.GetToken(); //Console.WriteLine("Token ={0}",buf[k-1].Text); } catch (Exception e) { ApprenticeObject.ReportException(e); } }
public TokenBuffer(Lexer oLexer, int k) { this.k = k; _TokenStack = new Token[k]; _Lexer = oLexer; try { for (int i = 0; i < k; i++) { _TokenStack[i] = _Lexer.GetToken(); } } catch (Exception e) { ApprenticeObject.ReportException(e); } }
public Operator ReadArgument() { try { //string sBuffer = BufferConsumed(); Operator op = ReadLogicalOr(); return(op); } // catch(ApprenticeSyntaxException eSyntax) // { // throw eSyntax; // } catch (Exception e) { ApprenticeObject.ReportException(e); return(null); } }
public Operator ReadFormula() { try { ClearLeadingAndOR(); var op = ReadLogicalOr(); CheckThatBufferIsEmpty(); return(op); } // catch(ApprenticeSyntaxException eSyntax) // { // throw(eSyntax); // } catch (Exception e) { ApprenticeObject.ReportException(e); return(null); } }