Introduction

Ahmad Yoosofan

Compiler course

University of Kashan

https://yoosofan.github.io/course/compiler.html

Compiler Usage

Compiler History

تحلیل‌گر لغوی

mov A,B
mov B,C

mov A,B\nmov B,C

mov
A
,
B
\n
  • Lexical Analyser
  • Tokenizer (token)
A = B + 4
A = B 4;

A = B + ;

if(A <= B)

If
(
A
<=
B
)

White space

  ‘\t ‘\n

\n

Syntax Analyser

Parser

Semantic Analysis

تحلیل‌گر معنایی

count ++;
f1(2);
int a = 2;
double x=4, y;
......
y=a+x;
y=double(a)+x;

کامپایلر

مفسر

END

1