Beispiel #1
0
 public Simplex Parse()
 {
     _curToken = _lexer.getNextToken();
     Simplex ret = MainStep();
     if (_curToken.Type != TokenType.End)
         throw new ParseErrorException("Не предвиденное окончание окончание потока. Проверте правильность описания");
     return ret;
 }
Beispiel #2
0
        int _varCount; //кол-во введенных переменных

        #endregion Fields

        #region Constructors

        public Parser(string text)
        {
            _lexer = new Lexer(text);
            _curToken = null;
            _table = new Dictionary<string, int>();
            _table.Add("f", 0);
            _table.Add("Max", 0);
            _table.Add("Min", 0);
            _varCount = 0;
        }
Beispiel #3
0
 void Match(TokenType t)
 {
     if (_curToken.Type == t)
         _curToken = _lexer.getNextToken();
     else throw new ParseErrorException("Не верная последоватьность");
 }