0% found this document useful (0 votes)
18 views19 pages

Principle of System Software Answers by OURA

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views19 pages

Principle of System Software Answers by OURA

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Principles of System Software (Suggestion Questions Answers)

1. What is software? Define the characteristics.


Ans:

Software is a collection of instructions designed to perform specific tasks on a computer. It can be


categorized into application software, utility software, and system software.

Characteristics of Software

· Performance: Refers to how well the software operates and executes tasks efficiently.
· Portability: Indicates the ability of the software to be transferred from one platform to another.
· Functionality: Describes the range of tasks the software can perform effectively.

2. Define the software hierarchy with proper diagram.


Ans:

Software Hierarchy

Application Software:

· Designed for specific functions beyond basic computer operations.


· Not directly understood by computer hardware.

Utility Software:

· Assists in maintenance and monitoring tasks.


· Includes anti-virus software, firewalls, and disk utilities.

System Software:

· Binds computer components to work as a single unit.


· Controls computer hardware and resources for application software interaction.

3. Differentiate between different types of computer architecture.


Ans:

Types of Computer Architecture

Von Neumann Architecture:

· Uses a common shared bus for accessing instructions and data.


· Does not allow fetching of instructions and data operations simultaneously.

Harvard Computer Architecture:

· Has separate pathways for instruction fetches and data access.


· Allows the CPU to read program instructions and access data from memory simultaneously.

4. Classify the computer languages with proper diagram.


Ans:

Classification of Computer Languages:

Low Level Languages:

· Low level languages are close to machine code and include machine language and assembly
language.
· Machine language is written in binary codes and can be executed directly by the computer.

High Level Languages:

· High level languages are more user-friendly and include procedure-oriented and problem-oriented
languages.
· Fifth Generation Language (5GL) and Fourth Generation Language (4GL) are examples of advanced
high-level languages.

Language Processor Development Tools:

· Lexical analyzer generator LEX and parser generator YACC are widely used tools for developing
language processors.
· These tools help in specifying lexical and syntactic constructs of a programming language and
defining semantic actions.

Language Processing Activity:

· Language processing activities bridge the semantic gap between source language and target
language.
· Program generation activities aim at automatically generating programs, while program execution
involves running the generated programs.

5. Define and discuss the different steps of software development life cycle
(SDLC) with diagram.
Ans:

Software Development Life Cycle (SDLC)

Preliminary Investigation: This step identifies the problems to be solved by the software and determines the
best approach to solve them.

System Analysis: In this stage, the problem is analyzed on a large scale, and all necessary information is
gathered, including interfaces and execution environment requirements.

System Design: The blueprint of the system software is created, specifying how it will look and function.
System Tool Acquisition: Decisions are made on the software tools needed to develop the system software.

Implementation: The software is built using the chosen tools, ensuring functionality, interfaces, and support
for execution.

System Maintenance: After the software is ready, it is installed and maintained through timely updates.

Diagram: The diagram for the Software Development Life Cycle (SDLC) includes the steps of Preliminary
Investigation, System Analysis, System Design, System Tool Acquisition, Implementation, and System
Maintenance in a sequential flow.

6. Define Life Cycle of a Source Program.


Ans:

Life Cycle of a Source Program

Edit Time:

· Initial phase where program code is edited and designed.

Compile Time:

· Source code is translated into machine code by a compiler, checking for errors and inconsistencies.

Distribution Time:

· Program is sent from creator to user, usually in the form of executable files.

Installation Time:

· Program is installed and prepared for execution within the system.

Link Time:

· Specific implementation of interface is linked to the program.

Load Time:

· Executable image is loaded into active memory for execution.

Run Time:

· Final stage where the programmed behavior is demonstrated.


7. Explain Semantic gap, Execution domain, specification gap, execution
gap.
Ans:

Semantic gap: The semantic gap represents the difference between the meanings of two domains. It
signifies the disparity in understanding or interpretation between two different contexts or systems.

Execution domain: The execution domain refers to the realm where the ideas of a designer are
implemented in terms related to the computer system's execution. It involves translating the design
concepts into executable actions within the computer environment.

Specification gap: The specification gap is the difference between the application domain and the
programming language domain. It is also known as the specification and design gap, representing the
semantic difference between two specifications of the same task.

Execution gap: The execution gap denotes the difference in semantics between programs written in
different programming languages. It highlights the discrepancy in interpretation or execution when
transitioning between diverse programming language environments.

