Ejemplo n.º 1
0
 /// <summary>
 /// Processes the <see cref="TokenizerContext"/>
 /// </summary>
 public void Process()
 {
     while (_navigator.HasNext())
     {
         var token = _navigator.CurrentToken;
         if (token.TokenTypeIsSet(TokenType.Unrecognized))
         {
             HandleUnrecognizedToken();
         }
         else if (token.TokenTypeIsSet(TokenType.Colon))
         {
             HandleColon();
         }
         else if (token.TokenTypeIsSet(TokenType.WorksheetName))
         {
             HandleWorksheetNameToken();
         }
         else if (token.TokenTypeIsSet(TokenType.Operator) || token.TokenTypeIsSet(TokenType.Negator))
         {
             if (token.Value == "+" || token.Value == "-")
             {
                 HandleNegators();
             }
         }
         _navigator.MoveNext();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes the <see cref="TokenizerContext"/>
        /// </summary>
        public void Process()
        {
            while (_navigator.HasNext())
            {
                var token = _navigator.CurrentToken;
                switch (token.TokenType)
                {
                case TokenType.Unrecognized:
                    HandleUnrecognizedToken();
                    break;

                case TokenType.WorksheetName:
                    HandleWorksheetNameToken();
                    break;

                case TokenType.Operator:
                case TokenType.Negator:
                    if (token.Value == "+" || token.Value == "-")
                    {
                        HandleNegators();
                    }
                    break;
                }
                _navigator.MoveNext();
            }
        }