private SymParserWorker.TTokenConsumptionType OnStateDefineArguments(SymToken aToken)
 {
     SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed;
     //
     if (aToken.Class == SymToken.TClass.EClassWhiteSpace && iFunctionParser.CurrentLevelNumber == 0)
     {
         // Got some whitespace - so we're going to bail
         MakeDefineArgument();
         State = TState.EStateMiddleWhiteSpace;
     }
     else if (aToken.Class == SymToken.TClass.EClassNewLine || aToken.Class == SymToken.TClass.EClassContinuation)
     {
         // Do nothing - new line is handled by base class (so we must not consume it)
         // and continuations are ignored.
     }
     else
     {
         // Keep reading tokens until we hit some whitespace
         bool consumed = iFunctionParser.OfferToken(aToken);
         if (consumed == true)
         {
             ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed;
         }
     }
     //
     return(ret);
 }
 private SymParserWorker.TTokenConsumptionType OnStateDefineValue(SymToken aToken)
 {
     SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed;
     //
     if (aToken.Class != SymToken.TClass.EClassNewLine)
     {
         iTokens.Append(aToken);
         ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed;
     }
     //
     return(ret);
 }
        public override SymParserWorker.TTokenConsumptionType OfferToken(SymToken aToken)
        {
            SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed;
            //
            while (ret == SymParserWorker.TTokenConsumptionType.ETokenNotConsumed)
            {
                TState currentState = State;
                switch (State)
                {
                case TState.EStateInitialWhiteSpace:
                    ret = OnStateInitialWhiteSpace(aToken);
                    break;

                case TState.EStateDefineName:
                    ret = OnStateDefineName(aToken);
                    break;

                case TState.EStateDefineArguments:
                    ret = OnStateDefineArguments(aToken);
                    break;

                case TState.EStateMiddleWhiteSpace:
                    ret = OnStateMiddleWhiteSpace(aToken);
                    break;

                case TState.EStateDefineValue:
                    ret = OnStateDefineValue(aToken);
                    break;

                default:
                    break;
                }

                TState newState           = State;
                bool   statesDidNotChange = (currentState == newState);
                if (statesDidNotChange)
                {
                    // If the state handlers didn't want the token, then we
                    // offer it to the base class instead
                    if (ret == SymParserWorker.TTokenConsumptionType.ETokenNotConsumed)
                    {
                        ret = base.OfferToken(aToken);
                    }
                }
            }

            return(ret);
        }
 private SymParserWorker.TTokenConsumptionType OnStateMiddleWhiteSpace(SymToken aToken)
 {
     SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed;
     //
     if (aToken.Class == SymToken.TClass.EClassWhiteSpace)
     {
         // Skip leading whitespace
         ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed;
     }
     else
     {
         // Change state
         State = TState.EStateDefineValue;
         ResetTokenContainer();
     }
     //
     return(ret);
 }
        public virtual SymParserWorker.TTokenConsumptionType OfferToken(SymToken aToken)
        {
            SymParserWorker.TTokenConsumptionType consumptionType = TTokenConsumptionType.ETokenNotConsumed;
            //
            int count = iChildren.Count;

            for (int i = 0; i < count; i++)
            {
                SymParserWorker worker = this[i];
                consumptionType = worker.OfferToken(aToken);
                //
                if (consumptionType == SymParserWorker.TTokenConsumptionType.ETokenConsumed)
                {
                    break;
                }
            }
            //
            return(consumptionType);
        }