Re: Expression Compiler
Mark Proctor <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
On 07/11/2010 21:21, Thomas Mahler wrote: > Hi Mark, > > The ASM examples contain a simple expression compiler that might be useful as a starting point. > > You might also have a look at my fun4j lisp compiler which uses the same approach: > http://www.fun4j.org/tutorial-assembler.html I notice fun4j is a literal translation of the source logic. I was trying to produce an output that matched the Eclipse ASM bytecode outline tool. However the bytecode there is optimised, >= is turned to <, || and && have the statements organised to reduce unecessary goto's and minimise statement executed. Is that kind of optimisation necessary, shouldn't the JVM be doing all of that no matter how the bytecode is written? Also while I'm in the process of learning is it possible to stop the tool from doing that, so I can more easily compare the bytecode I am producing to that of a java compiler. Mark > Clojure also uses ASM as an AST compiler. It might be useful to have a look at it too! > > best regards, > Thomas > > > -----Ursprüngliche Nachricht----- > Von: "Mark Proctor"<[email protected]> > Gesendet: 07.11.2010 21:03:59 > An: "[email protected]"<[email protected]> > Betreff: [asm] Expression Compiler > > I'm in the process trying to make an MVEL to bytecode converter. MVEL is > a java expression language that supports strict typing, with type > inference, coercion and property support. MVEL produces an evaluation > tree that I'm using a visitor approach to generate the bytecode with. I > was wondering if something like this exists already, even if it's just > an example of how to take an expression in the form of an AST and > generate bytecode from it. > > http://mvel.codehaus.org/Language+Guide+for+2.0 > http://mvel.codehaus.org/Basic+Syntax > > Mark > ___________________________________________________________ > Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief! > Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02 > >
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws