SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
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.

Mais conteúdo relacionado

Mais procurados

Mais procurados (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)
 

Destaque

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
 

Destaque (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
 

Último

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Último (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Interpreter