0% found this document useful (0 votes)
3 views20 pages

3

The document outlines the syllabus for the CSC 415 Compiler Design course at the Higher Technological Institute, focusing on finite automata, regular expressions, and various aspects of compiler design. It includes topics such as grammar and parsing, semantic processing, symbol tables, and code generation. Additionally, it provides examples of finite automata and regular expressions, along with a grading scheme and classroom policies.

Uploaded by

George Youssef
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)
3 views20 pages

3

The document outlines the syllabus for the CSC 415 Compiler Design course at the Higher Technological Institute, focusing on finite automata, regular expressions, and various aspects of compiler design. It includes topics such as grammar and parsing, semantic processing, symbol tables, and code generation. Additionally, it provides examples of finite automata and regular expressions, along with a grading scheme and classroom policies.

Uploaded by

George Youssef
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/ 20

Higher Technological Institute (HTI)

Computer Science Department

CSC 415 Compiler Design

CHAPTER 1
Finite automaton (FA)

Dr. Hany M. Zamel

1
2

Course Syllabus

Scanning theory and practice: Regular expressions, finite automata,


and scanners, scanner generators, practical considerations, translating
regular expressions to finite automata. Grammar and parsing: Context
frees grammars, parsers and recognizers, grammar analysis
algorithms. Semantic processing: Syntax directed translation. semantic
processing techniques.
Symbol tables: Basic techniques, block structured and extensions,
implicit declarations. Run time storage organization: Static allocation,
sack allocation, heap allocation, and program layout in memory Dain
structures: analysis declaration processing fundamentals action
routines. Procedures and functions: If statements, loops, case
statement, exception handling, passing parameters to subprograms.
Code generation and optimization: Register and temporary
management interpretive code generation, generating code from
subprogram calls, loop optimization.
3

Textbook

A. Ullman, “Compilers Principles, Techniques, and Tools”, Pearson


Education Limited, 2014

Course Site
https://hanyzamel.wixsite.com/lec-hti
4

Grading Scheme
5

Classroom Policy
Regular Expression

6 3/12/2025
Regular Expression
Write regular expressions for the following character sets

7 3/12/2025
Regular Expression
Write regular expressions for the following character sets

8 3/12/2025
Finite Automata and Scanners (1)
 Finite automaton (FA)
 can be used to recognize the tokens specified by a regular expression

 A FA consists of
 A finite set of states S
 A set of input symbols  (the input symbol alphabet)
 A set of transitions (or moves) from one state to another,
labeled with characters in V
 A special start state s0 (only one)
 A set of final, or accepting, states F

FA = {S, , s0, F, move }

9 3/12/2025
Finite Automata and Scanners (2)

is a state

is a transition

is the start state

is a final state

Example at next page….


10 3/12/2025
Finite Automata and Scanners (3)
 Example
 A transition diagram
 This machine accepts (abc+)+

( a b c +) +

a b c

11 3/12/2025
Finite Automata and Scanners (4)
 Other Example
 (0|1)*0(0|1)(0|1)

0 0,1 0,1
1 2 3 4

0,1 0
5

0,1
(0|1) * 0 (0|1)(0|1)

12 3/12/2025
Finite Automata and Scanners (5)
 Other Example
 ID = L(L|D)*(_(L|D)+)* Final for two * symbol
L (L|D)* (_(L|D)+)*

L|D

L -

L|D

13 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)

1- aa

14 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)

2- baba

15 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)
3- (a + b)(a + b)* ≡ (a + b)+

16 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)
4- (a + b)*

17 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)
5- (a + b)*a

18 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)
6- {a is even number}

19 3/12/2025
Transition Table
Draw Finite Automata (FA) transition diagram and transition
table for the following Regular Expressions (RE)
7- {a is odd number}

20 3/12/2025

You might also like