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.

Ginni
Ginni
Updated on 08-Nov-2023 42K+ Views

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 More

What is LEX?

Ginni
Ginni
Updated on 03-Nov-2023 30K+ Views

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 More

What is Input Buffering in Compiler Design?

Ginni
Ginni
Updated on 01-Nov-2023 58K+ Views

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 More

Difference Between Recursion and Iteration

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 01-Nov-2023 47K+ Views

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 More

What is techniques of storage allocation in compiler design?

Ginni
Ginni
Updated on 31-Oct-2023 59K+ Views

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 More

What is Syntax Tree?

Ginni
Ginni
Updated on 26-Oct-2023 31K+ Views

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 More

Centralized Clock Synchronization

Manish Kumar Saini
Manish Kumar Saini
Updated on 26-Jul-2023 1K+ Views

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 More

Causes of Failure in Operating System

Manish Kumar Saini
Manish Kumar Saini
Updated on 26-Jul-2023 1K+ Views

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 More

Basic Model of a Real-time System

Manish Kumar Saini
Manish Kumar Saini
Updated on 26-Jul-2023 3K+ Views

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 More

Look aside Buffer

Diksha Patro
Diksha Patro
Updated on 25-Jul-2023 873 Views

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
Showing 11–20 of 177 articles
« Prev 1 2 3 4 5 18 Next »
Advertisements