Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to break up the code in a method body into statement by statement symbols/"tokens"
    primarykey
    data
    text
    <p>I'm writing something that will examine a function and rewrite that function in another language so basically if inside my function F1, i have this line of code <strong>var x=a.b(1)</strong> how do i break up the function body into symbols or "tokens"?</p> <p>I've searched around and thought that stuff in System.Reflection.MethodInfo.GetMethodBody would do the trick however that class doesn't seem to be able to have the capabilities to do what i want..</p> <p>what other solutions do we have? </p> <p>Edit: Is there anyway we can get the "method body" of a method using reflection? (like as a string or something)</p> <p>Edit 2: basically what I'm trying to do is to write a program in c#/vb and when i hit F5 <strong>a serializer function</strong> will (use reflection and) take the entire program (all the classes in that program) and serialize it into a single javascript file. of course javascript doesn't have the .net library so basically the C#/VB program will limit its use of classes to the .js library (which is a library written in c#/vb emulating the framework of javascript objects).</p> <p>The advantage is that i have type safety while coding my javascript classes and many other benefits like using overloading and having classes/etc. since javascript doesn't have classes/overloading features natively, it rely on hacks to get it done. so basically <strong>the serializer function</strong> will write the javascript based on the C#/VB program input for me (along with all the hacks and possible optimizations).</p> <p>I'm trying to code this <strong>serializer function</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload