0% found this document useful (0 votes)
11 views4 pages

SPCC-Practical Questions

The document lists different programs needed for a practical exam including assemblers, macroprocessors, lexical analyzer, recursive descent parser, three address code generator, and symbol table creator. It also provides examples of code and grammars for some of the programs. The last section lists different counting programs that can be written using Lex.

Uploaded by

Know Unknown
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)
11 views4 pages

SPCC-Practical Questions

The document lists different programs needed for a practical exam including assemblers, macroprocessors, lexical analyzer, recursive descent parser, three address code generator, and symbol table creator. It also provides examples of code and grammars for some of the programs. The last section lists different counting programs that can be written using Lex.

Uploaded by

Know Unknown
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/ 4

List of programs for practical exam

Assemblers : Pass1 of Assembler .


Input: Assembly language program, MOT,POT
Output: Symbol table
Input

PG1 START 0
** USING *,15
** L 1,FIVE
** A 1,FOUR
** ST 1,TEMP
FIVE DC F'5'
FOUR DC F'4'
TEMP DS 1F
** END PG1

MOT

A 5A
L 6A
ST 7A
END

POT
DS
DC
START
USING
Assemblers : Pass2 of Assembler .
Input: Assembly language program, MOT, POT, ST
Output: M/C code
Input

PG1 START 0
** USING *,15
** L 1,FIVE
** A 1,FOUR
** ST 1,TEMP
FIVE DC F'5'
FOUR DC F'4'
TEMP DS 1F
** END PG1

MOT

A 5A
L 6A
ST 7A
END

POT
DS
DC
START
USING

ST
FIVE 12
FOUR 16
TEMP 20
Macroprocessor : pass1 Macro processor.
Input: Assembly language program with Macro, Output: MNT, MDT

Input1:
MACRO
INCR
AR 2,3
MR 1,2
ST 1,2
MEND
PG1 START
USING *,15
L 1,FIVE
A 1, FOUR
INCR
ST 1,TEMP
M 1,FIVE
INCR
FIVE DC F’5’
FOUR DC F’4’
TEMP DS 1F
END
----------------------------------------------------------------------------------------------
Macroprocessor : Pass2 Macro processor.
Input: Assembly language program with Macro, MNT, MDT
Output: Expanded source code
Input1:
MACRO
INCR
AR 2,3
MR 1,2
ST 1,2
MEND
PG1 START
USING *,15
L 1,FIVE
A 1, FOUR
INCR
ST 1,TEMP
M 1,FIVE
INCR
FIVE DC F’5’
FOUR DC F’4’
TEMP DS 1F
END
Design Lexical Analyzer using C/ Java/Python
Input: HLL
Output: Collection of tokens

-----------------------------------------------------------------------------------------------------------

Design recursive descent parser for the grammar given below( Grammar may change)

E→TE’
E’→ +TE’ | epsilon
T→ FT’
T’→ *FT’ | epsilon
F→ (E) | id

---------------------------------------------------------------------------------------------------------------

Write program to generate three address code for given assignment, arithmetic and
relational statement

-----------------------------------------------------------------------------------------------------------------------

Write a program to create a symbol table for given statement

-------------------------------------------------------------------------------------------------------------------------

Write a Lex program for


(1) Count number of newlines, spaces and words
(2) Count number of operators and operands
(3) Count tokens – identifiers, constants, operators, special symbols
(4) Count number of vowels and Consonants
(5) Count positive and negative integer and fractions

You might also like