Question Reflections

DalexL

Active member
Joined
Jul 3, 2010
Messages
34
Programming Experience
3-5
I've decided to make my own simple scripting language parser. I've created about 50% of it and it works great! I need to implement "functions". What ever program uses my parser needs to be able to connect functions to my parser for customization.

I've implemented "Lua", a scripting language, in a vb.net application of mine. To connect functions to the Lua Parser it used reflections.

I need to be able to (by only knowing the name of the function and its structure) call a function connected through the implementing application.

Does anybody know any details on using reflections for this purpose? I've tried "Googling" it but "Reflections" is a much larger range of things than I though.
 
Are you actually talking about Reflection, rather than reflections? If so then calling a method consists of calling GetType to get a Type object, calling GetMethod on that Type and specifying a method name to get a MethodInfo object, then calling Invoke on that MethodInfo to invoke the method on a particular object.
 
Back
Top