SlideShare une entreprise Scribd logo
1  sur  32
Implementing External DSLs Using Scala Parser Combinators St. Louis Lambda Lounge Sept. 3, 2009 Tim Dalton Senior Software Engineer Object Computing Inc.
External vs Internal DSL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Combinator ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Scala’s Parser Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala Combinator Parser Hierarchy ,[object Object],[object Object],[object Object],[object Object],[object Object]
A Simple Logo(-Like) Interpreter ,[object Object],[object Object],[object Object],[object Object],[object Object]
Grammar for Simple Logo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala Code to Implement Parser ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala Code to Implement Parser ,[object Object],[object Object],[object Object]
A Closer Look ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implicit Conversions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Back to the Parser ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Parser[T]’s and ParseResult[T]’s ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Combining Parser[T]’s ,[object Object],[object Object],[object Object],[object Object],[object Object]
Combining Parser[T]’s ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Forward March ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Repetition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Repetition ,[object Object],[object Object],[object Object],[object Object]
Other Forms of Repetition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Execution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Not-so-Happy Path ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Making Something Useful ,[object Object],[object Object],[object Object],[object Object]
Eye Brows Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Implementing Commands ,[object Object],[object Object],[object Object],[object Object],[object Object]
Transforming into Commands ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Derivates of “~” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Updated Parser ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Updated Parser Results ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Evaluation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Evaluation (More Functional) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Evaluation (More Imperative) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Demonstration

Contenu connexe

Tendances

Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentationirdginfo
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTanzeela_Hussain
 
Nonrecursive predictive parsing
Nonrecursive predictive parsingNonrecursive predictive parsing
Nonrecursive predictive parsingalldesign
 
Recursive descent parsing
Recursive descent parsingRecursive descent parsing
Recursive descent parsingBoy Baukema
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler DesignAkhil Kaushik
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)Chirag Shetty
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 
Theory of automata and formal language lab manual
Theory of automata and formal language lab manualTheory of automata and formal language lab manual
Theory of automata and formal language lab manualNitesh Dubey
 
Top down and botttom up Parsing
Top down     and botttom up ParsingTop down     and botttom up Parsing
Top down and botttom up ParsingGerwin Ocsena
 

Tendances (19)

Topdown parsing
Topdown parsingTopdown parsing
Topdown parsing
 
Functions
FunctionsFunctions
Functions
 
Ch2
Ch2Ch2
Ch2
 
Ch4a
Ch4aCh4a
Ch4a
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
Types of Parser
Types of ParserTypes of Parser
Types of Parser
 
Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentation
 
Module 11
Module 11Module 11
Module 11
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Nonrecursive predictive parsing
Nonrecursive predictive parsingNonrecursive predictive parsing
Nonrecursive predictive parsing
 
Recursive descent parsing
Recursive descent parsingRecursive descent parsing
Recursive descent parsing
 
Parsing
ParsingParsing
Parsing
 
Left factor put
Left factor putLeft factor put
Left factor put
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)
 
Bottom up parser
Bottom up parserBottom up parser
Bottom up parser
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
Theory of automata and formal language lab manual
Theory of automata and formal language lab manualTheory of automata and formal language lab manual
Theory of automata and formal language lab manual
 
Top down and botttom up Parsing
Top down     and botttom up ParsingTop down     and botttom up Parsing
Top down and botttom up Parsing
 

En vedette

Writing DSL's in Scala
Writing DSL's in ScalaWriting DSL's in Scala
Writing DSL's in ScalaAbhijit Sharma
 
Virtualization
VirtualizationVirtualization
Virtualizationturnerwife
 
Markaların Logo Değişimleri
Markaların Logo  DeğişimleriMarkaların Logo  Değişimleri
Markaların Logo DeğişimleriYunus Emre
 
Coches Fantasticos
Coches FantasticosCoches Fantasticos
Coches Fantasticosjosevlc
 
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...New England Direct Marketing Association
 
MTech13: "How to Jump Start Sales Productivity with Content" - Paula Crerar
MTech13: "How to Jump Start Sales Productivity with Content" - Paula CrerarMTech13: "How to Jump Start Sales Productivity with Content" - Paula Crerar
MTech13: "How to Jump Start Sales Productivity with Content" - Paula CrerarNew England Direct Marketing Association
 
Yahoo Korea 10th anniversary Plan Concept
Yahoo Korea 10th anniversary Plan ConceptYahoo Korea 10th anniversary Plan Concept
Yahoo Korea 10th anniversary Plan ConceptJongjin Park
 
Google Places - Global Approach ISS 2012
Google Places - Global Approach ISS 2012Google Places - Global Approach ISS 2012
Google Places - Global Approach ISS 2012Lisa Myers
 
A Redesign of VisitPhilly.com by Happy Cog
A Redesign of VisitPhilly.com by Happy CogA Redesign of VisitPhilly.com by Happy Cog
A Redesign of VisitPhilly.com by Happy CogKevin Hoffman
 
everdo for ad
everdo for adeverdo for ad
everdo for adzopen
 
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...New England Direct Marketing Association
 
Istant report Open Spece Technology "Facciamo il Macello"
Istant report Open Spece Technology "Facciamo il Macello"Istant report Open Spece Technology "Facciamo il Macello"
Istant report Open Spece Technology "Facciamo il Macello"Conetica
 
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...New England Direct Marketing Association
 

