title: Is there any way to identify reserved word in a code file through a program at runtime?
body: <p>Is there any way to identify the reserved word in a code file through a c# program?
  I think there is a place where c# keeps its tokens.
   where I can match my file words and identify them as a reserved word or not s reserved word.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApp1
  {
  class Program
  {
      static void Main(string[] args)
      {
          string filepath = @"C:\Users\yasir\Documents\Visual Studio 
        2017\Projects\ConsoleApp1\ConsoleApp1\ProductsController.cs";
          StreamReader sreader = new StreamReader(filepath); 
             //path of the file
  
  
  
          var lineCount = File.ReadAllLines(filepath).Count(line =&gt; 
            !string.IsNullOrWhiteSpace(line));
          string strFileContent = sreader.ReadToEnd(); //Read all the content
          sreader.Close();
  
  
          string[] words = strFileContent.Split(new char[] { ' ', '\r', '\n' 
            }, StringSplitOptions.RemoveEmptyEntries); 
          //Split by words and remove new lines empty entries
  
          foreach( string ew in words)
          {
  
              //here i have to write check reserved word logic...
          }
  
          Console.Write(lineCount);
  
  
          Console.ReadKey();
          }
  
          }
          }
  </code></pre>