8. Provide definitions of language processor, language translator, pre-


processor, and interpreter?
Ans:

Definitions of Language Processor, Language Translator, Pre-processor, and


Interpreter:

Language Processor: A language processor is a software tool that processes every statement in a source
program to perform language processing functions. It bridges the semantic gap between the source
language and the target language by analyzing and synthesizing the source code.

Language Translator: A language translator is a tool that translates source code from one programming
language to another. It converts the source program into an equivalent target program in a different
language, enabling the execution of the program on a different platform.

Pre-processor: A pre-processor is a software tool that handles tasks such as macro processing, symbol
resolution, and call explanations before sending the program to language translators like assemblers. It is a
preprocessing step that prepares the source program for further translation activities.

Interpreter: An interpreter is a program that reads and executes source code line by line. It analyzes each
statement, determines its meaning, performs the computation specified, and executes the instructions
directly without the need for a separate compilation step.
9. What is language processing activity?
Ans:

Language Processing Activity

Language processing activity involves two main types of activities that bridge the semantic gap between
the source language and the target language.

1. Program generation activities aim at automatically generating a program by using a program


generator software that interprets the source program and produces a program in the target
language.
2. Program execution involves the actual running of the generated program to achieve the desired
outcomes or results.
These activities are crucial in the overall process of language processing.

10.What are the phases of language processor?


Ans:

Phases of Language Processor:

· Lexical Analysis (Scanning): Identifies lexical units and classifies them into different classes.
· Syntax Analysis (Parsing): Determines the grammatical structure of the token string and builds an
intermediate code.
· Semantic Analysis: Determines the meaning of statements by applying semantic rules to the
structure.

11.Differentiate between stack and heap.


Ans:

Stack vs Heap

Stack Allocation:

· Stack is a linear data structure following last-in, first-out policy.


· Only the last element of the stack is accessible at any given time.

Heap Allocation:

· Heap is a non-linear data structure allowing random allocation and deallocation of entities.
· Entities in the heap must maintain a pointer to the allocated memory area.
12.Write down different types search techniques.
Ans:

Search Techniques

1. Sequential Search Organization

· In this technique, all active entries in the table have an equal probability of being accessed during
the search for a symbol.
· If the search is unsuccessful, the symbol can be added to the table using an 'add' operation.

2. Binary Search Organization

· Tables using binary search organization assume an ordering relation among their entries.
· The probability of successful search in a table with 'f' occupied entries is log 2 f, and for an
unsuccessful search, it is also log 2 f.

3. Hash Table Organization

· A hash table, also known as a hash map, maps keys to values using a hash function.
· It efficiently implements associative arrays and symbol tables, outperforming other data structures
by performing 'm' accesses on 'n' names.

4. Linked List and Tree Structure Organizations

· Linked lists and tree structures are used to organize symbol tables efficiently.
· Self-organizing lists prioritize frequently referenced variables, while search trees efficiently handle
searching operations.

13.What is hash table?


Ans:

Hash Table

Definition: A hash table, also known as a hash map, is a data structure that utilizes a hash function to map
keys to their corresponding values efficiently.

Components:

· Hash Function: Used to determine the slot where a key's value belongs in the hash table.
· Array of Pointers: Contains 'm' pointers to storage table entries.
· Linked Lists: Organized into separate buckets to store storage table entries efficiently.

Functionality:

· Mapping: Hash function maps key values to specific slots in the hash table.
· Efficiency: Enables quick access and manipulation of data, outperforming other data structures in
certain scenarios.

14.Write down different elements of assembly language programming.


Ans:

Elements of Assembly Language Programming

· Mnemonic Operation Codes: These are easier-to-remember codes for machine instructions,
making programming simpler and enabling the assembler to detect invalid operation codes.
· Symbolic Operands: Programmers can use symbolic names to represent data or instructions,
freeing them from dealing with numeric addresses directly in assembly statements.
· Data Declarations: Data can be declared using various notations, including decimal, to avoid
manually specifying constants in computer-understandable representations.

15.What are the different types of assembly statements? Provide suitable


examples.
Ans:

Types of Assembly Statements:

Imperative Statement:
An imperative statement indicates an action to be performed during the execution of the assembled
statement. Each imperative statement typically translates into one machine instruction. Examples include
MOVER BREG,X and STOP.

