6 Replies - 16479 Views - Last Post: 20 August 2010 - 01:38 AM

#1 cybernaut09  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 01-June 08

How to write a programming language translator

Posted 11 March 2010 - 11:51 PM

Hi
I need to write a program to translate one programming language to another programming language . The translation only need to be high level , like translation of code from c++ to java . Translation of simple methods is only what is required . It may not have to be perfect translation also (but wouldnt it be great!). How should I approach this ? Should I use a scripting language for this task ? I was not able to find some relevant resouces to guide me . On googling I found out that what I wanted to write is a Transpiler , but nothing much .So , please help me with this .

This post has been edited by cybernaut09: 12 March 2010 - 12:01 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to write a programming language translator

#2 cybernaut09  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 01-June 08

Re: How to write a programming language translator

Posted 11 March 2010 - 11:52 PM

Hi
I need to ...... help me with this .


sorry...topic got posted twice . So editing this one .

This post has been edited by cybernaut09: 12 March 2010 - 12:02 AM

Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to write a programming language translator

Posted 11 March 2010 - 11:56 PM

Topics merged :)
Was This Post Helpful? 0
  • +
  • -

#4 Martyn.Rae  Icon User is offline

  • The programming dinosaur
  • member icon

Reputation: 540
  • View blog
  • Posts: 1,406
  • Joined: 22-August 09

Re: How to write a programming language translator

Posted 13 March 2010 - 12:48 PM

View Postcybernaut09, on 12 March 2010 - 05:51 AM, said:

Hi
I need to write a program to translate one programming language to another programming language . The translation only need to be high level , like translation of code from c++ to java . Translation of simple methods is only what is required . It may not have to be perfect translation also (but wouldnt it be great!). How should I approach this ? Should I use a scripting language for this task ? I was not able to find some relevant resouces to guide me . On googling I found out that what I wanted to write is a Transpiler , but nothing much .So , please help me with this .


If you would like to read my tutorials on the Fundamentals of Parsing, which would be an essential part of the translation process, it can be found here. Also, I have written tutorials on how to Write an Interpreter, Part II, Part IIIA and Part IIIB would be of relevance to your project. Having been in your situation a number of times, the parsing, syntax tree production and Abstract Tree Production, is the same regardless of whether, you are writing a compiler, an interpreter, cross-compiler or language translator. You need to build a syntax tree of the source language before you can begin to translate to a target language.

Keep the postings coming on this one, and I will endeavour to help you if you get stuck, or need any clarifications.
Was This Post Helpful? 1
  • +
  • -

#5 cybernaut09  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 01-June 08

Re: How to write a programming language translator

Posted 15 March 2010 - 08:46 PM

Hey thanks Martyn .
Was This Post Helpful? 0
  • +
  • -

#6 Aurel300  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 230
  • Joined: 10-November 07

Re: How to write a programming language translator

Posted 19 March 2010 - 02:13 PM

Either that...
Or...
AI using neural networks.
In fact, it is easier than hard coded translator. The only drawback might be inaccuracy, but after a little bit of learning it might just be alright for that.
I mean, I KNOW this is a big project, but any kind of translator is.

Also, google translator is an AI...
Something that might help you understand the concept:
http://en.wikipedia..../Neural_network
http://en.wikipedia...._neural_network
http://www.statsoft....eural-networks/
http://www.doc.ic.ac...s11/report.html

Google more if you want...
Was This Post Helpful? 0
  • +
  • -

#7 Guest_vignesh*


Reputation:

Re: How to write a programming language translator

Posted 20 August 2010 - 01:38 AM

Hi sir,

first of all i'm feeling happy that i got another in this world other than me to think like my project. I too have the same idea and searching for it. If i get any advancement in this i will inform you. With dream project bidding adieu....
Was This Post Helpful? 0

Page 1 of 1