Quantcast
Channel: Questions in topic: "parser"
Viewing all articles
Browse latest Browse all 108

Make the compiler evaluate a string as a chunk of code to be compiled?

$
0
0
I want to create a method which will take ANY variable type as an argument. And by any I mean user-defined types, so it could be a very flexible method that can be reused anytime. Kind of: static internal class ArrayFill { public int Fill (**PARSED_STRING_TYPE** arr) { *whatever code goes in here* } } So the first idea I came up with is parsing a string, since in my last job I worked with a language that would let me to parse a string during runtime, but from my research it doesn't seem that exists here. So I thought maybe it could be done in some way prior to compilation, in Editor scripting somehow? I thought a workaround could be overloading the method, but I would like to avoid overloading for each type.

Viewing all articles
Browse latest Browse all 108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>