Declaration Statement:
Declaration statements are used for reserving memory for variables. The syntax includes DS <constant>
and DC ‘<value>’. For example, A DS 10 reserves 10 words of memory for variable A.

Assembler Directive:
Assembler directives instruct the assembler to perform certain actions during the assembly program.
Examples include START <Constant> which indicates the first word of the machine to be placed in memory
at a specific address.

16.Explain the design of assembler with diagram.


Ans:

Design of Assembler with Diagram

Analysis Phase: The analysis phase of the assembler involves building the symbol table by determining the
address of symbolic names. It uses a data structure called the location counter (LC) to implement memory
allocation. The tasks of the analysis phase include isolating label, mnemonic opcode, and operand fields,
entering symbols into the symbol table, checking the validity of mnemonics opcode, and performing LC
processing.
Synthesis Phase: In the synthesis phase, the assembler converts assembly statements into machine
instructions. For example, to synthesize the machine instruction corresponding to an assembly statement
like "MOVER BREG, ONE," the assembler needs specific information obtained during the analysis phase. This
information includes the mnemonic opcode, operands, and any necessary processing done during the
analysis phase.

Data Structures: The two main data structures used in the assembler are the Mnemonics Table (MOT) and
the Symbol Table (SYMTAB). The Mnemonics Table contains fields such as mnemonic opcode, machine
opcode, alignment/format info, and routine id. On the other hand, the Symbol Table holds information
about symbols defined and used in the source program, including the owner segment, type, and other
relevant details.

Single Pass Assembler for Intel x86 Design: In the design of a single-pass assembler for Intel x86, the
algorithm differs from the first pass of a two-pass assembler in terms of memory allocation units. The
assembler aligns memory addresses on specific boundaries and performs LC alignment before allocating
memory for statements. This design ensures efficient processing of declarations and imperative statements
in the assembly program.

17.Write difference between one pass and two pass assemblers.


Ans:

Difference Between One Pass and Two Pass Assemblers

One Pass Assembler:

· Requires only one scan of the source program to generate machine code.
· Handles forward references using back patching technique.
· Can report certain errors during the first pass but not all.

Two Pass Assembler:

· Consists of two passes: Pass I and Pass II.


· Pass I performs analysis of the source program by processing LC and entering symbols into the
symbol table.
· Pass II synthesizes the target form using the address information found in the symbol table.

18.What are the different advanced assembler directives?


Ans:

Advanced Assembler Directives

ORIGIN Directive:

· The ORIGIN directive instructs the assembler to put the address specified by the <address
specification> in the location counter.
· Syntax: ORIGIN <address specification>
LTORG Directive:

· The LTORG directive, standing for 'origin for literals', allows specifying where literals should be
placed in memory.
· It ensures that all references to literals are forward references and allocates memory to literals at
specific points during assembly.

EQU Directive:

· The EQU statement associates the name <symbol> with the address specified by <address
specification>, without affecting the address in the location counter.
· Syntax: EQU <symbol> <address specification>

19.Describe following data structures: OPTAB, SYMTAB, LITTAB, and


POOLTAB.
Ans:

OPTAB

· Description: OPTAB is a table containing mnemonic opcodes and related information.


· Components: It includes fields for mnemonic opcodes, class, and mnemonic information.
· Purpose: The class field categorizes opcodes into imperative, declaration, or directive statements.

SYMTAB

· Description: SYMTAB is a symbol table storing symbol attributes used in the source program.
· Attributes: Each entry in SYMTAB contains the symbol name, field address, and length.
· Operations: It supports operations like adding, locating, deleting, and accessing symbol entries.

LITTAB

· Description: LITTAB is a table of literals used in the program.


· Contents: Each LITTAB entry includes the field literal and address.
· Function: LITTAB is utilized to collect all literals used in a program during the first pass.

POOLTAB

· Description: POOLTAB is an auxiliary table maintaining awareness of different literal pools.


· Management: It contains the literal number of the starting literal of each literal pool.
· Usage: POOLTAB helps in allocating addresses to literals and managing literal pools effectively.
20.Describe single pass assembler for Intel x86.
Ans:

Single Pass Assembler for Intel x86

Overview:
A single pass assembler for Intel x86 processes the source code in one go, generating machine code
directly without the need for a second pass.

Address Allocation:
In this assembler, memory allocation is done on a byte basis, with specific entities requiring alignment on
certain boundaries in the address space.

