On Friday, 25 July 2014 at 20:15:39 UTC, Jacob Carlborg wrote:
On 2014-07-21 11:35, Mike wrote:
Well, I've never written any Java code before, and I'm not
looking
forward to learning yet another language. Is it possible to
utilize the
java parser from D?
Just for the record, I started a project to do this [1]. It's
very simple so far. But the basic structure is there. It sets
up the compiler, starts the parsing and so on. Just start
adding visitor methods like this [2] for different language
constructs.
[1] https://github.com/d-widget-toolkit/jport
[2]
https://github.com/d-widget-toolkit/jport/blob/master/src/dwt/jport/analyzers/CodeAnalyzerTreeVisitor.scala#L14
I've been thinking more about this. If you could use this scala
code to output the java code is something more consumable by D,
it may be easier for others in this community to help build on it.
I realize there will need to be semantic analysis, but as long
the syntax is appropriately annotated as methods, parameters,
types, expressions, etc... and maintains lexical order, D could
do the semantic analysis.
I'm thinking something like JaML:
http://www2.informatik.uni-wuerzburg.de/uploads/media/jaml_technical_report.pdf
Mike