J
Jon Slaughter
I'm curious as to if .NET provides any direct means to modifying its own
grammar? e.g., if say I want to had some "features" to C# which can easily
be reinterpreted back into the original C# but I do not want to have to
write a full blow parser just to change some simple thing.
Lets suppose want to add a "macro" that on the surface adds the keyword
"property" which in reality is just a shorthand for the standard properties
in C#. I know VS has abilities to do macro's but they are more like "code
inserts" than preprocessing. I want something that is transparent in that it
acts like an extended version of C# but translates directly into it(through
preprocessing).
I know many will say that one shouldn't do this but thats not the point. I
don't want to hack together a quick brute force parser to do some small
conversions but I also don't want to have to implement a full blown parser
to handle a few modifications I want to do.
To be more clear, what I want is some way to preprocess C# files in a
grammatically compatible way to add some small isomorphic features to C#.
The method will simply generate a cs file that will be treated in the normal
way. (Although there is the problem of error handling but its not that big a
deal at this point)
Thanks,
Jon
grammar? e.g., if say I want to had some "features" to C# which can easily
be reinterpreted back into the original C# but I do not want to have to
write a full blow parser just to change some simple thing.
Lets suppose want to add a "macro" that on the surface adds the keyword
"property" which in reality is just a shorthand for the standard properties
in C#. I know VS has abilities to do macro's but they are more like "code
inserts" than preprocessing. I want something that is transparent in that it
acts like an extended version of C# but translates directly into it(through
preprocessing).
I know many will say that one shouldn't do this but thats not the point. I
don't want to hack together a quick brute force parser to do some small
conversions but I also don't want to have to implement a full blown parser
to handle a few modifications I want to do.
To be more clear, what I want is some way to preprocess C# files in a
grammatically compatible way to add some small isomorphic features to C#.
The method will simply generate a cs file that will be treated in the normal
way. (Although there is the problem of error handling but its not that big a
deal at this point)
Thanks,
Jon