What Is Compilier

Posted by Tushar

  • A program that translates an executable 
  • program in one language into an executable program in another language.
  • we expect the program produced by the 
  • compiler to be better, in some way, than the original




Role of Compilers:


High-level programming languages provides following advantages -

  • increase programmer productivity 
  • better maintenance
  • portable
but we require following Low-level machine details too! 
  • instruction selection 
  •  addressing modes
  •  pipelines
  •  registers & cache
  • instruction-level parallelism


The Structure of a Compiler:




Multiple Phases
Modern compilers contain two (large) parts, each of which is often subdivided. These two parts are the front end, shown in green on the right and the back end, shown in pink.

The front end analyzes the source program, determines its constituent parts, and constructs an intermediate representation of the program. Typically the front end is independent of the target language.

The back end synthesizes the target program from the intermediate representation produced by the front end. Typically the back end is independent of the source language.


Advantage of  front/back end division 

This front/back division very much reduces the work for a compiling system that can handle several (N) source languages and several (M) target languages. Instead of NM compilers, we need N front ends and M back ends. For gcc (originally standing for Gnu C Compiler, but now standing for Gnu Compiler Collection), N=7 and M~30 so the savings is considerable.

The front and back end are themselves each divided into multiple phases. The input to each phase is the output of the previous. 
Sometime a phase changes the representation of the input.
For example, the lexical analyser converts a character stream input into a token stream output. 

Sometimes the representation is unchanged. 
For example, the machine-dependent optimizer transforms target-machine code into (hopefully improved) target-machine code.

Conceptually, there are three phases of analysis with the output of one phase the input of the next. The phases are called lexical analysis or scanningsyntax analysis or parsing, and semantic analysis
Read More

How to Show any Widget Only on Homepage in webpage

Posted by Tushar Bedekar
 
To show Widget only on homepage, add a conditional tag for with the widget you have used . Go to Template >> Edit HTML >> Search for the widget and add red coloured conditional tag below.
Normally, you can find the widget in "Mainblog/ Mainwrapper" if you put the Widget over blog post. I suggest you use a widget title and search the title in HTML editor. Thus you can easily find the widget. Now add the red coloured tag as shown in the code.


Example :
<b:widget id='HTML5' locked='false' title='Testing Widget' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
</b:if>
<b:include name='quickedit'/>

</b:includable>
Read More

Latest Updates Widget for Blogger

Posted by Tushar Bedekar
 It is one of the most attractive widget for blogger , is provide a quick navigation system for your visitors . it look like as :





Procedure:
1.      Go to Template > Edit HTML

2.  Now past the billow code in CSS
                           Or    
       Search  “  ]]></b:skin>  “ and past the billow code just above it
Code:
.samazhlo {
background: #4371CF;
position:absolute;
float: left;
padding: 0 10px;
height: 32px;
line-height: 30px;
color: #FFF;
font-family: Oswald,arial,Georgia,serif;
text-transform: uppercase;
font-size: 10pt;
margin-right: 10px;}

.head_brnews{
height:30px;background:#fff;width:100%;max-width:1250px;margin:0 ;border-style: solid ;
border-width: 1px;border-color: #cccccc;overflow: hidden;width: auto;margin-top:10px;}
.breaking-news{
float:left;
height:30px;
position:relative;
overflow:hidden;
margin-bottom:20px;
}
.breaking-news h4{
background: #9EC22D;
display:block;
float:left;
padding:0 10px;
height:32px;
line-height:30px;
color:#FFF;
font-family: Oswald,arial,Georgia,serif;
text-transform:uppercase;
font-size:10pt;
margin-right:10px
}
.breaking-news ul{
float:left
}
.breaking-news a:hover{
color:#333;
}
.breaking-news ul li{
float:left;
display:block;
list-style:none;
}
.breaking-news ul a{
padding:1px;
display:block;
color:#333;
white-space:nowrap;
float:left;
line-height:30px;
font-size:13px;
font-family: 'Droid Serif', serif;
display:hidden;
}
.breaking-news span{
display:block;
float:left;
padding:1px 10px;
color:#333;
font-size:12px;
line-height:30px;
}
3.    Now  past the billow code any where Between  <head>  &  </head>   where u want the widget to be display
       for example past it after the navigation bar code  </div>
code:
<div class='head_brnews'>
<div class='breaking-news'><div class='samazhlo'>Latest Updates</div> 
<script src='https://dl.dropboxusercontent.com/u/80436322/autoscroll.js' type='text/javascript'/>

  <script type='text/javascript'>
       var nMaxPosts =6;
        var nWidth = 100;
        var nScrollDelay = 70;
        var sDirection = &quot;left&quot;;
        var sOpenLinkLocation = &quot;N&quot;;
        var sBulletChar = &quot;&gt;&gt;&quot;;
</script>
<script src='/feeds/posts/default?alt=json-in-script&amp;callback=RecentPostsScrollerv2&amp;max-results=6' type='text/javascript'/>
  </div>
</div>
4.   Now save the template
That’s it……………….
Happy Blogging!

   By- TYD group
Read More

Frequently Asked Questions In C

Posted by Tushar Bedekar
                                
Q1. Write a simple program to find the size of different basic data types in c?

Q.2 Write a program in c for showing working of different logical operator in C.
Your program should guide user with proper message/menu on the console.

Q.3 Write a function to find the area of a triangle whose length of three sides is given.

Q.4 Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50% in the test.

Q.5 Write a C function to swap two given numbers using call by reference mechanism?

Q.6 Write a C program for finding GCD of two given numbers.

Q.7 Write a C program for addition of two 3x3 matrix.

Q.8 Write a C programme for counting the number of words in a given string?

Q.9 Write a C programme for concatenating two given strings?

Q.10 Write a C program using structure to find students grades in a class?

Q.11 Write a program to insert any 10 numbers and calculate its EVEN SUM,ODD SUM and EVEN AVERAGE,ODD AVERAGE.

Q.12 Write a program to insert any ten numbers and find minimum and maximum numbers.

Q.13 Write a program to calculate a given number is a prime number or not.

Q.14 Write a program to swapping two values using pointer and malloc function.

Q.15 C program for malloc function with example.








 For More Questions Please visit the link Given Below

                                                                 
                                                          

Read More
back to top