Language Translator Using C

This is a discussion on Language Translator Using C within the C Programming forums, part of the General Programming Boards category; I want to write Language Translator using C what are the simplest steps I can follow. If anyone have previously ...

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    5

    Lightbulb Language Translator Using C

    I want to write Language Translator using C what are the simplest steps I can follow. If anyone have previously written translator using C please give that samples to study how can I write translator. This translator able to translate script written in one language to another language.
    Last edited by gihan; 05-01-2011 at 05:51 AM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,671
    Well the simplest (ignoring any grammar rules) is a direct word for word translation, say
    cat -> chat
    dog -> chien

    This can easily be done with arrays of words, and a simple search.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    5
    Quote Originally Posted by Salem View Post
    Well the simplest (ignoring any grammar rules) is a direct word for word translation, say
    cat -> chat
    dog -> chien

    This can easily be done with arrays of words, and a simple search.
    yep.

    my problem is how translate script which written in one programming language to another language. I think I'm not mention it clearly in my question I'll edit it and thanks for the reply.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by gihan View Post
    yep.

    my problem is how translate script which written in one programming language to another language. I think I'm not mention it clearly in my question I'll edit it and thanks for the reply.
    Oh boy... This is a BIG job... how much programming experience do you have?

    This isn't a task to be undertaken by someone who studied loops in class last week...

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    33
    will you please write the question more specifically??

    but i think you need to understand the grammar rules used in both the languages and then try to do conversion..

  6. #6
    Registered User
    Join Date
    May 2011
    Posts
    5
    Quote Originally Posted by CommonTater View Post
    Oh boy... This is a BIG job... how much programming experience do you have?

    This isn't a task to be undertaken by someone who studied loops in class last week...
    yep early I use Lex and Yacc to generate syntax trees and create parser. But in than scenario I want to do that using C. I plant to create tokenizer and mapping processor to generate new source code. I want to translate pure C code in to the CUDA but there are some similarities between C and CUDA due to that reason I'm planed not generate full syntax tree but when translate the method its necessary to have syntax tree but I'm unable to do that thats my problem. how to do that.

  7. #7
    Registered User
    Join Date
    May 2011
    Posts
    5
    Quote Originally Posted by Dibyayan Chakra View Post
    will you please write the question more specifically??

    but i think you need to understand the grammar rules used in both the languages and then try to do conversion..
    Ya I already mapped those grammer rules but programming part are still remaining thats the problem dude.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. language translator (having problems in tokenizing)
    By jumbo2410 in forum C Programming
    Replies: 2
    Last Post: 03-23-2009, 05:29 AM
  2. Translator
    By Mitchell in forum Tech Board
    Replies: 2
    Last Post: 04-11-2006, 09:26 AM
  3. Very Inefficient translator.
    By XenoForce in forum C++ Programming
    Replies: 15
    Last Post: 10-24-2004, 02:58 PM
  4. Translator
    By edshaft in forum C++ Programming
    Replies: 8
    Last Post: 05-09-2003, 10:27 AM
  5. IDEA: Programming language translator
    By ygfperson in forum Contests Board
    Replies: 1
    Last Post: 09-02-2002, 04:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21