LC Processing:
During assembly, the assembler aligns the address contained in the LC on the appropriate boundary before
allocating memory for a statement.

Data Structures:
The assembler utilizes data structures like the Mnemonics Table (MOT) and Symbol Table (Symtab) to
handle opcode information and symbol definitions in the source program.

Error Reporting:
Error reporting in this single pass assembler is efficient, with easy error indication due to the availability of
data structures like SYMTAB during pass II.

21.What do you mean by macro?


Ans:
A macro is a single-line abbreviation for a group of instructions in programming. It simplifies coding
by replacing repetitive blocks of code with a single instruction. Macros help reduce errors, enhance code
readability, and are expanded during the assembly process.

22.What is macro processor?


Ans:

Macro Processor

A macro processor is a program that processes input data to produce output used as input for another
program. It can exist independently or be part of an assembler implementation. The output of a macro
processor is an assembly program that serves as input for the assembler.

Macro processors identify macro definitions and calls in a program, determine formal parameters and their
values, and handle expansion time control flow. They also perform the expansion of model statements and
maintain values of expansion time variables.
23.Differentiate between macro and subroutine.
Ans:

Difference between Macro and Subroutine

Macro:

· Macro instructions are single-line abbreviations for groups of instructions.


· During assembly time, the entire block of instructions is replaced for every occurrence of the macro
instruction in the program.
· Macros are handled by the assembler and lead to code expansion.

Subroutine:

· Subroutines are called during runtime execution based on a call statement in the program.
· Hardware executes subroutines, and they are completely handled at runtime.
· Subroutines are not expanded like macros; instead, they are executed directly during program
execution.

24.Explain different types of formal parameters.


Ans:

Types of Formal Parameters

· Positional Parameters: These parameters are specified without any <parameter kind> in the
syntax rule. They are written as &<parameter name>. The value of a positional formal parameter is
determined by the rule of positional association based on the ordinal position in the list of formal
parameters.
· Keyword Parameters: For keyword parameters, the specification <parameter kind> is the string
'=' in the syntax rule. The <actual parameter specification> is written as <formal parameter
name> = <ordinary string>. The value of a formal parameter is determined by the rule of keyword
association based on the actual parameter specification.

25.What do you mean by macro definition, and call and expansion?


Ans:

Macro Definition and Call

Macro Definition: A macro definition consists of a name, formal parameters, and a body of codes. It is
enclosed between a MACRO and MEND directive. The formal structure includes a prototype statement,
model statements, and a macro preprocessor statement.
Macro Call: A macro is called by writing its name in the mnemonic field of the assembly language. The
syntax includes the macro name followed by actual parameter specifications. The MACRO directive marks
the start of the macro definition, while the MEND directive signifies the end.

Macro Expansion: When a macro is called in a program, it leads to macro expansion. During expansion,
the name of the macro is replaced by the sequence of assembly language statements defined in the macro
body. The expansion process involves substituting actual parameters for formal parameters and generating
the corresponding assembly code.

26.Write a small program to define macro.


Ans:

Program to Define Macro

Step 1: Define Macro

MACRO MY_MACRO &PARAM1, &PARAM2


; Macro body statements here
MEND

Step 2: Call Macro

MY_MACRO VALUE1, VALUE2

Explanation:

· In the program above, a macro named

MY_MACRO

is defined with two formal parameters

&PARAM1

and

&PARAM2

· The macro body statements are written between

MACRO
and

MEND

directives.

· To call the macro, use the macro name followed by actual parameter values.

27.Explain the design of macro pre-processor.


Ans:

Design of Macro Pre-processor

Macro Preprocessor Overview: A macro preprocessor is crucial for handling programs with macro
definitions and calls. It acts as an intermediary step between the source program and the assembler or
compiler. The preprocessor takes input with macros and generates an expanded program without any
macro definitions or calls.

Tasks Performed by Macro Preprocessor: The macro preprocessor performs key tasks such as identifying
macro definitions and calls in the program, determining formal parameters and their values, and keeping
track of expansion time variables and sequencing symbols. It ensures that the source program is processed
effectively before being passed on to the assembler or compiler for further translation.

Design Considerations: When designing a macro preprocessor, it is essential to consider factors like
recognizing macro calls, managing formal parameters, maintaining expansion time variables, and
organizing control flow during macro expansion. Flexible data structures and databases play a vital role in
tracking program information effectively. Attributes of macro arguments, default arguments, and numeric
values also influence the design of the preprocessor.

