The document discusses intermediate code generation in compilers. It describes intermediate code as the output of the parser and input to the code generator. Three common types of intermediate representations are discussed: syntax trees, postfix notation, and three address code. Three address code represents statements in the form of X=Y op Z and is described as a linearized representation of a syntax tree that is easy to manipulate and optimize. The document provides examples of three address code generated from syntax trees and DAGs.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION
Syntax directed Definitions - Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute Definitions - Design of predictive translator - Type Systems-Specification of a simple type Checker - Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checkin
It provides information about automata and compiler designing and btech students and mainly useful for artificial intelligence and data science students and this ppt is given by our lecturer sowjanya mam at lakireddy Balireddy College of engineering from the department of artificial intelligence and data science our college is located in andhra pradesh mylavram ntr district
The document discusses intermediate code generation in compilers. It describes how compilers generate an intermediate representation from the abstract syntax tree that is machine independent and allows for optimizations. One popular intermediate representation is three-address code, where each statement contains at most three operands. This code is then represented using structures like quadruples and triples to store the operator and operands for code generation and rearranging during optimizations. Static single assignment form is also covered, which assigns unique names to variables to facilitate optimizations.
This document summarizes key topics in intermediate code generation including:
- Variants of syntax trees like DAGs to represent common subexpressions.
- Three-address code where each instruction has at most three operands.
- Type checking declarations and expressions during translation.
- Generating three-address code for control flow statements using techniques like backpatching to resolve symbolic labels.
14-Intermediate code generation - Variants of Syntax trees - Three Address Co...venkatapranaykumarGa
The document discusses intermediate code generation in compilers. It describes benefits of using an intermediate representation like retargetability and optimization. Common intermediate representations include syntax trees, postfix notation, and three-address code. Three-address code represents expressions as sequences of instructions with three operands. It is generated from syntax trees or DAGs through syntax-directed translation.
The document discusses three-address code, which is an intermediate representation used in compilers. It describes three-address code as consisting of statements in the form of x := y op z, where x, y, and z are operands and op is an operator. There are several types of three-address statements including assignment, copy, jump, conditional jump, procedure calls, indexed assignments, and pointer assignments. Three-address code can be implemented using quadruples, triples, or indirect triples, which represent the statements using records with fields for operands and operators.
Compiler chapter six .ppt course materialgadisaAdamu
The document discusses intermediate code generation in compilers. It explains that intermediate code serves as a bridge between the high-level source code and final machine code. It presents different types of intermediate representations like syntax trees and three-address code. Syntax trees abstract away details from parse trees while three-address code translates expressions into a linear representation using temporary variables. The document also provides examples and explanations of different data structures used to represent three-address code like quadruples and triples.
This document summarizes key topics in intermediate code generation discussed in Chapter 6, including:
1) Variants of syntax trees like DAGs are introduced to share common subexpressions. Three-address code is also discussed where each instruction has at most three operands.
2) Type checking and type expressions are covered, along with translating expressions and statements to three-address code. Control flow statements like if/else are also translated using techniques like backpatching.
3) Backpatching allows symbolic labels in conditional jumps to be resolved by a later pass that inserts actual addresses, avoiding an extra pass. This and other control flow translation topics are covered.
The document discusses intermediate code generation in compilers. It aims to generate a machine-independent intermediate form (IR) that is suitable for optimization and portability. The IR facilitates retargeting compilers to new machines and enables machine-independent code optimization. Common IR representations include abstract syntax trees, directed acyclic graphs, control flow graphs, postfix notation, and three-address code. Three-address code is a simple representation where instructions have at most three operands. It allows efficient code manipulation and optimization.
This document provides an overview of compiler construction topics including:
- Data types and type checking which ensures program elements make sense under language type rules.
- Intermediate code generation where the compiler constructs representations closer to the source or target languages.
- Variants of syntax trees like directed acyclic graphs which more succinctly represent expressions and identify common subexpressions.
- Three-address code and static single-assignment form which are intermediate representations facilitating optimizations.
The document discusses various topics related to compiler design including ambiguous grammar, leftmost and rightmost derivations, infix and postfix notation, and implementations of three-address code. It provides examples of ambiguous grammar in C and describes leftmost and rightmost derivations in parsing. It also compares infix, postfix and prefix notation for mathematical expressions and describes converting between the notations. Finally, it discusses different implementations of three-address code including using quadruples, triples and indirect triples.
The document discusses intermediate code in compilers. It defines intermediate code as the interface between a compiler's front end and back end. Using an intermediate representation facilitates retargeting a compiler to different machines and applying machine-independent optimizations. The document then describes different types of intermediate code like triples, quadruples and SSA form. It provides details on three-address code including quadruples, triples and indirect triples. It also discusses addressing of array elements and provides an example of translating a C program to intermediate code.
The document describes intermediate code generation during compilation.
1) An intermediate language is used to translate source programs into a form that is CPU independent yet close to machine language. This facilitates code optimization and retargeting of compilers.
2) Common intermediate languages include syntax trees, postfix notation, and three-address code using quadruples. Three-address code breaks down expressions into single assignment statements to simplify optimization.
3) Semantic rules for syntax-directed translation are described to generate three-address code for expressions, assignments, procedures, and other language constructs. Attributes track temporary variables and generated code.
1) Intermediate code is generated between the front-end and back-end of a compiler to make the compiler reusable for different target machines. It eliminates the need for a new full compiler for each machine.
2) Intermediate code representations include high-level IR close to the source language and low-level IR close to the target machine. Common representations are three-address code using quadruples, triples, or indirect triples.
3) Three-address code converts source instructions into a simple format of assigning values to variables or jumping based on conditions using at most two sources and one operator per instruction. This makes intermediate code easy to optimize and translate to machine code.
This document describes semantic rules for symbol table operations when processing declarations in a programming language. Key points:
- Declarations create symbol table entries containing name, type, and relative address offset. An offset tracker increments to allocate offsets.
- Procedures have nested symbol tables linked via pointers. This captures scope and nesting structure for name lookup.
- Rules for creating/updating symbol tables include entering names, recording widths, and linking procedure tables.
- Processing records creates a nested symbol table for field names, with pointers passed down on stacks.
The document discusses different types of intermediate representations (IR) used in compilers. It describes how the front-end produces an IR, the middle-end transforms the IR into an equivalent more efficient form, and the back-end transforms the IR into native code. The three major categories of IRs are structural like trees and DAGs, linear like three-address code, and hybrid forms that combine graphs and linear code. Decisions in IR design affect compiler speed and efficiency.
This document discusses compiler architecture and intermediate code generation. It begins by describing the typical phases of a compiler: parsing, static checking, and code generation. It then discusses intermediate code, which ties the front end and back end phases together and is language and machine independent. Various forms of intermediate code are described, including trees, postfix notation, and triple/quadruple intermediate code. The rest of the document focuses on triple/quadruple code, including how it represents expressions, statements, addressing of arrays, and the translation process from source code to triple/quadruple intermediate code.
In the Notes on Programming Language Syntax page, an example par.docxmecklenburgstrelitzh
In the
Notes on Programming Language Syntax
page, an example parser for a simple language is given, using C syntax. Write the parser using F#, but you may only use functional programming and immutable date. Create the list of tokens as a discriminated union, which (in the simplest case) looks like an enumeration.
type TERMINAL = IF|THEN|ELSE|BEGIN|END|PRINT|SEMICOLON|ID|EOF
With this type declared, you can use the terminals like you would use enumerated values in Java.
Use immutable data. The C-code example uses mutable data. Pass the program into the start symbol function. Pass the input yet to be processed to each non-terminal function.
The main function might look like this:
let test_program program =
let result = program |> S
match result with
| [] -> failwith "Early termination or missing EOF"
| x::xs -> if x = EOF then accept() else error()
You do not have to parse input strings. Assume that the parsing has been done. Pass a list of tokens that represent a program into the start symbol. Try these program examples:
[IF;ID;THEN;BEGIN;PRINT;ID;SEMICOLON;PRINT;ID;END;ELSE;PRINT;ID;EOF]
[IF;ID;THEN;IF;ID;THEN;PRINT;ID;ELSE;PRINT;ID;ELSE;BEGIN;PRINT;ID;END;EOF]
Causes error:
[IF;ID;THEN;BEGIN;PRINT;ID;SEMICOLON;PRINT;ID;SEMICOLON;END;ELSE;PRINT;ID;EOF]
Print an accept message when the input is valid and completely consumed. Generate appropriate error messages for incorrect symbols, not enough input, and too much input.
Once you have the parser recognizing input, generate a parse tree using a discriminated type.
Implement a parser using functional programming and immutable data for the unambiguous grammar for arithmetic expressions, from the
Notes on Programming Language Syntax.
E -> E + T | E - T | T
T -> T * F | T / F | F
F -> i | (E)
Use the suggestion in the notes to get around the fact that this grammar appears to need more than one lookahead token.
Once you have the parser recognizing input, generate a parse tree using a discriminated type.
Recall that an F# function that takes two arguments can be coded in either uncurried form (in which case it takes a pair as its input) or curried form (in which case it takes the first argument and returns a function that takes the second argument). In fact it is easy to convert from one form to the other in F#. To this end, define an F# function
curry f
that converts an uncurried function to a curried function, and an F# function
uncurry f
that does the opposite conversion. For example,
> (+);;
val it : (int -> int -> int) =
[email protected]
>
> let plus = uncurry (+);;
val plus : (int * int -> int)
> plus (2,3);;
val it : int = 5
> let cplus = curry plus;;
val cplus : (int -> int -> int)
> let plus3 = cplus 3;;
val plus3 : (int -> int)
> plus3 10;;
val it : int = 13
What are the types of
curry
and
uncurry
?
Given vectors
u = (u
1
, u
2
,..., u
n
)
and .
1. Arrays allow storing a collection of related data items and can be one-dimensional or multidimensional.
2. Two-dimensional arrays are arrays of one-dimensional arrays with two indices to access elements.
3. Preprocessor directives like #include and #define are instructions to the compiler and are not part of the C language itself. They expand the scope of the programming environment.
This module performs semantic analysis on the input program to ensure logical correctness and adherence to the rules of the PIM ISA. It involves type checking, symbol table management, scope resolution, and validation of instruction semantics. The module detects invalid operations, ensures proper use of memory and registers, and enforces constraints specific to the architecture. By verifying the correctness of high-level constructs before code generation, it helps prevent runtime errors and optimizes instruction translation for efficient execution.
datypes , operators in c,variables in clanguage formatting input and out putMdAmreen
A data-type in C programming is a set of values and is determined to act on those values.
C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value.
The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc.
Usually, programming languages specify the range values for given data-type.
Embedded C is a variant of C programming language used for embedded systems. It uses a cross-compiler to convert programs into machine code for the target processor. A cross-compiler runs on one system but compiles code for another system. Pointers in embedded C store the address of a variable in memory and can be used to access the value at that address using dereference operator (*). Arrays, functions, loops and other C constructs are used similarly in embedded C to structure programs and access hardware.
Compiler chapter six .ppt course materialgadisaAdamu
The document discusses intermediate code generation in compilers. It explains that intermediate code serves as a bridge between the high-level source code and final machine code. It presents different types of intermediate representations like syntax trees and three-address code. Syntax trees abstract away details from parse trees while three-address code translates expressions into a linear representation using temporary variables. The document also provides examples and explanations of different data structures used to represent three-address code like quadruples and triples.
This document summarizes key topics in intermediate code generation discussed in Chapter 6, including:
1) Variants of syntax trees like DAGs are introduced to share common subexpressions. Three-address code is also discussed where each instruction has at most three operands.
2) Type checking and type expressions are covered, along with translating expressions and statements to three-address code. Control flow statements like if/else are also translated using techniques like backpatching.
3) Backpatching allows symbolic labels in conditional jumps to be resolved by a later pass that inserts actual addresses, avoiding an extra pass. This and other control flow translation topics are covered.
The document discusses intermediate code generation in compilers. It aims to generate a machine-independent intermediate form (IR) that is suitable for optimization and portability. The IR facilitates retargeting compilers to new machines and enables machine-independent code optimization. Common IR representations include abstract syntax trees, directed acyclic graphs, control flow graphs, postfix notation, and three-address code. Three-address code is a simple representation where instructions have at most three operands. It allows efficient code manipulation and optimization.
This document provides an overview of compiler construction topics including:
- Data types and type checking which ensures program elements make sense under language type rules.
- Intermediate code generation where the compiler constructs representations closer to the source or target languages.
- Variants of syntax trees like directed acyclic graphs which more succinctly represent expressions and identify common subexpressions.
- Three-address code and static single-assignment form which are intermediate representations facilitating optimizations.
The document discusses various topics related to compiler design including ambiguous grammar, leftmost and rightmost derivations, infix and postfix notation, and implementations of three-address code. It provides examples of ambiguous grammar in C and describes leftmost and rightmost derivations in parsing. It also compares infix, postfix and prefix notation for mathematical expressions and describes converting between the notations. Finally, it discusses different implementations of three-address code including using quadruples, triples and indirect triples.
The document discusses intermediate code in compilers. It defines intermediate code as the interface between a compiler's front end and back end. Using an intermediate representation facilitates retargeting a compiler to different machines and applying machine-independent optimizations. The document then describes different types of intermediate code like triples, quadruples and SSA form. It provides details on three-address code including quadruples, triples and indirect triples. It also discusses addressing of array elements and provides an example of translating a C program to intermediate code.
The document describes intermediate code generation during compilation.
1) An intermediate language is used to translate source programs into a form that is CPU independent yet close to machine language. This facilitates code optimization and retargeting of compilers.
2) Common intermediate languages include syntax trees, postfix notation, and three-address code using quadruples. Three-address code breaks down expressions into single assignment statements to simplify optimization.
3) Semantic rules for syntax-directed translation are described to generate three-address code for expressions, assignments, procedures, and other language constructs. Attributes track temporary variables and generated code.
1) Intermediate code is generated between the front-end and back-end of a compiler to make the compiler reusable for different target machines. It eliminates the need for a new full compiler for each machine.
2) Intermediate code representations include high-level IR close to the source language and low-level IR close to the target machine. Common representations are three-address code using quadruples, triples, or indirect triples.
3) Three-address code converts source instructions into a simple format of assigning values to variables or jumping based on conditions using at most two sources and one operator per instruction. This makes intermediate code easy to optimize and translate to machine code.
This document describes semantic rules for symbol table operations when processing declarations in a programming language. Key points:
- Declarations create symbol table entries containing name, type, and relative address offset. An offset tracker increments to allocate offsets.
- Procedures have nested symbol tables linked via pointers. This captures scope and nesting structure for name lookup.
- Rules for creating/updating symbol tables include entering names, recording widths, and linking procedure tables.
- Processing records creates a nested symbol table for field names, with pointers passed down on stacks.
The document discusses different types of intermediate representations (IR) used in compilers. It describes how the front-end produces an IR, the middle-end transforms the IR into an equivalent more efficient form, and the back-end transforms the IR into native code. The three major categories of IRs are structural like trees and DAGs, linear like three-address code, and hybrid forms that combine graphs and linear code. Decisions in IR design affect compiler speed and efficiency.
This document discusses compiler architecture and intermediate code generation. It begins by describing the typical phases of a compiler: parsing, static checking, and code generation. It then discusses intermediate code, which ties the front end and back end phases together and is language and machine independent. Various forms of intermediate code are described, including trees, postfix notation, and triple/quadruple intermediate code. The rest of the document focuses on triple/quadruple code, including how it represents expressions, statements, addressing of arrays, and the translation process from source code to triple/quadruple intermediate code.
In the Notes on Programming Language Syntax page, an example par.docxmecklenburgstrelitzh
In the
Notes on Programming Language Syntax
page, an example parser for a simple language is given, using C syntax. Write the parser using F#, but you may only use functional programming and immutable date. Create the list of tokens as a discriminated union, which (in the simplest case) looks like an enumeration.
type TERMINAL = IF|THEN|ELSE|BEGIN|END|PRINT|SEMICOLON|ID|EOF
With this type declared, you can use the terminals like you would use enumerated values in Java.
Use immutable data. The C-code example uses mutable data. Pass the program into the start symbol function. Pass the input yet to be processed to each non-terminal function.
The main function might look like this:
let test_program program =
let result = program |> S
match result with
| [] -> failwith "Early termination or missing EOF"
| x::xs -> if x = EOF then accept() else error()
You do not have to parse input strings. Assume that the parsing has been done. Pass a list of tokens that represent a program into the start symbol. Try these program examples:
[IF;ID;THEN;BEGIN;PRINT;ID;SEMICOLON;PRINT;ID;END;ELSE;PRINT;ID;EOF]
[IF;ID;THEN;IF;ID;THEN;PRINT;ID;ELSE;PRINT;ID;ELSE;BEGIN;PRINT;ID;END;EOF]
Causes error:
[IF;ID;THEN;BEGIN;PRINT;ID;SEMICOLON;PRINT;ID;SEMICOLON;END;ELSE;PRINT;ID;EOF]
Print an accept message when the input is valid and completely consumed. Generate appropriate error messages for incorrect symbols, not enough input, and too much input.
Once you have the parser recognizing input, generate a parse tree using a discriminated type.
Implement a parser using functional programming and immutable data for the unambiguous grammar for arithmetic expressions, from the
Notes on Programming Language Syntax.
E -> E + T | E - T | T
T -> T * F | T / F | F
F -> i | (E)
Use the suggestion in the notes to get around the fact that this grammar appears to need more than one lookahead token.
Once you have the parser recognizing input, generate a parse tree using a discriminated type.
Recall that an F# function that takes two arguments can be coded in either uncurried form (in which case it takes a pair as its input) or curried form (in which case it takes the first argument and returns a function that takes the second argument). In fact it is easy to convert from one form to the other in F#. To this end, define an F# function
curry f
that converts an uncurried function to a curried function, and an F# function
uncurry f
that does the opposite conversion. For example,
> (+);;
val it : (int -> int -> int) =
[email protected]
>
> let plus = uncurry (+);;
val plus : (int * int -> int)
> plus (2,3);;
val it : int = 5
> let cplus = curry plus;;
val cplus : (int -> int -> int)
> let plus3 = cplus 3;;
val plus3 : (int -> int)
> plus3 10;;
val it : int = 13
What are the types of
curry
and
uncurry
?
Given vectors
u = (u
1
, u
2
,..., u
n
)
and .
1. Arrays allow storing a collection of related data items and can be one-dimensional or multidimensional.
2. Two-dimensional arrays are arrays of one-dimensional arrays with two indices to access elements.
3. Preprocessor directives like #include and #define are instructions to the compiler and are not part of the C language itself. They expand the scope of the programming environment.
This module performs semantic analysis on the input program to ensure logical correctness and adherence to the rules of the PIM ISA. It involves type checking, symbol table management, scope resolution, and validation of instruction semantics. The module detects invalid operations, ensures proper use of memory and registers, and enforces constraints specific to the architecture. By verifying the correctness of high-level constructs before code generation, it helps prevent runtime errors and optimizes instruction translation for efficient execution.
datypes , operators in c,variables in clanguage formatting input and out putMdAmreen
A data-type in C programming is a set of values and is determined to act on those values.
C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value.
The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc.
Usually, programming languages specify the range values for given data-type.
Embedded C is a variant of C programming language used for embedded systems. It uses a cross-compiler to convert programs into machine code for the target processor. A cross-compiler runs on one system but compiles code for another system. Pointers in embedded C store the address of a variable in memory and can be used to access the value at that address using dereference operator (*). Arrays, functions, loops and other C constructs are used similarly in embedded C to structure programs and access hardware.
its all about Artificial Intelligence(Ai) and Machine Learning and not on advanced level you can study before the exam or can check for some information on Ai for project
ELectronics Boards & Product Testing_Shiju.pdfShiju Jacob
This presentation provides a high level insight about DFT analysis and test coverage calculation, finalizing test strategy, and types of tests at different levels of the product.
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...Infopitaara
A feed water heater is a device used in power plants to preheat water before it enters the boiler. It plays a critical role in improving the overall efficiency of the power generation process, especially in thermal power plants.
🔧 Function of a Feed Water Heater:
It uses steam extracted from the turbine to preheat the feed water.
This reduces the fuel required to convert water into steam in the boiler.
It supports Regenerative Rankine Cycle, increasing plant efficiency.
🔍 Types of Feed Water Heaters:
Open Feed Water Heater (Direct Contact)
Steam and water come into direct contact.
Mixing occurs, and heat is transferred directly.
Common in low-pressure stages.
Closed Feed Water Heater (Surface Type)
Steam and water are separated by tubes.
Heat is transferred through tube walls.
Common in high-pressure systems.
⚙️ Advantages:
Improves thermal efficiency.
Reduces fuel consumption.
Lowers thermal stress on boiler components.
Minimizes corrosion by removing dissolved gases.
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...Infopitaara
A Boiler Feed Pump (BFP) is a critical component in thermal power plants. It supplies high-pressure water (feedwater) to the boiler, ensuring continuous steam generation.
⚙️ How a Boiler Feed Pump Works
Water Collection:
Feedwater is collected from the deaerator or feedwater tank.
Pressurization:
The pump increases water pressure using multiple impellers/stages in centrifugal types.
Discharge to Boiler:
Pressurized water is then supplied to the boiler drum or economizer section, depending on design.
🌀 Types of Boiler Feed Pumps
Centrifugal Pumps (most common):
Multistage for higher pressure.
Used in large thermal power stations.
Positive Displacement Pumps (less common):
For smaller or specific applications.
Precise flow control but less efficient for large volumes.
🛠️ Key Operations and Controls
Recirculation Line: Protects the pump from overheating at low flow.
Throttle Valve: Regulates flow based on boiler demand.
Control System: Often automated via DCS/PLC for variable load conditions.
Sealing & Cooling Systems: Prevent leakage and maintain pump health.
⚠️ Common BFP Issues
Cavitation due to low NPSH (Net Positive Suction Head).
Seal or bearing failure.
Overheating from improper flow or recirculation.
The role of the lexical analyzer
Specification of tokens
Finite state machines
From a regular expressions to an NFA
Convert NFA to DFA
Transforming grammars and regular expressions
Transforming automata to grammars
Language for specifying lexical analyzers
Analysis of reinforced concrete deep beam is based on simplified approximate method due to the complexity of the exact analysis. The complexity is due to a number of parameters affecting its response. To evaluate some of this parameters, finite element study of the structural behavior of the reinforced self-compacting concrete deep beam was carried out using Abaqus finite element modeling tool. The model was validated against experimental data from the literature. The parametric effects of varied concrete compressive strength, vertical web reinforcement ratio and horizontal web reinforcement ratio on the beam were tested on eight (8) different specimens under four points loads. The results of the validation work showed good agreement with the experimental studies. The parametric study revealed that the concrete compressive strength most significantly influenced the specimens’ response with the average of 41.1% and 49 % increment in the diagonal cracking and ultimate load respectively due to doubling of concrete compressive strength. Although the increase in horizontal web reinforcement ratio from 0.31 % to 0.63 % lead to average of 6.24 % increment on the diagonal cracking load, it does not influence the ultimate strength and the load-deflection response of the beams. Similar variation in vertical web reinforcement ratio leads to an average of 2.4 % and 15 % increment in cracking and ultimate load respectively with no appreciable effect on the load-deflection response.
International Journal of Distributed and Parallel systems (IJDPS)samueljackson3773
The growth of Internet and other web technologies requires the development of new
algorithms and architectures for parallel and distributed computing. International journal of
Distributed and parallel systems is a bimonthly open access peer-reviewed journal aims to
publish high quality scientific papers arising from original research and development from
the international community in the areas of parallel and distributed systems. IJDPS serves
as a platform for engineers and researchers to present new ideas and system technology,
with an interactive and friendly, but strongly professional atmosphere.
Fluid mechanics is the branch of physics concerned with the mechanics of fluids (liquids, gases, and plasmas) and the forces on them. Originally applied to water (hydromechanics), it found applications in a wide range of disciplines, including mechanical, aerospace, civil, chemical, and biomedical engineering, as well as geophysics, oceanography, meteorology, astrophysics, and biology.
It can be divided into fluid statics, the study of various fluids at rest, and fluid dynamics.
Fluid statics, also known as hydrostatics, is the study of fluids at rest, specifically when there's no relative motion between fluid particles. It focuses on the conditions under which fluids are in stable equilibrium and doesn't involve fluid motion.
Fluid kinematics is the branch of fluid mechanics that focuses on describing and analyzing the motion of fluids, such as liquids and gases, without considering the forces that cause the motion. It deals with the geometrical and temporal aspects of fluid flow, including velocity and acceleration. Fluid dynamics, on the other hand, considers the forces acting on the fluid.
Fluid dynamics is the study of the effect of forces on fluid motion. It is a branch of continuum mechanics, a subject which models matter without using the information that it is made out of atoms; that is, it models matter from a macroscopic viewpoint rather than from microscopic.
Fluid mechanics, especially fluid dynamics, is an active field of research, typically mathematically complex. Many problems are partly or wholly unsolved and are best addressed by numerical methods, typically using computers. A modern discipline, called computational fluid dynamics (CFD), is devoted to this approach. Particle image velocimetry, an experimental method for visualizing and analyzing fluid flow, also takes advantage of the highly visual nature of fluid flow.
Fundamentally, every fluid mechanical system is assumed to obey the basic laws :
Conservation of mass
Conservation of energy
Conservation of momentum
The continuum assumption
For example, the assumption that mass is conserved means that for any fixed control volume (for example, a spherical volume)—enclosed by a control surface—the rate of change of the mass contained in that volume is equal to the rate at which mass is passing through the surface from outside to inside, minus the rate at which mass is passing from inside to outside. This can be expressed as an equation in integral form over the control volume.
The continuum assumption is an idealization of continuum mechanics under which fluids can be treated as continuous, even though, on a microscopic scale, they are composed of molecules. Under the continuum assumption, macroscopic (observed/measurable) properties such as density, pressure, temperature, and bulk velocity are taken to be well-defined at "infinitesimal" volume elements—small in comparison to the characteristic length scale of the system, but large in comparison to molecular length scale
Value Stream Mapping Worskshops for Intelligent Continuous SecurityMarc Hornbeek
This presentation provides detailed guidance and tools for conducting Current State and Future State Value Stream Mapping workshops for Intelligent Continuous Security.
Value Stream Mapping Worskshops for Intelligent Continuous SecurityMarc Hornbeek
Ad
Syntax directed definition and intermediate code generation
1. SYLLABUS
UNIT III SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE
GENERATION
Syntax directed Definitions-Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute
Definitions- Design of predictive translator - Type Systems-Specification of a simple type Checker
Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three
Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back patching.
2. Course Outcomes
CO 3 Apply different parsing algorithms to develop the parsers for a given grammar
K3 LEVEL
3. INTERMEDIATE CODE GENERATION
The front end translates a source program into an intermediate representation from which the back end generates
target code.
Benefits of using a machine-independent intermediate form are:
1. Retargeting is facilitated. That is, a compiler for a different machine can be created by attaching a back end for
the new machine to an existing front end.
2. A machine-independent code optimizer can be applied to the intermediate representation.
4. Three ways of intermediate representation:
* Syntax tree
* Postfix notation
* Three address code
INTERMEDIATE LANGUAGES
5. INTERMEDIATE LANGUAGES
A syntax tree depicts the natural hierarchical structure of a source program.
A dag (Directed Acyclic Graph) gives the same information but in a more compact way because common
subexpressions are identified.
6. INTERMEDIATE LANGUAGES
Two representations of the syntax tree are as
follows.
In (a) each node is represented as a record with
a field for its operator and additional fields
for pointers to its children.
In (b), nodes are allocated from an array of
records and the index or position of the node
serves as the pointer to the node. All the nodes
in the syntax tree can be visited by following
pointers, starting from the root at position 10.
7. • Postfix Notation:
• Linear representation of a Syntax Tree
• The corresponding operands appear after the operators
• a:=b*-c+b*-c
• a b c UMINUS *b c UMINUS * + :=
INTERMEDIATE LANGUAGES
8. Three-address code:
Three-address code is a sequence of statements of the general form x : = y op z
• where x, y and z are names, constants, or compiler-generated temporaries; op stands for any
operator, such as a fixed- or floating-point arithmetic operator, or a logical operator on boolean-
valued data.
• Thus a source language expression like x+ y*z might be translated into a sequence where t1 and t2
are compiler-generated temporary names.
INTERMEDIATE LANGUAGES
9. • Three-address code is a linearized representation of
a syntax tree or a dag in which explicit names
correspond to the interior nodes of the graph.
• The syntax tree and dag are represented by the three-
address code sequences.
• Variable names can appear directly in three address
statements.
INTERMEDIATE LANGUAGES
10. • The common three-address statements are:
1. Assignment statements of the form x : = y op z, where op is a binary arithmetic or logical operation.
2. Assignment instructions of the form x : = op y, where op is a unary operation.
3. Copy statements of the form x : = y where the value of y is assigned to x.
4. The unconditional jump goto L. The three-address statement with label L is the next to be executed.
5. Conditional jumps such as if x relop y goto L. This instruction applies a relational operator (<, =, >=,
etc. ) to x and y, and executes the statement with label L next if x stands in relation relop to y. If not, the
three-address statement following if x relop y as in the usual sequence.
6. param x and call p, n for procedure calls and return y, where y representing a returned value is optional.
7.Indexed assignments of the form x : = y[i] and x[i] : = y.
8.Address and pointer assignments of the form x : = &y , x : = *y, and *x : = y.
INTERMEDIATE LANGUAGES
Types of Three-Address Statements
11. Implementation of Three-Address Statements:
A three-address statement is an abstract form of intermediate code.
In a compiler, these statements can be implemented as records with fields for the operator and
the operands.
Three such representations are: Quadruples, Triples, Indirect triples
INTERMEDIATE LANGUAGES
12. Quadruples:
A quadruple is a record structure with four fields, which are, op, arg1,
arg2 and result.
The op field contains an internal code for the operator. The three-
address statement x : = y op z is represented by placing y in arg1, z in
arg2 and x in result.
The contents of fields arg1, arg2 and result are normally pointers to the
symbol- entries for the names represented by these fields.
If so, temporary names must be entered into the symbol table as they
are created.
INTERMEDIATE LANGUAGES
13. Triples:
• To avoid entering temporary names into the symbol table, we might refer to a
temporary value by the position of the statement that computes it.
• If we do so, three-address statements can be represented by records with only
three fields: op, arg1 and arg2.
• The fields arg1 and arg2, for the arguments of op, are either pointers to the
symbol table or pointers into the triple structure ( for temporary values ).
• Since three fields are used, this intermediate code format is known as triples.
INTERMEDIATE LANGUAGES
14. INTERMEDIATE LANGUAGES
Indirect Triples:
• Another implementation of three-address code is that of listing pointers to triples, rather than
listing the triples themselves. This implementation is called indirect triples.
15. INTERMEDIATE LANGUAGES
Syntax-Directed Translation into Three-Address Code
When three-address code is generated, temporary names
are made up for the interior nodes of a syntax tree.
• The synthesized attribute S.code represents the three-
address code for the assignment S.
• The nonterminal E has two attributes:
1. E.place, the name that will hold the value of E , and
2. E.code, the sequence of three-address statements
evaluating E.
16. DECLARATIONS
• As the sequence of declarations in a procedure or block is examined, we can lay out storage for names
local to the procedure.
• For each local name, we create a symbol-table entry with information like the type and the relative
address of the storage for the name.
• The relative address consists of an offset from the base of the static data area or the field for local data
in an activation record.
17. DECLARATIONS
• Declarations in a Procedure:
• In the translation scheme shown below:
Nonterminal P generates a sequence of declarations of the form id : T.
Before the first declaration is considered, offset is set to 0.
As each new name is seen , that name is entered in the symbol table with offset equal to the current
value of offset, and offset is incremented by the width of the data object denoted by that name.
The procedure enter( name, type, offset )
creates a symbol-table entry for name, gives its type type and relative address offset in its data area.
18. DECLARATIONS
Attribute type represents a type expression constructed from the basic types integer and real by
applying the type constructors pointer and array. If type expressions are represented by graphs,
then attribute type might be a pointer to the node representing a type expression.
The width of an array is obtained by multiplying the width of each element by the number of
elements in the array. The width of each pointer is assumed to be 4.
20. DECLARATIONS
Keeping Track of Scope Information:
• When a nested procedure is seen, processing of declarations in the enclosing procedure is
temporarily suspended.
• This approach will be illustrated by adding semantic rules to the following language:
P->D
D->D; D |id: T | proc id; D ; S
• One possible implementation of a symbol table is a linked list of entries for names.
• A new symbol table is created when a procedure declaration D proc id D1;S is seen, and entries
for the declarations in D1 are created in the new table.
• The new table points back to the symbol table of the enclosing procedure; the name represented by
id itself is local to the enclosing procedure.
• The only change from the treatment of variable declarations is that the procedure enter is told which
symbol table to make an entry in.
21. DECLARATIONS
The semantic rules are defined in terms of the following operations:
1. mktable(previous) creates a new symbol table and returns a pointer to the new table. The argument previous
points to a previously created symbol table, presumably that for the enclosing procedure.
2. enter(table, name, type, offset) creates a new entry for name name in the symbol table pointed to by table. Again,
enter places type type and relative address offset in fields within the entry.
3. addwidth(table, width) records the cumulative width of all the entries in table in the header associated with this
symbol table.
4. enterproc(table, name, newtable) creates a new entry for procedure name in the symbol table pointed to by table.
The argument newtable points to the symbol table for this procedure name.
22. DECLARATIONS
Syntax directed translation scheme for nested procedures
P->M D { addwidth ( top( tblptr) , top (offset));
pop (tblptr); pop (offset) }
M->ɛ { t : = mktable (nil);
push (t,tblptr); push (0,offset) }
D->D1 ; D2
D->proc id ; N D1; S { t : = top (tblptr);
addwidth ( t, top(offset));
pop (tblptr); pop (offset);
enterproc (top (tblptr), id.name, t) }
D->id : T { enter (top (tblptr), id.name, T.type, top (offset));
top (offset) := top (offset) + T.width }
N->ɛ { t := mktable (top (tblptr));
push (t, tblptr); push (0,offset) }