How can i run an c# function with Irony parser

Feb 21, 2012 at 10:24 AM

Hello,

I try to write a shell script with Silverlight/C #.
I know how to parse a unit c # (using Irony).
Can I start a running feature of the unit parsed.

sample:

Unit :
-------
"namespace Irony.Samples.CSharp {                                                 
   class sample
   {                                                                             
      public void sample()                                                        
      {                                                                          
      }                                                                          
                                                                                 
      const int constint = 1;                                                    
      public int toto(ref int param1, int param2)                                
      {                    
            int result = param1 + param2;
            return result;                                                  
      }                                                                          
   }                                                                             
} "

I Want execut toto(5, 10) and recover the return value.

Sorry for my bad english

Coordinator
Feb 21, 2012 at 7:25 PM

c# grammar can do parsing only - there is no interpreting model for it (AST nodes like in expression evaluator sample). 

Feb 22, 2012 at 6:05 AM

Thank you for that answer.

I was afraid  i had to build my own interpreter.

'll have to do