You are on page 1of 4

Assignment #01

Compiler Construction

Submitted to Sir Aman ullah

Submitted by M.Waqas

Reg No Sp07-Bcs-029

Date Feb, 26, 10

Comsats Institute of Information Technology Lahore


Statement Instruction
The ability to control the flow of your program A programming instruction in a subroutine that tells
the processor to execute parts of a program only if
conditions are true
valuable to the programmer
A programming instruction used to disable a rung,
typically while testing a new program

Many types of statements e.g. assignment


An instruction set is a list of all the instructions,
statement Control statement ,compound
,selection ,iteration,jump statement else and all their variations, that a processor (or in
statement ,switch statement,break statement
,continuous statement etc the case of a virtual machine, an interpreter)
can execute.

Reserved Word Keyword


Reserved words are one type of grammatical Keywords are identifiers reserved by
construct in programming languages. int,switch the language for special use example
etc
auto,
break etc
reserved words include labels for primitive data Keyword do is usually used together
types in languages
reserved words in a language are defined The keyword extern is optional for a function
when a language is developed prototype.

Reserved word is a special word that cannot be A keyword is a word that is special only in
used as a user-defined name. certain contexts
Reserved words that are intended for possible keyword is extremely rarely used
use in future versions.

Parameter Argument
The parameter attribute specifies names for An argument is an entity used to pass the data
constants. from calling function to the called function
There are many types of parameters ,template There are two type formal argument ,actual
type ,non template ,template ,template argument
parameter
All function declarations for one particular An argument is one of the following: an
function must have the same number expression in the comma-separated list in a
and type of parameter, and must have the function call; a sequence of one or more
same return type. preprocessor tokens in the comma-separated
list in a macro call;
The term parameter refers to any declaration within
the parentheses following the function name in a
function declaration or definition

Inline function Macro


inline functions are similar to macros A macro is a bunch of code that gets put inline in the
code every time you put it in your program
inline functions are parsed by the compiler macros are expanded by the preprocessor
the compiler will insert the complete body of the macro takes up much more memory than does a
function in every place in the code where that function if it is to be used more than once.
function is used.
An inline function is one for which the compiler A macro can be used in a constant expression,
copies the code from the function definition such as an array bound
directly into the code of the calling function
rather than creating a separate set of
instructions in memory.

Variable Definition Variable Declaration


the memory area allocates the memory for the declaration tells about the signature of the variable
variable type and size to be considered

memory is allocated once the declaration can occur many times.


Definition is when you define a variable or give it a he declaration is into a - you are declaring a variable
value, so a = 10 would be a definition type integer

Formal Parameter Actual Parameter


Formal parameters are the parameters as Actual parameters (also known asarguments)
they are known in the function definition are what are passed by the caller.
int max(int a, int b) {
if (a > b) return a;
else return b;
}

int m = max(x, y);


the following code, a and b are the formal The following code x and y are the actual
parameters parameters
The variables declared in a subprogram The variables or expressions referenced in the
specification and referenced in the subprogram parameter list of a subprogram call are actual
body are formal parameters parameters.

You might also like