
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 205 Articles for Computer Programming

3K+ Views
Representing scope information is a concept in which the scope of each variable name is preserved in the symbol table so that we can use the same name in different blocks and different locations.Representing Scope Information involvesA lifetime of a variable in a particular block.Representing name in symbol table along with an indicator of the block in which it appears.Suppose we have a variable name 'a' in block A and the same variable in block B. Suppose we store 'a' in symbol table without block information. In that se, it will only keep the first instance of 'a' which it ... Read More

3K+ Views
During compilation, the symbol table is searched each time an identifier is encountered. Data are added if a new name or new information about an existing name is find. Thus, in designing a symbol table structure, it would like a scheme that enables us to insert new entries and identify current entries in a table effectively.There are four symbol tables used in a data structure which are as follows −Lists− The simplest and clear to implement a data structure for a symbol is the linear list of records as displayed in the figure.It can use a single array or several ... Read More

552 Views
It is a data structure including data for each identifier, fields for the attribute of the identifier. The data structure enables us to find the data for each identifier fastly and to save or retrieve the information for that record quickly.The symbol table is searched each time a name is encountered in the source text. When a new name or new data about an existing name is found, the content of the symbol table modifies. Thus, the symbol table should have an effective structure for creating the data held in the table also for inserting new entries to the symbol ... Read More

3K+ Views
The simplest way to execute syntax-directed translation is to use two passes. First, construct a syntax tree for the input and then walk the tree in depth-first order, completing the translations given in definition.The major issue with generating code for Boolean expression and flow of control statements in a single pass is that during a single pass we cannot understand the labels for which the control should goto at the time the jump statements are generated. It can get around this issue by making a sequence of branching statements with the targets of the jumps temporarily left undefined.Each such statement ... Read More

1K+ Views
Symbol Table is a data structure that supports an effective and efficient way of storing data about various names occurring in the source code. These names are used in the source code to identify the different program elements, like a variable, constants, procedures, and the labels of statements.The symbol table is searched each time a name is encountered in the source text. When a new name or new data about an existing name is found, the content of the symbol table modifies. Thus, the symbol table should have an effective structure for creating the data held in the table also ... Read More

16K+ Views
While generating three address codes for the given expression, it can specify the address of the Label in goto statements. It is very difficult to assign locations of these label statements in one pass so, two passes are used. In the first pass, it can leave these addresses unspecified & in the next pass, and it can fill these addresses. Therefore filling of incomplete transformation is called Backpatching.One-pass code generation using backpatchingBackpatching can be used to generate a program for boolean expressions and the flow of control statements in one pass. In this, synthesized attributes truelist and falselist of non-terminal ... Read More

14K+ Views
Control statements are the statements that change the flow of execution of statements.Consider the GrammarS → if E then S1 |if E then S1 else S2 |while E do S1In this grammar, E is the Boolean expression depending upon which S1 or S2 will be executed.Following representation shows the order of execution of an instruction of if-then, ifthen-else, & while do.𝐒 → 𝐢𝐟 𝐄 𝐭𝐡𝐞𝐧 𝐒𝟏E.CODE & S.CODE are a sequence of statements which generate three address code.E.TRUE is the label to which control flow if E is true.E.FALSE is the label to which ... Read More

19K+ Views
Control statements are the statements that change the flow of execution of statements. For example, If, If-else, Switch-Case, while-do statements. In programming languages, Boolean expressions are used toAlter the flow of control− Boolean expressions are used as conditional expressions in a statement that alter the flow of control. The value of such Boolean expression is implicit in a position reached in a program. For example, if (E) S, the expression E should be true if statement S is reached.Compute logical values− A Boolean expression can define true or false values. Such Boolean expressions can be computed in parallel to arithmetic ... Read More

5K+ Views
Boolean means True or False. It can also be represented by 1 or 0.Boolean Expression is the expression that returns true or false. Boolean Expression can be represented in two ways−Conditional ExpressionsFor example, If a > b{ cout Y)A = B + CSolution(1) If A < B goto(4)(2) If X > Y goto(4)(3) goto(6)(4) T = B + C(5) A = TExample3− Write three address code for a > b 𝐀𝐍𝐃 c < d 𝐀𝐍𝐃 e < f.Solution(1) If a > b goto(4)(2) t1 = 0(3) goto(5)(4) t1 = 1(5) If c < d goto(8)(6) t2 = 0(7) goto(9)(8) t2 = 1(9) If e < f goto(12)(10) t3 = 0(11) goto(13)(12) t3 = 1(13) t4 = t1 𝐀𝐍𝐃 t2(14) t5 = t4 𝐀𝐍𝐃 t3

6K+ Views
Assignment statements consist of an expression. It involves only integer variables.Abstract Translation SchemeConsider the grammar, which consists of an assignment statement.S → id = EE → E + EE → E ∗ EE → −EE → (E)E → idHere Translation of E can have two attributes −𝐄. 𝐏𝐋𝐀𝐂𝐄− It tells about the name that will hold the value of the expression.𝐄. 𝐂𝐎𝐃𝐄− It represents a sequence of three address statements evaluating the expression E in grammar represents an Assignment statement. E. CODE represents the three address codes of the statement. CODE for non-terminals on the left is the concatenation of ... Read More