July 25, 2014
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

-- 
/Jacob Carlborg
July 26, 2014
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

This is good to see.  Unfortunately, scala is even more foreign to me than Java.  I hope you're able to show some promising results soon.  I'm rooting for this.

Mike
July 26, 2014
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
July 26, 2014
On 2014-07-26 15:49, Mike wrote:

> 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

I can just as easy output it directly to D as XML. Or is there are tool that can do that already. Is that what JaML is?

-- 
/Jacob Carlborg
July 26, 2014
On Saturday, 26 July 2014 at 14:23:21 UTC, Jacob Carlborg wrote:
> On 2014-07-26 15:49, Mike wrote:

> I can just as easy output it directly to D as XML. Or is there are tool that can do that already. Is that what JaML is?

JaML appears to just be a schema.  I tried to find a utility that already did such a thing, but failed.  Otherwise, I would have started the project.

I was thinking that the conversion would take quite a bit of logic, and if so, could be deferred to D so others could help with it.  But if it's no more of a burden to output D code, then let it be D.

Mike
1 2 3
Next ›   Last »