- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
COBOL translator with Scala DSL
Sun, 2009-06-14, 19:51
I am looking at alternative technologies on a translator from COBOL to
Java/.Net languages.
One choice is to use a compiler tool like ANTLR.
Another option is using Scala that has strong foundation to build DSL.
I need to have an idea from Scala founders.
Regards
Erol Akarsu
Mon, 2009-06-15, 08:57
#2
Re: COBOL translator with Scala DSL
I agree with John. Do yourself a favour and write it from scratch in
idiomatic scala/java/csharp/whatever. You will be glad you did.
LJ
John Nilsson wrote:
>
> Why?
>
Mon, 2009-06-15, 12:37
#3
Re: COBOL translator with Scala DSL
eakarsu wrote:
>
>
> I am looking at alternative technologies on a translator from COBOL to
> Java/.Net languages.
>
> One choice is to use a compiler tool like ANTLR.
>
> Another option is using Scala that has strong foundation to build DSL.
>
> I need to have an idea from Scala founders.
>
>
> Regards
>
> Erol Akarsu
>
When I had to write a translator from COBOL to anything else I would use a
specialized tool for this.
I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
really powerfull. You woud be able to define a COBOL like DSL and generate
Java or Scala sources.
Regards,
Martin
Mon, 2009-06-15, 18:27
#4
Re: COBOL translator with Scala DSL
Thanks for Reply,
I need to automate the translation process somehow and looking for better
method. Here I would translate millions lines of COBOL code.
Yes your are correct that I need to try to map first language constructs and
do translation theoretically.
Is it what you mean?
Regards
Erol Akarsu
L Jantzen wrote:
>
> I agree with John. Do yourself a favour and write it from scratch in
> idiomatic scala/java/csharp/whatever. You will be glad you did.
>
> LJ
>
>
> John Nilsson wrote:
>>
>> Why?
>>
>
>
Mon, 2009-06-15, 18:37
#5
Re: COBOL translator with Scala DSL
Thanks Martin,
I will look at them
Erol Akarsu
Martin Kuhn wrote:
>
>
> eakarsu wrote:
>>
>>
>> I am looking at alternative technologies on a translator from COBOL to
>> Java/.Net languages.
>>
>> One choice is to use a compiler tool like ANTLR.
>>
>> Another option is using Scala that has strong foundation to build DSL.
>>
>> I need to have an idea from Scala founders.
>>
>>
>> Regards
>>
>> Erol Akarsu
>>
>
> When I had to write a translator from COBOL to anything else I would use a
> specialized tool for this.
>
> I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
> http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
> really powerfull. You woud be able to define a COBOL like DSL and generate
> Java or Scala sources.
>
> Regards,
> Martin
>
Mon, 2009-06-15, 20:17
#6
Re: COBOL translator with Scala DSL
I meant "Why?" more as in: "What makes the current COBOL code so
unusable that it is worth the effort, and risk of introducing defects,
to translate it to something else?"
Anticipating that the reason is that the code is no longer
maintainable due to COBOL knowledge disappearing from the organization
and that the code need to continue to evolve. I think translating the
COBOL code won't buy you anything. The result will undoubtedly be even
more esoteric and unmaintainable.
Maybe a better strategy would be to either integrate the existing
COBOL functionality with new features developed in another language
or, as LJ suggested, replace the COBOL code by hand.
BR,
John
On Mon, Jun 15, 2009 at 7:18 PM, eakarsu wrote:
>
> Thanks for Reply,
>
> I need to automate the translation process somehow and looking for better
> method. Here I would translate millions lines of COBOL code.
>
> Yes your are correct that I need to try to map first language constructs and
> do translation theoretically.
> Is it what you mean?
>
> Regards
>
> Erol Akarsu
>
>
> L Jantzen wrote:
>>
>> I agree with John. Do yourself a favour and write it from scratch in
>> idiomatic scala/java/csharp/whatever. You will be glad you did.
>>
>> LJ
>>
>>
>> John Nilsson wrote:
>>>
>>> Why?
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/COBOL-translator-with-Scala-DSL-tp24024603p2403893...
> Sent from the Scala - User mailing list archive at Nabble.com.
>
>
Tue, 2009-06-16, 04:17
#7
Re: COBOL translator with Scala DSL
Martin,
Do you think current version of xtext can handle COBOL grammar efficiently
and correctly?
Have you had any experience with applying xtext project on large grammar?
Regards
Erol Akarsu
Martin Kuhn wrote:
>
>
> eakarsu wrote:
>>
>>
>> I am looking at alternative technologies on a translator from COBOL to
>> Java/.Net languages.
>>
>> One choice is to use a compiler tool like ANTLR.
>>
>> Another option is using Scala that has strong foundation to build DSL.
>>
>> I need to have an idea from Scala founders.
>>
>>
>> Regards
>>
>> Erol Akarsu
>>
>
> When I had to write a translator from COBOL to anything else I would use a
> specialized tool for this.
>
> I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
> http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
> really powerfull. You woud be able to define a COBOL like DSL and generate
> Java or Scala sources.
>
> Regards,
> Martin
>
Tue, 2009-06-16, 11:37
#8
Re: COBOL translator with Scala DSL
eakarsu wrote:
>
> Martin,
> Do you think current version of xtext can handle COBOL grammar efficiently
> and correctly?
> Have you had any experience with applying xtext project on large grammar?
>
From my point of view, every approach for converting COBOL to Java or Scala
would require to define something like a parser. You have to build/define
for your Cobol syntax a "DSL" which makes it possible to parse the existing
sources and to process it. There is NO predefined stuff for that!!!!!
XText is a specialized tool for code generation which makes it rather simple
to define a DSL (compared to other approaches).
From the website:
"Xtext is a framework for development of textual domain specific languages
(DSLs). Just describe your very own DSL using Xtext's simple EBNF grammar
language and the generator will create a parser, an AST-meta model
(implemented in EMF) as well as a full-featured Eclipse text editor from
that"
I use it extensively and I'm really impressed by the power of the tool.
But of course, the task is not simple whatever approach you will choose.
Tue, 2009-06-16, 12:27
#9
Re: COBOL translator with Scala DSL
eakarsu schrieb:
> I need to automate the translation process somehow
Not scala, but probably related: http://homepages.cwi.nl/~ralf/padl03/
- Florian.










On Sun, Jun 14, 2009 at 8:51 PM, eakarsu wrote:
> I am looking at alternative technologies on a translator from COBOL to
> Java/.Net languages.
Why?
BR,
John