Hi there,
I am still playing with my interpreter for arithmetic expressions.
Now I would like to work with mixed expressions containing integer and
floating point numbers.
When doing so I would like to have the integers automatically
"uppercasted" when
they occur in an expression together with floats.
So what I currently do is, that I have a Java class providing methods
for the respective
arithmetic operations and invoke it from my interpreter:
^(MINUS a=expr b=expr) { $value = Arithmetic.subtract($a.value,
$b.value);}
In the add-method I check for the type of the parameters passed in and
do the conversion
to BigDecimal magic.
However I would like to make this "implicit uppercast" independant
from the host language for
my interpreter to minimize the amount of code I have to change, when
switching the host language.
Has anyone already done such a thing via a TreeWalker?
Tilman Bender
Student des Software Engineering
Hochschule Heilbronn
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address