SlideShare a Scribd company logo
1 of 17
Syntax: Sözdizimi anlamına gelir. Özel bir programlama dilinde 
ifadelerin uymak zorunda olduğu kurallar. 
Semantics: Deyimlerin,program birimlerinin anlamlarını ifade 
eder. 
Dil: Syntax ve Semantics dili tanımlar. 
Lexeme: Dilin en küçük birimidir. 
Token: Lexeme’lerin kategorisidir.
DİLLERİN RESMİ TANIMI 
Recognizers(Dil Tanıyıcısı): Dilden karakter dizisi okur. Dile 
ait olup olmadığına karar verir. Girilen ifade “print” mi diye bakar. 
Generators(Dil Üreticisi): Dile ait cümle üretir. Syntax’ın 
doğruluğunu kontrol eder. “print” doğru yazılmış mıdır? 
Programlama Dili Oluşturmak İçin Neler 
Gereklidir? 
Dilin gramer kuralları nasıl olmalı? 
Statementlar 
Assignment 
Hazır fonksiyonlar ve kütüphaneleri bulundurmak 
ALU’ya erişim,programlama dili donanım kaynaklarına erişim 
yapabilmeli( ekran,CPU,RAM,ekran kartı,CACHE,portlar,I/O)
SYNTAX TANIMINDA KULLANILAN METODLAR 
Backus-Naur Form (BNF) AND Extended BNF (EBNF) 
Contex-Free Grammers
Backus-Naur Form (BNF): Metalanguage(başka bir dil tanımlar) 
bir dildir. 
BNF ile açıklanan bir gramer dört bölümden oluşur. 
Başlangıç (amaç)sembolü, terminal semboller, terminal_olmayan 
semboller ve kurallardan oluşan BNF gramer yapısı aşağıdaki şekildeki 
gibi gösterilebilir. 
Soyutlamalar,sözdizimsel yapıların sınıflarını temsil etmek için 
kullanılır. Non-terminaldir. 
Terminals : lexemelar ve tokenlar. 
Dilin kurallarının başlangıç sembolünden başlayarak sıra ile cümle 
oluşturulmasına türetme denir.
TÜRETME ÖRNEĞİ 
<program> => <stmts> => <stmt> 
=> <var> = <expr> => a =<expr> 
=> a = <term> + <term> 
=> a = <var> + <term> 
=> a = b + <term> 
=> a = b + const 
AYRIŞTIRMA AĞAÇLARI 
Ağacın en aşağıdaki düğümlerinde 
terminal semboller yer alır. 
Diğer düğümleri ise dil yapısını 
tanımlayan terminal olmayan 
sembolleri içerir.
EBNF: BNF’in geliştirilmiş halidir. 
EBNF'te Seçimlik (optionality), Yineleme (repetition) ve 
Değiştirme(alternation) olmak üzere üç özellik yer almaktadır.
• BNF 
<expr> ® <expr> + <term> 
| <expr> - <term> 
| <term> 
<term> ® <term> * <factor> 
| <term> / <factor> 
| <factor> 
• EBNF 
<expr> ® <term> {(+ | -) <term>} 
<term> ® <factor> {(* | /) <factor>} 
Sağ tarafta yinelenecek ya da yer almayacak bölümü göstermek “ {}” 
Grup içinden tek eleman seçilmesi gerektiğinde “|”
Belirsiz Grammer (ambigiuos) : İki veya daha fazla ayrı 
parse ağacı oluşturan grammerdir. 
Operatörlerin öncelikleri gösterilirse belirsizlik olmaz. 
<assign> → <id>=<expr> 
<id>→A|B|C 
<expr>→<expr>+<expr> 
|<expr>*<expr> 
|(<expr>) 
|<id> 
Belirsiz gramerdir çünkü gramer hem sağa hem sola büyümeye izin 
verir. Derleyiciler parse tree temelinde hazırlanır. Bu yüzden belirsizlik 
problem oluşturur.
Özellik Grameri:
X0 →X1….Xn bir kural. 
S=A(X1) gibi fonksiyonlar sentezlenmiş özellikleri tanımlar. 
I(X) fonksiyonlar da kalıtılmış özellikleri tanımlar. 
A(x) özellik değerleri kümesidir,her kural fonksiyonlar kümesine 
sahiptir. Her kural özelliklerin tutarlığını kontrol eden yüklemseller 
kümesine sahiptir(predicates). 
Sentezlenmiş özellikler parse tree de anlamsal bilginin yukarı 
taşınmasında,kalıtsal özellikler ise aşağı taşınmasında kullanılır. 
Böylece fonksiyon değeri kardeş düğümler veya ebeveynlerden gelir.
Semantics 
İşlemsel Anlamlar(Operational Semantics): Programın 
ifadelerini makinede çalıştırarak anlamlarını tanımlar. Pascal’da bu 
duruma bakalım.
Aksiyomatik Anlamlar (Axiomatic Semantics):Programdaki her 
ifadede değişkenlerin kısıtları tanımlanır( iddialar). 
Programların doğruluğunu kanıtlamada kullanılır. 
İfadeden önceki iddaa pre, sonraki iddaa post conditiondur. 
Böylece programın ispatı yapılmış olur. 
Ör: 
Sum=2*x+1 (sum>1)
Gösterimsel anlamsallar (denotational semantic): Recursive 
temelli çalışır. 
Her varlık için matematiksel nesne tanımlanır ve fonksiyon tanımlama 
vardır.
Slayt

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Slayt

  • 1.
  • 2. Syntax: Sözdizimi anlamına gelir. Özel bir programlama dilinde ifadelerin uymak zorunda olduğu kurallar. Semantics: Deyimlerin,program birimlerinin anlamlarını ifade eder. Dil: Syntax ve Semantics dili tanımlar. Lexeme: Dilin en küçük birimidir. Token: Lexeme’lerin kategorisidir.
  • 3. DİLLERİN RESMİ TANIMI Recognizers(Dil Tanıyıcısı): Dilden karakter dizisi okur. Dile ait olup olmadığına karar verir. Girilen ifade “print” mi diye bakar. Generators(Dil Üreticisi): Dile ait cümle üretir. Syntax’ın doğruluğunu kontrol eder. “print” doğru yazılmış mıdır? Programlama Dili Oluşturmak İçin Neler Gereklidir? Dilin gramer kuralları nasıl olmalı? Statementlar Assignment Hazır fonksiyonlar ve kütüphaneleri bulundurmak ALU’ya erişim,programlama dili donanım kaynaklarına erişim yapabilmeli( ekran,CPU,RAM,ekran kartı,CACHE,portlar,I/O)
  • 4. SYNTAX TANIMINDA KULLANILAN METODLAR Backus-Naur Form (BNF) AND Extended BNF (EBNF) Contex-Free Grammers
  • 5. Backus-Naur Form (BNF): Metalanguage(başka bir dil tanımlar) bir dildir. BNF ile açıklanan bir gramer dört bölümden oluşur. Başlangıç (amaç)sembolü, terminal semboller, terminal_olmayan semboller ve kurallardan oluşan BNF gramer yapısı aşağıdaki şekildeki gibi gösterilebilir. Soyutlamalar,sözdizimsel yapıların sınıflarını temsil etmek için kullanılır. Non-terminaldir. Terminals : lexemelar ve tokenlar. Dilin kurallarının başlangıç sembolünden başlayarak sıra ile cümle oluşturulmasına türetme denir.
  • 6. TÜRETME ÖRNEĞİ <program> => <stmts> => <stmt> => <var> = <expr> => a =<expr> => a = <term> + <term> => a = <var> + <term> => a = b + <term> => a = b + const AYRIŞTIRMA AĞAÇLARI Ağacın en aşağıdaki düğümlerinde terminal semboller yer alır. Diğer düğümleri ise dil yapısını tanımlayan terminal olmayan sembolleri içerir.
  • 7. EBNF: BNF’in geliştirilmiş halidir. EBNF'te Seçimlik (optionality), Yineleme (repetition) ve Değiştirme(alternation) olmak üzere üç özellik yer almaktadır.
  • 8. • BNF <expr> ® <expr> + <term> | <expr> - <term> | <term> <term> ® <term> * <factor> | <term> / <factor> | <factor> • EBNF <expr> ® <term> {(+ | -) <term>} <term> ® <factor> {(* | /) <factor>} Sağ tarafta yinelenecek ya da yer almayacak bölümü göstermek “ {}” Grup içinden tek eleman seçilmesi gerektiğinde “|”
  • 9. Belirsiz Grammer (ambigiuos) : İki veya daha fazla ayrı parse ağacı oluşturan grammerdir. Operatörlerin öncelikleri gösterilirse belirsizlik olmaz. <assign> → <id>=<expr> <id>→A|B|C <expr>→<expr>+<expr> |<expr>*<expr> |(<expr>) |<id> Belirsiz gramerdir çünkü gramer hem sağa hem sola büyümeye izin verir. Derleyiciler parse tree temelinde hazırlanır. Bu yüzden belirsizlik problem oluşturur.
  • 10.
  • 12. X0 →X1….Xn bir kural. S=A(X1) gibi fonksiyonlar sentezlenmiş özellikleri tanımlar. I(X) fonksiyonlar da kalıtılmış özellikleri tanımlar. A(x) özellik değerleri kümesidir,her kural fonksiyonlar kümesine sahiptir. Her kural özelliklerin tutarlığını kontrol eden yüklemseller kümesine sahiptir(predicates). Sentezlenmiş özellikler parse tree de anlamsal bilginin yukarı taşınmasında,kalıtsal özellikler ise aşağı taşınmasında kullanılır. Böylece fonksiyon değeri kardeş düğümler veya ebeveynlerden gelir.
  • 13.
  • 14. Semantics İşlemsel Anlamlar(Operational Semantics): Programın ifadelerini makinede çalıştırarak anlamlarını tanımlar. Pascal’da bu duruma bakalım.
  • 15. Aksiyomatik Anlamlar (Axiomatic Semantics):Programdaki her ifadede değişkenlerin kısıtları tanımlanır( iddialar). Programların doğruluğunu kanıtlamada kullanılır. İfadeden önceki iddaa pre, sonraki iddaa post conditiondur. Böylece programın ispatı yapılmış olur. Ör: Sum=2*x+1 (sum>1)
  • 16. Gösterimsel anlamsallar (denotational semantic): Recursive temelli çalışır. Her varlık için matematiksel nesne tanımlanır ve fonksiyon tanımlama vardır.