I am making a script parser and I need to interpret the word AND and
"replace" it with an &, so that it can be compiled at runtime with the
C# compiler.
My script would read e.g: if( (iCounter1 < 20) AND (iCounter2 <
iCounter1) )
How can I make the compiler understand that AND means &? (or means &&)
I do not want to use the Replace("AND"," &") on the string I read,
because this gives me some validation implementation which I want to
avoid.
I have seen some nasty operator overloads of ** doing what Math.Pow
does and I hope there could be a way to do a reverse operator overload
of some kind on the AND to return &. (or &&)
Can I define an operator called AND which would be the same as & .....?
I have looked at the opCode-thing but found nothing.
Hmm, hope somebody has a good answer to this one. Any input is more
than welcome.
Thanks in advance.