SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Interpreter
 Abhijit Hiremagalur
 Cogent Consulting
Given a language, define a representation for its
grammar along with an interpreter that uses the
representation to interpret sentences in the
language [GOF, 243]
Domain
   Language
   Grammar
Object Hierarchy
Composite + interpret()
Reverse Polish Notation
3+4
is expressed as
     34+
3-4+5
(3 - 4) + 5 or 3 - (4 +5)

   Which one is it?
543-+
5 (4 3 -) +
  5 (1) +
     6
The code
‘41 2 1 - +’ equals 42
Stack what?
 []
 (41) => [41]
 (2) => [41, 2]
 (1) => [41, 2, 1]
 (-) => [41, 1]
 (+) => [42]
Easy to implement,
change & extend?
Doesn’t address parsing
Use something else if
grammar is complex
Refactor to an
Interpreter when...
“Numerous methods on a
class combine elements of an
      implicit language”
Replace Implicit Language
with Interpreter [Kerievsky]
“Define classes for the
  elements of the implicit
language so that instances
may be combined to form
interpretable expressions.”
A.K.A ?


• Little language
• Macro
• Domain specific language
Domain Specific
Language (DSL)
Internal vs External DSL
Spec productSpec = parse(“price below 9.00f and not coloured white”);




Spec productSpec = both(priceIsBelow(9.00f)).and(not(coloured(WHITE)));
Share symbols with
     Flyweight
Move operations to
     Visitor
The end.

Contenu connexe

Tendances

Tendances (7)

Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
 
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler design
 
Csr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCsr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminski
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
Flat unit 1
Flat unit 1Flat unit 1
Flat unit 1
 
Automata Theory
Automata TheoryAutomata Theory
Automata Theory
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)
 

En vedette

Top 10 Reasons Why I Don't Need An Interpreter: Exposing the Myths
Top 10 Reasons Why I Don't Need An Interpreter: Exposing the MythsTop 10 Reasons Why I Don't Need An Interpreter: Exposing the Myths
Top 10 Reasons Why I Don't Need An Interpreter: Exposing the MythsConnecting Cultures
 
Implementing a Simple Interpreter
Implementing a Simple InterpreterImplementing a Simple Interpreter
Implementing a Simple InterpreterRay Song
 
Stefany dodd how to become a interpreter and translator a beginner-s guide-...
Stefany dodd how to become a interpreter and translator   a beginner-s guide-...Stefany dodd how to become a interpreter and translator   a beginner-s guide-...
Stefany dodd how to become a interpreter and translator a beginner-s guide-...Rossi
 
Course Planning - Post Secondary Info Feb 2013
Course Planning - Post Secondary Info Feb 2013Course Planning - Post Secondary Info Feb 2013
Course Planning - Post Secondary Info Feb 2013Terry Ainge
 
Keys to a sustainable interpreting and translation business for freelancers
Keys to a sustainable interpreting and translation business for freelancersKeys to a sustainable interpreting and translation business for freelancers
Keys to a sustainable interpreting and translation business for freelancersHelen Eby
 
Using local culture in English teaching
Using local culture in English teachingUsing local culture in English teaching
Using local culture in English teachingRolando Tellez
 
ASTM Standard for Interpreting and Translation
ASTM Standard for Interpreting and TranslationASTM Standard for Interpreting and Translation
ASTM Standard for Interpreting and TranslationHelen Eby
 
Skills Required To Become a Professional Translator
Skills Required To Become a Professional TranslatorSkills Required To Become a Professional Translator
Skills Required To Become a Professional TranslatorHSS Translation
 
NYC Parking Tickets debunking 3 myths
NYC Parking Tickets debunking 3 mythsNYC Parking Tickets debunking 3 myths
NYC Parking Tickets debunking 3 mythsLawrence Berezin
 
Translation and Interpretation
Translation and InterpretationTranslation and Interpretation
Translation and Interpretationwendo1513
 
Types and modes of interpretation
Types and modes of interpretationTypes and modes of interpretation
Types and modes of interpretationJorge Carro
 
Translation vs. Interpretation
Translation vs. Interpretation Translation vs. Interpretation
Translation vs. Interpretation Rolando Tellez
 
Translation vs. Interpretation
Translation vs. Interpretation Translation vs. Interpretation
Translation vs. Interpretation Rolando Tellez
 
Translation Types
Translation TypesTranslation Types
Translation TypesElena Shapa
 

En vedette (16)

Top 10 Reasons Why I Don't Need An Interpreter: Exposing the Myths
Top 10 Reasons Why I Don't Need An Interpreter: Exposing the MythsTop 10 Reasons Why I Don't Need An Interpreter: Exposing the Myths
Top 10 Reasons Why I Don't Need An Interpreter: Exposing the Myths
 
Implementing a Simple Interpreter
Implementing a Simple InterpreterImplementing a Simple Interpreter
Implementing a Simple Interpreter
 
Stefany dodd how to become a interpreter and translator a beginner-s guide-...
Stefany dodd how to become a interpreter and translator   a beginner-s guide-...Stefany dodd how to become a interpreter and translator   a beginner-s guide-...
Stefany dodd how to become a interpreter and translator a beginner-s guide-...
 
Course Planning - Post Secondary Info Feb 2013
Course Planning - Post Secondary Info Feb 2013Course Planning - Post Secondary Info Feb 2013
Course Planning - Post Secondary Info Feb 2013
 
Keys to a sustainable interpreting and translation business for freelancers
Keys to a sustainable interpreting and translation business for freelancersKeys to a sustainable interpreting and translation business for freelancers
Keys to a sustainable interpreting and translation business for freelancers
 
Using local culture in English teaching
Using local culture in English teachingUsing local culture in English teaching
Using local culture in English teaching
 
ASTM Standard for Interpreting and Translation
ASTM Standard for Interpreting and TranslationASTM Standard for Interpreting and Translation
ASTM Standard for Interpreting and Translation
 
Skills Required To Become a Professional Translator
Skills Required To Become a Professional TranslatorSkills Required To Become a Professional Translator
Skills Required To Become a Professional Translator
 
NYC Parking Tickets debunking 3 myths
NYC Parking Tickets debunking 3 mythsNYC Parking Tickets debunking 3 myths
NYC Parking Tickets debunking 3 myths
 
Thanks for Making That Mistake! Using Errors as an Interpreter Teaching Tool
Thanks for Making That Mistake! Using Errors as an Interpreter Teaching ToolThanks for Making That Mistake! Using Errors as an Interpreter Teaching Tool
Thanks for Making That Mistake! Using Errors as an Interpreter Teaching Tool
 
Translation and Interpretation
Translation and InterpretationTranslation and Interpretation
Translation and Interpretation
 
Types and modes of interpretation
Types and modes of interpretationTypes and modes of interpretation
Types and modes of interpretation
 
Translation vs. Interpretation
Translation vs. Interpretation Translation vs. Interpretation
Translation vs. Interpretation
 
Translation vs. Interpretation
Translation vs. Interpretation Translation vs. Interpretation
Translation vs. Interpretation
 
Methods Of Translation
Methods Of TranslationMethods Of Translation
Methods Of Translation
 
Translation Types
Translation TypesTranslation Types
Translation Types
 

Dernier

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 

Dernier (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 

Interpreter