Results 1 to 6 of 6

Thread: Compilers & Interpreters programs

  1. #1
    Join Date
    Sep 2010
    Posts
    19

    Compilers & Interpreters programs

    I have recently started learning C programming language. I have just gone through some basic things that are used for simple coding. Now I am interested in knowing about the compilers and interpreters program. I have just passed out basic certification course in computers and now I am more interested in C programming language, since it is considered as simple and basic language. Now its my kind request to provide some helpful information about the topic.

  2. #2
    Join Date
    Nov 2008
    Posts
    94

    Re: Compilers & Interpreters programs

    A source file containing the text of the program code has been written by the team of programmers. Computers can only execute instructions that are in machine code, so the source code programs can not run directly on your computer. A compiler must first convert the source into an intermediate file named object file or object code file. The object file contains a copy of the program code into machine language, but still not considered an executable program.

  3. #3
    Join Date
    Dec 2008
    Posts
    87

    Re: Compilers & Interpreters programs

    Although the order may change, some steps can be combined or split at other stages or even other phases can be inserted, but general, compilers follow these tasks:
    • Analysis lexicon. It is the initial part of reading and analyzing the source code. The text is read and divided into tokens, each of which corresponds to a symbol on the programming language, for example, the name of a variable, keyword or number.
    • Analysis syntactic. At this stage takes a list of tokens produced by the lexical analysis and settles into a tree structure called syntax tree reflects the structure of the program. This phase is also called parsing.
    • Verification of types. In this part of the syntax tree is analyzed to determine whether the program violated certain requirements of consistency, ie, if a variable is used but not declared, or if used in a context that does not make sense for variable type, such as a string to use a Boolean value as a function pointer.
    • Generation of intermediate code. The program is translated into simple language machine independent.
    • Location of records. The symbolic names of the variables used in the intermediate code is translated into numbers, each of which corresponds to a record in the target machine code (the machine that will eventually run the program.)
    • Generation of machine code. The intermediate language is translated into assembly language (a text representation of machine code) for a specific machine architecture.
    • Assemble and link. The assembly language code is translated into a binary representation and determines the actual address of the variables, functions, etc.

  4. #4
    Join Date
    May 2008
    Posts
    222

    Re: Compilers & Interpreters programs

    A program linker (linker), combines all the modules in the object file to form an executable file. An executable file itself is a complete program in itself, ie not required to reference the original source. This means it will run faster, compared to the execution of the program when it is still not executable. An interpreter translates source code into machine language as well. The shell differs from compiler that runs every order once it is translated. This process can slow the execution of the program and that interpreters are used unless compilers. An interpreter is another way of implementing a programming language. The interpretation shares many aspects with the compiler. The lexical, syntactic and type checking are exactly the same as in a compiler.

  5. #5
    Join Date
    Apr 2009
    Posts
    49

    Re: Compilers & Interpreters programs

    The interpretation shares many aspects with the compiler. The lexical, syntactic and type checking are exactly the same as in a compiler.
    But instead of generating code syntax tree, the syntax tree is processed directly to evaluate expressions and execute statements, and so complete. An interpreter may need to evaluate the same part of the syntax tree several times (eg when making cycles), so the interpretation may be slower than running a compiled program. But writing an interpreter is easier to move to a different machine, so for applications where speed does not matter, it is best to use an interpreter.

  6. #6
    Join Date
    Feb 2010
    Posts
    592

    Re: Compilers & Interpreters programs

    It is very useful know how to make an interpreter or a compiler, because it allows programmers to get an idea of what the high-level programs, which in turn will help developers to create more efficient code. Other reasons. The errors returned by the compilers provide an easy way to understand the source code, also known the difference between lexical errors, syntactic errors, types, and so on.

Similar Threads

  1. Replies: 4
    Last Post: 29-03-2011, 07:23 AM
  2. Serious optimizer bug in current Intel Fortran compilers
    By Christofer in forum Software Development
    Replies: 7
    Last Post: 27-09-2010, 07:30 AM
  3. Replies: 7
    Last Post: 14-08-2009, 09:03 PM
  4. Replies: 0
    Last Post: 10-01-2009, 08:37 PM
  5. Replies: 3
    Last Post: 05-09-2006, 05:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,312,229.12571 seconds with 17 queries