Results 1 to 3 of 3

Thread: translator??

  1. #1

    Thread Starter
    Junior Member xtci's Avatar
    Join Date
    Feb 2003
    Posts
    22

    translator??

    whats the difference between compiler, translator and intepreter

    and how to create translator, for my own language??

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    In the computer world -

    Interpreter - takes code and figures out what the instruction stream should be on the fly. Very slow. QBASIC is an interpreted language. You cannot run a QBASIC file outside of the QBASIC executable

    Compiler - turns code into a separate .EXE file that will run on it's own.

    Translator turns one language into another - example COBOL to C. These are generally used for porting legacy source code that is so old the machines it originally compiled on no longer exist.
    Translating human languages by computer DOES NOT work well.

    Making a translator is similar to creating an interpreted language, you simply parse the code and execute (or in this case turn it into a known statment in another language)

    Attached is a C interpreter written in C. This will give you an idea on how to parse language statements.
    Attached Files Attached Files

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Jim, I still haven't got an answer to this, so i wonder if you could tell me. How would you bypass the problem with left recursion without losing associative properties?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width