Programming Languages. Compilers. Formal Languages презентация

Слайд 2

Formal Languages Intro to compilers

Formal Languages

Intro to compilers

Слайд 3

LA Formal Languages

LA

Formal Languages

Слайд 4

Intro to compilers • Alphabet = English characters • Language

Intro to compilers

• Alphabet = English
characters
• Language = English
sentences

Formal Languages

Alphabet = ASCII
• Language = C programs
Слайд 5

Intro to compilers Meaning function L maps syntax to semantics

Intro to compilers

Meaning function L maps syntax to semantics

Meaning function

reg

expr

L(E) = Meanings

set of strings

Слайд 6

Intro to compilers Meaning function ‘ c ’ = ɛ

Intro to compilers

Meaning function

‘ c ’ =

ɛ =

{

“ “ }

{ “ c “ }

L : Exp -> Sets Strings

Слайд 7

Intro to compilers Meaning function L(‘ c ’) = L(

Intro to compilers

Meaning function

L(‘ c ’) =

L( ɛ ) =

{ “ “ }

{ “ c “ }

L(A + B) = L(A) U L(B)

L(AB) = {ab | a from L(A) ^ b from L(B)

L(A*) = U L(Ai)

Слайд 8

LA Why use a meaning function? – Makes clear what

LA

Why use a meaning function?
– Makes clear what is syntax,

what is semantics.
– Allows us to consider notation as a separate issue
– Because expressions and meanings are not 1-1

Meaning function

Слайд 9

LA Meaning function 0 1 42 107 I IV X XL

LA

Meaning function

0 1 42 107

I IV X XL

Слайд 10

LA Syntax and Semantic 0* 0 + 0* E +

LA

Syntax and Semantic

0*

0 + 0*

E + 00*

E

+ 0 + 0*

...

Слайд 11

LA Syntax and Semantic Meaning is many to one – Never one to many!

LA

Syntax and Semantic

Meaning is many to one
– Never one to many!

Имя файла: Programming-Languages.-Compilers.-Formal-Languages.pptx
Количество просмотров: 66
Количество скачиваний: 0