Home » Ask & Discuss » Other Courses » Computer Applications « Back to Discussion



Computer Applications

Sudeshna  Shyam's Avatar
New kid on the Block

Joined: 14 Oct 2008
Post: 9
14 Oct 2008 20:16:09 IST
0 People liked this
1
552 View Post
How can I design a simple compiler for a new precedure-oriented programming language?
None

How can I design a simple compiler for a new precedure-oriented programming language?


Share this article on:

Comments (1)


Forum Expert
Joined: 5 Nov 2008
Posts: 13
6 Nov 2008 16:28:52 IST
0 people liked this

Compiler is a program that reads a program written in one language, called source language, and translated it in to an equivalent program in another language, called target language. It reports errors during the translation of source code to target language code.Source program can be of any programming language. Target program can be either Assembly language code or machine code. The first phase of the compiler, Lexical Analyzer, can be implemented using LEX tool provided with Linux. The second phase, Syntax Analyzer, can be implemented by using Yacc tool provided by Linux. The third phase, Semantic Analyzer, and the fourth phase, Intermediate Code Generation, are carried out as the part of action corresponding to the production rules in the parser.


There are mainly SIX phases of a compiler. The first four Lexical analysis, Syntax analysis, Semantic analysis and Intermediate Code Generation are part of Analysis phases, which are machine independent phases. While the other two Code Optimization and Code Generation are part of Synthesis phases, which are highly machine dependent phases.


one should have thorough knowledge of each tools and cross compiler etc.




Quick Reply


Reply

Some HTML allowed.
Keep your comments above the belt or risk having them deleted.
Signup for a avatar to have your pictures show up by your comment
If Members see a thread that violates the Posting Rules, bring it to the attention of the Moderator Team
Free Sign Up!

Preparing for IIT-JEE ?

Arihant Revision Package for IIT JEE - Books, Practice Tests + Rank Predictor


@ INR 1,995/-

For Quick Info

Name

Mobile No.

Find Posts by Topics

Physics.

Topics

Mathematics.

Chemistry.

Biology

Parents

Board

Fun Zone

Sponsored Ads