28.Explain the design of macro assembler.


Ans:

Design of Macro Assembler

· A macro assembler is functionally independent of the assembler and its output becomes part of
the assembler's input.
· The integration of macro processor and assembler is known as a macro assembler, eliminating the
need for creating intermediate files.
· The macro processor is typically implemented within pass 1 of the assembler to avoid duplicate
work and improve efficiency.
29. Write down the functions of macro processor.
Ans:

Functions of Macro Processor

Identifies macro definitions and calls in the program: The macro processor scans the program to recognize
where macros are defined and where they are invoked.

Determines formal parameters and their values: It keeps track of the parameters specified in the macro
definition and assigns values to them during expansion.

Keeps track of the values of expansion time variables and sequencing symbols: The macro processor manages
variables and symbols used during the expansion process to ensure correct substitution and sequencing.

30. What are the basic tasks of macro processor?


Ans:

Basic Tasks of Macro Processor

1. Handling Macro Definition:

· A macro assembler maintains tables like Macro Name Table (MNT) and Macro Definition Table
(MDT) for handling macro definitions.
· It starts with a MACRO directive, saves the definition in MDT, and continues until the MEND
directive is found.

2. Handling Macro Expansion:

· Macro expansion involves substituting macro calls with their definitions in the program.
· The assembler switches to a special macro expansion mode to perform this task efficiently.

31. Define one-pass macro processors.


Ans:

One-Pass Macro Processors

One-pass macro processors are a design option for macro processing that require the definition of a
macro to be strictly provided before its use in the program. These processors do not involve multiple
passes over the source code for macro expansion. Instead, they expand macros in a single pass while
processing the program sequentially.
32. Write down the differences between linker and loader.
Ans:

Differences between Linker and Loader

Linker:

· Function: Linker is a system program that links together various object modules to produce a
single executable binary program.
· Time of Operation: Linking is done during the compile time.
· Output: Produces a single executable binary program by linking object modules.
· Tasks: Resolves symbolic references, links necessary library functions, and produces a single
executable program.

Loader:

· Function: Loader is a system program that loads the executable binary program into the main
memory for execution.
· Time of Operation: Loading is done during the execution time.
· Output: Loads the executable binary program into the main memory.
· Tasks: Performs relocation, loads the program into memory, and transfers control to the program
for execution.

33. Explain the design of a linker.


Ans:

Design of a Linker

· The design of a linker is divided into two main parts: Relocation and Linking.
· Relocation: The linker uses a work area in memory to construct the binary program, loads the
machine language program from object modules, and relocates address-sensitive instructions
based on the RELOCTAB entries.
· Linking: The linker gathers various object modules, links them together to produce a single
executable binary program, and loads them into memory for execution.

34. Explain advantages and disadvantages of linking scheme.


Ans:

Advantages of Linking Scheme:

· Memory Efficiency: Linking loaders save memory space by combining object programs and
replacing the assembler with a smaller loader component.
· Ease of Execution: Linking loaders eliminate the need for reassembly of the program before
execution, allowing direct loading and execution of object files.
Disadvantages of Linking Scheme:

· Complexity: Linking loaders are more complicated as they need to manage multiple object files
and handle symbolic references.
· Secondary Storage Requirement: Object files need to be stored in secondary storage before
being loaded into memory, adding an extra step to the process.

35. What is static and dynamic linking?


Ans:

Static and Dynamic Linking

Static Linking:

· Static linking involves linking all modules of a program before execution, creating a binary
program without unresolved external references.
· Each program using the same module from a library gets a private copy, potentially leading to
multiple copies in memory if many programs are running simultaneously.

Dynamic Linking:

· Dynamic linking occurs during program execution, linking external references when encountered.
· It offers benefits in terms of use, sharing, and updating of library modules, allowing multiple
programs to share the same module in memory, thus saving memory space.

36. What are the different loading schemes? Explain briefly.


Ans:

Different Loading Schemes:

