Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Computer Programming Articles
Page 2 of 18
Construct a Predictive Parsing table for the following grammar & also check whether string \\nid + id * id is accepted or not.
Problem − Consider the following grammar − E → TE′ E′ → +TE′|ε T′ → FT′ T′ → FT′|ε F → (E)|id Solution − Step1− Elimination of Left Recursion & perform Left Factoring As there is no left recursion in Grammar so, we will proceed as it is. Also, there is no need for Left Factoring. Step2− Computation of FIRST FIRST(E) = FIRST(T) = FIRST(F) = {(, id} FIRST (E′) = {+, ε} FIRST (T′) = {*, ε} Step3− Computation of FOLLOW FOLLOW (E) = FOLLOW(E′) = {), $} FOLLOW (T) = FOLLOW(T′) = {+, ), $} FOLLOW (F) = ...
Read MoreWhat is LEX?
It is a tool or software which automatically generates a lexical analyzer (finite Automata). It takes as its input a LEX source program and produces lexical Analyzer as its output. Lexical Analyzer will convert the input string entered by the user into tokens as its output.LEX is a program generator designed for lexical processing of character input/output stream. Anything from simple text search program that looks for pattern in its input-output file to a C compiler that transforms a program into optimized code.In program with structure input-output two tasks occurs over and over. It can divide the input-output into meaningful ...
Read MoreWhat is Input Buffering in Compiler Design?
Lexical Analysis has to access secondary memory each time to identify tokens. It is time-consuming and costly. So, the input strings are stored into a buffer and then scanned by Lexical Analysis.Lexical Analysis scans input string from left to right one character at a time to identify tokens. It uses two pointers to scan tokens −Begin Pointer (bptr) − It points to the beginning of the string to be read.Look Ahead Pointer (lptr) − It moves ahead to search for the end of the token.Example − For statement int a, b;Both pointers start at the beginning of the string, which ...
Read MoreDifference Between Recursion and Iteration
Recursion and Iteration both repeatedly execute the set of instructions. Recursion occurs when a statement in a function calls itself repeatedly. The iteration occurs when a loop repeatedly executes until the controlling condition becomes false. The basic difference between recursion and iteration is that recursion is a process always applied to a function and iteration is applied to the set of instructions which we want to be executed repeatedly. Read through this article to find out more about Recursion and Iteration and how they are different from each other. What is Recursion? Recursion is defined as a process in which a function calls itself repeatedly. Recursion uses selection structure. If the recursion step does ...
Read MoreWhat is techniques of storage allocation in compiler design?
There are various storage allocation techniques are as follows −Static AllocationIt is the simplest allocation scheme in which allocation of data objects is done at compile time because the size of every data item can be determined by the compiler.Recursive Subprogram and Arrays of adjustable length are not permitted in a language. In static allocation, the compiler can decide the amount of storage needed by each data object. Thus, it becomes easy for a compiler to identify the address of these data in the activation record.FORTRAN uses this kind of storage allocation strategies.AdvantagesIt is easy to implement.It allows type checking ...
Read MoreWhat is Syntax Tree?
Tree in which each leaf node describes an operand & each interior node an operator. The syntax tree is shortened form of the Parse Tree.Example1 − Draw Syntax Tree for the string a + b ∗ c − d.Rules for constructing a syntax treeEach node in a syntax tree can be executed as data with multiple fields. In the node for an operator, one field recognizes the operator and the remaining field includes a pointer to the nodes for the operands. The operator is known as the label of the node. The following functions are used to create the nodes ...
Read MoreCentralized Clock Synchronization
What is Centralized Clock Synchronization? The process of internal clock synchronization in which different clocks of a system are synchronized with one standard clock of the system is referred to as centralized clock synchronization. In other words, an internal clock synchronization approach where the system clock is synchronized across all devices in a network with the help of a centralized server is referred to as centralized clock synchronization. The centralized clock synchronization is important to ensure the smooth operation of all devices in the network that are operating and communicating with each other on the same timeline. The centralized ...
Read MoreCauses of Failure in Operating System
In any computer system, the Operating System (OS) is the most important system software that creates an interface between a computer user and the computer hardware, and also manages all the system resources. The operating system is a software that performs all the necessary basic functions like file management, memory management, process management, input and output handling, and controlling of peripheral devices, such as disk drives and printers. The operating system is entirely responsible for creating a user interface and providing a platform to work all other software applications. However, like any other software of a computer system, the operating ...
Read MoreBasic Model of a Real-time System
A computer system that is specially designed to work and respond the external events in a timely and predictable fashion is referred to as a real-time system. Read this tutorial to learn the basic model of a real-time system. But before that let’s have a look into the basics of a real-time system. What is a Real-Time System? A computer system that is capable of responding to external events in a timely and predictable fashion is referred to as a real-time system. Real-time systems are commonly used in various applications, such as industrial automation, robotics, automotives, medical instruments, scientific and ...
Read MoreLook aside Buffer
What is a Look Aside Buffer? A Look-aside Buffer (LAB) is a type of cache memory that is used in computer systems to store frequently accessed data. The LAB is located between the CPU and the main memory, and it acts as a high-speed buffer to improve system performance. The LAB works by caching a portion of the data from the main memory that is frequently accessed by the CPU. When the CPU requests data from the main memory, the LAB first checks if the data is present in the buffer. If the data is found in the LAB, it ...
Read More