I am developing an Desktop Application in WPF using C# .
For the sake of simplicity, Assume my Application has functions which draw lines  in said direction goleft() , goright() , goforward() , goback() . 
when any of these function is called a line of one inch will be drawn on screen.
I want to make application where user will write code in a file in any editor (say notepad) and save that file in some fixed format (say .abc or .xyz)
Imaginary Example :
   (section_start)
   For(int i = 0 ; i<= 20 ; i++ ) 
    {
      if(i<5)
      goforward();
      else if(i==5)   
       goleft();
      else if(i < 10)
       forward();
        .......
        ........
    }
    (section_End)
Can i make application which should be capable of reading this file and execute code which is written in between of (section_start) and (section_End). and only if possible can check for syntax errors too... (Not compulsory).
Please guide me on this issue :
Disclosure : My actual Application is somewhat else and could not discuss here due to my company's rules.
Thanks to all who replied to my question. Stackoverflow is fantastic site , i have found the roadmap where to go , till today morning i did not have any clue but now i can go ahead , thanks all of you once again Will ask question again if i get stucked somewhere