예제 #1
0
 /// <summary>
 /// Собственно анализ
 /// </summary>
 /// <param name="sender">инициатор события</param>
 /// <param name="e">список токенов</param>
 protected override void DoAnalyse(AnalyserParameters e)
 {
     e.First();
     if ((e.Length > 1) && (e.MatchTokens(DelphiTokens.Var) || e.MatchTokens(DelphiTokens.Public)))
     {
         e.Next();
         switch (e.Current.Token)
         {
         case DelphiTokens.Id:
         case DelphiTokens.Name:
         case DelphiTokens.Register:
         case DelphiTokens.Message:
         case DelphiTokens.Read:
         case DelphiTokens.Write:
         case DelphiTokens.Default:
             AddError(e, 1);
             break;
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Строка
        /// </summary>
        protected void Str()
        {
            while (true)
            {
                switch (e.Current.Token)
                {
                case DelphiTokens.String:
                case DelphiTokens.Char:
                    e.Next();
                    break;

                default:
                    return;
                }
            }
        }