· Compile-and-Go Loaders:
· Assembler loads in memory and assembles the program directly into their designated
memory locations.
· After loading, the control is transferred to the starting instruction of the loaded program.
· Absolute Loaders:
· Load binary programs into memory for execution.
· Header record specifies load origin, length, and execution start address; binary image
records contain program code.
· General Loader Schemes:
· Improve compile/assemble-and-go scheme by translating different source
programs/modules into object programs separately.
· Object codes stored in secondary storage, loaded by a loader into memory, replacing the
assembler.
· Relocating Loaders:
· Load program in a designated memory area, relocate it for correct execution, and pass
control for execution.
· Efficiently utilize memory and resources, especially in dynamic runtime environments.
· Relocating Linking Loaders:
· Combine relocating and linking capabilities for a robust loading scheme.
· Eliminate the need for separate programs for linking and loading, efficient in dynamic
runtime environments.

37. Explain the advantages and disadvantages of loader scheme.


Ans:

Advantages of Loader Schemes:

· Loader schemes save memory space by using smaller loaders compared to assemblers.
· They eliminate the need for reprocessing the code every time it is run, allowing direct loading and
execution of object programs.

Disadvantages of Loader Schemes:

· Loader schemes can be more complicated, especially when managing multiple object files.
· They require secondary storage to store object files before loading them into memory.

38. What are the components of programming language grammars?


Ans:

Components of Programming Language Grammars:

· Terminal Symbol: These are symbols in the alphabet of a language, such as letters and
punctuation marks.
· Alphabet: It is the collection of graphic symbols used in a language, denoted by the Greek symbol
Σ.
· String: A finite sequence of symbols denoted by Greek symbols α, β, etc.
· Nonterminal Symbol: Represents the syntax category of a language, like noun or verb, and is
written as a single capital letter or enclosed between < ... >.
· Production: Also known as a rewriting rule, it is a rule of grammar defining the relationship
between nonterminal and terminal symbols.
· Grammar: Defined by a quadruple (Σ, SNT, S, P) where Σ is the alphabet, SNT is the set of
nonterminal symbols, S is the start symbol, and P is the set of productions.

39. What is parsing and parse tree?


Ans:

Parsing and Parse Tree

Parsing is the process of analyzing a string of symbols according to the rules of a formal grammar. It
involves breaking down the input into smaller components and checking if it conforms to the grammar
rules.
A parse tree is a graphical representation of the syntactic structure of a string according to the rules of a
formal grammar. It shows how the input string can be derived from the start symbol of the grammar
through a series of productions.

40. Define Classification of Grammar


Ans:

Classification of Grammar

Type-0 grammars:
Type-0 grammars are known as phrase structure grammars. Their productions are of the form α → β where
both α and β can be strings of terminal and nonterminal symbols. These grammars permit arbitrary
substitution of strings during derivation or reduction.

Type-1 grammars:
Productions of Type-1 grammars specify that derivation or reduction of strings can take place only in
specific contexts. These grammars are also known as context sensitive grammars. A production of a Type -1
grammar has the form αAβ → απβ.

Type-2 grammars:
Type-2 grammars, also known as context free grammars (CFG), do not impose any context requirements on
derivations or reductions. A typical Type -2 production is of the form A → π which can be applied
independent of its context.

Type-3 grammars:
Type-3 grammars are characterized by productions of the form A → tB|t or A → Bt|t. These grammars are
also known as linear grammars or regular grammars and are used for specifying lexical units like identifiers,
constants, labels, etc.

41. What is top-down and bottom-up parsing?


Ans:

Top-Down Parsing:

· Top-down parsing is a parsing technique where the parser starts from the root of the parse tree
and works its way down to the leaves.
· It begins with the start symbol and tries to rewrite it to the input string.

Bottom-Up Parsing:

· Bottom-up parsing is a parsing technique where the parser starts from the input symbols and
works its way up to the start symbol.
· It identifies the constituents of the input string and combines them to form the start symbol.
42. What is LEX and YACC?
Ans:

LEX and YACC

LEX is a tool used for generating scanners. It takes as input a specification of lexical units in the form of
regular expressions and semantic actions to build an intermediate representation.

YACC is a parser generator tool that generates LALR(1) parsers. It processes translation rules resembling
grammar productions to build an intermediate representation or target code.

43. What is regular expression? Give an example.


Ans:

Regular Expressions

Regular expressions are sequences of characters used to define search patterns for pattern matching
operations. They are commonly used for tasks like finding and replacing strings in text.

For example, a regular expression to match any string containing the word "apple" would be "apple".
Regular expressions provide a powerful and flexible way to search and manipulate text efficiently.

You might also like