En vedette (20)

Writing DSL's in Scala
Writing DSL's in ScalaWriting DSL's in Scala
Writing DSL's in Scala
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Hpt performance
Hpt   performanceHpt   performance
Hpt performance
 
About Blogs
About BlogsAbout Blogs
About Blogs
 
PO
POPO
PO
 
Downtown Ferndale Business Guide 2011
Downtown Ferndale Business Guide 2011Downtown Ferndale Business Guide 2011
Downtown Ferndale Business Guide 2011
 
Markaların Logo Değişimleri
Markaların Logo  DeğişimleriMarkaların Logo  Değişimleri
Markaların Logo Değişimleri
 
Coches Fantasticos
Coches FantasticosCoches Fantasticos
Coches Fantasticos
 
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...
NEDMAInno14: The Fundamental Things Still Apply: How to Deal with "Innovation...
 
MTech13: "How to Jump Start Sales Productivity with Content" - Paula Crerar
MTech13: "How to Jump Start Sales Productivity with Content" - Paula CrerarMTech13: "How to Jump Start Sales Productivity with Content" - Paula Crerar
MTech13: "How to Jump Start Sales Productivity with Content" - Paula Crerar
 
Yahoo Korea 10th anniversary Plan Concept
Yahoo Korea 10th anniversary Plan ConceptYahoo Korea 10th anniversary Plan Concept
Yahoo Korea 10th anniversary Plan Concept
 
Google Places - Global Approach ISS 2012
Google Places - Global Approach ISS 2012Google Places - Global Approach ISS 2012
Google Places - Global Approach ISS 2012
 
Учебные форматы МАСП
Учебные форматы МАСПУчебные форматы МАСП
Учебные форматы МАСП
 
A Redesign of VisitPhilly.com by Happy Cog
A Redesign of VisitPhilly.com by Happy CogA Redesign of VisitPhilly.com by Happy Cog
A Redesign of VisitPhilly.com by Happy Cog
 
everdo for ad
everdo for adeverdo for ad
everdo for ad
 
CEO Roundtable on Local and State Tax Laws
CEO Roundtable on Local and State Tax LawsCEO Roundtable on Local and State Tax Laws
CEO Roundtable on Local and State Tax Laws
 
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...
MTech13: "The Power of Marketing Automation in an Inbound World" - Nick Salva...
 
Istant report Open Spece Technology "Facciamo il Macello"
Istant report Open Spece Technology "Facciamo il Macello"Istant report Open Spece Technology "Facciamo il Macello"
Istant report Open Spece Technology "Facciamo il Macello"
 
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...
Print Technology: Functional Printed Electronics - RFID & NFC versus QR Codes...
 
Workflow NPW2010
Workflow NPW2010Workflow NPW2010
Workflow NPW2010
 

Similaire à Implementing External DSLs Using Scala Parser Combinators

The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Languagezone
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoobirbal
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming LanguageRaghavan Mohan
 
Les origines de Javascript
Les origines de JavascriptLes origines de Javascript
Les origines de JavascriptBernard Loire
 
TI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretationTI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretationEelco Visser
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009David Pollak
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial ProgrammingSakthi Dasans
 
Java Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfJava Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfstopgolook
 
C intro
C introC intro
C introKamran
 
Php-Continuation
Php-ContinuationPhp-Continuation
Php-Continuationlotlot
 
C++ Function
C++ FunctionC++ Function
C++ FunctionHajar
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressionsKrishna Nanda
 
Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functionsmussawir20
 

Similaire à Implementing External DSLs Using Scala Parser Combinators (20)

Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Language
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 
Javascript
JavascriptJavascript
Javascript
 
Les origines de Javascript
Les origines de JavascriptLes origines de Javascript
Les origines de Javascript
 
TI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretationTI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretation
 
Javascript
JavascriptJavascript
Javascript
 
Programming
ProgrammingProgramming
Programming
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial Programming
 
Java Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfJava Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdf
 
C intro
C introC intro
C intro
 
Php-Continuation
Php-ContinuationPhp-Continuation
Php-Continuation
 
Oscon 2010 Specs talk
Oscon 2010 Specs talkOscon 2010 Specs talk
Oscon 2010 Specs talk
 
C++ Function
C++ FunctionC++ Function
C++ Function
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
 
Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functions
 

Dernier

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
"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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 

Dernier (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
"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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 

Implementing External DSLs Using Scala Parser Combinators

  • 1. Implementing External DSLs Using Scala Parser Combinators St. Louis Lambda Lounge Sept. 3, 2009 Tim Dalton Senior Software Engineer Object Computing Inc.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.

Notes de l'éditeur

  1. (|) = OR logic { } = repetition
  2. The multiline string notation is used so escaping “\\” in the regex is not needed
  3. Internal DSLs in Scala leverage implicit conversion to a great degree to allow a more flexible “syntax”
  4. ~ is a case class.
  5. Because statement and repeat invoke each other and therefore can be invoked recursively, The return type for one must be specified
  6. There is also rep1sep
  7. Demonstrate no so precise message “RT” -> “ET”
  8. For some reason Scala compile didn’t like { Turn(-_) }
  9. Tail Recursive !!