SlideShare a Scribd company logo
1 of 40
Language framework in a managed environment Microsoft Development Center Copenhagen  Author:  João Filipe Gama de Magalhães E-mail: t-joaode@microsoft.com February 2008
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008
Objectives ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008
[object Object],[object Object],Compiler Structure Language framework in a managed environment February 2008 Lexical Analyzer Semantic Analyzer Syntactical Analyzer Code Generator AST source  file target file tokens
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Overview
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 GPLEX Scanner Generator I
Compiler Implementation Language framework in a managed environment February 2008 GPLEX Scanner Generator II %using gppg; %option minimize %namespace Microsoft.Dynamics.PBvNext.Modelling.ExpressionCompiler /* independent scanner section start */ %x COMMENT %x STRING %x METADATA White0  [ ] White  {White0}| CmntStart   CmntEnd   ABStar  [^]* ABStar2  [^amp;quot;]* NONl  [^]* StrStart  amp;quot; StrEnd  amp;quot;
Compiler Implementation Language framework in a managed environment February 2008 GPLEX Scanner Generator III %{ %} if  { return (int)Tokens.KWIF; } switch  { return (int)Tokens.KWSWITCH; } case  { return (int)Tokens.KWCASE; } [_][a-zA-Z0-9_]+  return (int)Tokens.IDENT; } [0-9]+  { return (int)Tokens.NUMBER; } {CmntStart}{ABStar}*{CmntEnd} { return (int)Tokens.LEX_COMMENT; }  {CmntStart}{ABStar}*  { BEGIN(COMMENT); return (int)Tokens.LEX_COMMENT; } <COMMENT>  |  <COMMENT>{ABStar}*  { return (int)Tokens.LEX_COMMENT; } /* the end of the comment */ <COMMENT>{ABStar}*{CmntEnd}  { BEGIN(INITIAL); return (int)Tokens.LEX_COMMENT; } /* all the other cases */ .  { yyerror(&quot;illegal char&quot;); return (int)Tokens.LEX_ERROR; } %{ %}
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 GPPG Parser Generator I
Compiler Implementation Language framework in a managed environment February 2008 GPPG Parser Generator II %using Microsoft.Dynamics.PBvNext.DataStructure.ExpressionAST %namespace Microsoft.Dynamics.PBvNext.Modelling.ExpressionCompiler %valuetype LexValue %partial %union { public string str; public AstNode node; } %{ public RootNode rootNode; %} %token KWIF KWSWITCH KWCASE %token STR CMT META IDENT NUMBER %left BARBAR AMPAMP %left '!' %left NEQ EQ %left '-' '+'
Compiler Implementation Language framework in a managed environment February 2008 GPPG Parser Generator III %% E : B { rootNode = new RootNode((ExpressionNode) $1.node);  } | { rootNode = new RootNode(); } ; B : B AMPAMP B { $$.node = new BinaryBooleanExpressionNode(BooleanOperationType.AND, (ExpressionNode) $1.node, (ExpressionNode) $3.node); } ; A : A '+' A { $$.node = new BinaryArithmeticExpressionNode(ArithmeticOperationType.PLUS, (ArithmeticExpressionNode) $1.node, (ArithmeticExpressionNode) $3.node); } A : A '+' error {throw new ParsingError(”Error reducing literal expression”); } ; L : ATTR  { $$.node = new AttributeNode($1.str); } | CONST { $$.node = new ConstantNode(Int32.Parse($1.str)); } | error { throw new ParsingError(”Error reducing literal expression”); } ; CONST : NUMBER { $$.str = $1.str; } ; ATTR : IDENT  { $$.str = $1.str; } ;
Compiler Implementation Language framework in a managed environment February 2008 GPPG and GPLEX // creates a new scanner Scanner scanner =  new  Scanner();   // creates a new parser Parser parser =  new  Parser();   // sets the scanner for the parser parser.scanner = scanner;   // sets the stream to parse scanner.buffer =  new  Scanner.StringBuff( this .Value);   // parses the file parser.Parse();   // retrieves the output root node this .RootNode = parser.rootNode;
Compiler Implementation ,[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Visitor Pattern I
Compiler Implementation Language framework in a managed environment February 2008 Visitor Pattern II
Compiler Implementation ,[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],Language framework in a managed environment February 2008 Visitor Pattern III
Compiler Implementation ,[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Semantic Analysis I
Compiler Implementation ,[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],Language framework in a managed environment February 2008 Semantic Analysis II
Compiler Implementation ,[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Code Generation I
Compiler Implementation ,[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],Language framework in a managed environment February 2008 Code Generation II
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 XML Interpretation I
Compiler Implementation ,[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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 XML Interpretation II
Compiler Implementation ,[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Compiler Services I
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Compiler Services II
Compiler Implementation ,[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Adapter and Plug-ins I
Compiler Implementation Language framework in a managed environment February 2008 Adapter and Plug-ins II
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Adapter and Plug-ins III
Compiler Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Adapter and Plug-ins IV
Developed Solution ,[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Introduction
Developed Solution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 Project Description
Developed Solution ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 The Pml Language
Developed Solution Language framework in a managed environment February 2008 The Modeling Environment Compiler Tools Pml Compiler Client Code Generator Lexical Analyzer Semantic Analyzer Syntactical Analyzer Pml Code Tools Syntax Highlighter Code Completer AST
Developed Solution ,[object Object],[object Object],Language framework in a managed environment February 2008 The Compiler ,[object Object]
Developed Solution ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 The Compiler Tools
Developed Solution Language framework in a managed environment February 2008 The Configuration Environment Configuration Engine Adapter Abstraction Layer Microsoft Constraint Solver Adapter Microsoft Parallel Constraint Solver Adapter Interpretation Tools Client API Microsoft Parallel Constraint Solver Microsoft Constraint Solver AST Adapters
Developed Solution ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 The Interpretation Tools
Developed Solution ,[object Object],[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 The Adapter Abstraction Layer
Developed Solution ,[object Object],[object Object],[object Object],[object Object],Language framework in a managed environment February 2008 The Configuration Engine
Demo Language framework in a managed environment February 2008 Demo
[object Object],[object Object],[object Object],[object Object],[object Object],Conclusions Language framework in a managed environment February 2008
[object Object],Questions Language framework in a managed environment February 2008

More Related Content

What's hot

What's hot (20)

C++ Training
C++ TrainingC++ Training
C++ Training
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 
R package development, create package documentation isabella gollini
R package development, create package documentation   isabella golliniR package development, create package documentation   isabella gollini
R package development, create package documentation isabella gollini
 
PDC Video on C# 4.0 Futures
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futures
 
C++11
C++11C++11
C++11
 
SRAVANByCPP
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
What's New In C# 5.0 - Rumos InsideOut
What's New In C# 5.0 - Rumos InsideOutWhat's New In C# 5.0 - Rumos InsideOut
What's New In C# 5.0 - Rumos InsideOut
 
Go Language Hands-on Workshop Material
Go Language Hands-on Workshop MaterialGo Language Hands-on Workshop Material
Go Language Hands-on Workshop Material
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
 
Function in C program
Function in C programFunction in C program
Function in C program
 
C++ presentation
C++ presentationC++ presentation
C++ presentation
 
C and C++ functions
C and C++ functionsC and C++ functions
C and C++ functions
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Functions
FunctionsFunctions
Functions
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
 
C++ Overview
C++ OverviewC++ Overview
C++ Overview
 

Similar to Managed Compiler

The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
Attributes & .NET components
Attributes & .NET componentsAttributes & .NET components
Attributes & .NET componentsBình Trọng Án
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesEelco Visser
 
AD215 - Practical Magic with DXL
AD215 - Practical Magic with DXLAD215 - Practical Magic with DXL
AD215 - Practical Magic with DXLStephan H. Wissel
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_netNico Ludwig
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introductionPeter Gfader
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptdominion
 
Formatting ForThe Masses
Formatting ForThe MassesFormatting ForThe Masses
Formatting ForThe MassesHolger Schill
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003R696
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overviewbwullems
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005Tugdual Grall
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applicationsDeepankar Pathak
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Robert Pickering
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 

Similar to Managed Compiler (20)

The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
Attributes & .NET components
Attributes & .NET componentsAttributes & .NET components
Attributes & .NET components
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
Basics1
Basics1Basics1
Basics1
 
AD215 - Practical Magic with DXL
AD215 - Practical Magic with DXLAD215 - Practical Magic with DXL
AD215 - Practical Magic with DXL
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
 
Formatting ForThe Masses
Formatting ForThe MassesFormatting ForThe Masses
Formatting ForThe Masses
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Managed Compiler

  • 1. Language framework in a managed environment Microsoft Development Center Copenhagen Author: João Filipe Gama de Magalhães E-mail: t-joaode@microsoft.com February 2008
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Compiler Implementation Language framework in a managed environment February 2008 GPLEX Scanner Generator II %using gppg; %option minimize %namespace Microsoft.Dynamics.PBvNext.Modelling.ExpressionCompiler /* independent scanner section start */ %x COMMENT %x STRING %x METADATA White0 [ ] White {White0}| CmntStart CmntEnd ABStar [^]* ABStar2 [^amp;quot;]* NONl [^]* StrStart amp;quot; StrEnd amp;quot;
  • 8. Compiler Implementation Language framework in a managed environment February 2008 GPLEX Scanner Generator III %{ %} if { return (int)Tokens.KWIF; } switch { return (int)Tokens.KWSWITCH; } case { return (int)Tokens.KWCASE; } [_][a-zA-Z0-9_]+ return (int)Tokens.IDENT; } [0-9]+ { return (int)Tokens.NUMBER; } {CmntStart}{ABStar}*{CmntEnd} { return (int)Tokens.LEX_COMMENT; } {CmntStart}{ABStar}* { BEGIN(COMMENT); return (int)Tokens.LEX_COMMENT; } <COMMENT> | <COMMENT>{ABStar}* { return (int)Tokens.LEX_COMMENT; } /* the end of the comment */ <COMMENT>{ABStar}*{CmntEnd} { BEGIN(INITIAL); return (int)Tokens.LEX_COMMENT; } /* all the other cases */ . { yyerror(&quot;illegal char&quot;); return (int)Tokens.LEX_ERROR; } %{ %}
  • 9.
  • 10. Compiler Implementation Language framework in a managed environment February 2008 GPPG Parser Generator II %using Microsoft.Dynamics.PBvNext.DataStructure.ExpressionAST %namespace Microsoft.Dynamics.PBvNext.Modelling.ExpressionCompiler %valuetype LexValue %partial %union { public string str; public AstNode node; } %{ public RootNode rootNode; %} %token KWIF KWSWITCH KWCASE %token STR CMT META IDENT NUMBER %left BARBAR AMPAMP %left '!' %left NEQ EQ %left '-' '+'
  • 11. Compiler Implementation Language framework in a managed environment February 2008 GPPG Parser Generator III %% E : B { rootNode = new RootNode((ExpressionNode) $1.node); } | { rootNode = new RootNode(); } ; B : B AMPAMP B { $$.node = new BinaryBooleanExpressionNode(BooleanOperationType.AND, (ExpressionNode) $1.node, (ExpressionNode) $3.node); } ; A : A '+' A { $$.node = new BinaryArithmeticExpressionNode(ArithmeticOperationType.PLUS, (ArithmeticExpressionNode) $1.node, (ArithmeticExpressionNode) $3.node); } A : A '+' error {throw new ParsingError(”Error reducing literal expression”); } ; L : ATTR { $$.node = new AttributeNode($1.str); } | CONST { $$.node = new ConstantNode(Int32.Parse($1.str)); } | error { throw new ParsingError(”Error reducing literal expression”); } ; CONST : NUMBER { $$.str = $1.str; } ; ATTR : IDENT { $$.str = $1.str; } ;
  • 12. Compiler Implementation Language framework in a managed environment February 2008 GPPG and GPLEX // creates a new scanner Scanner scanner = new Scanner();   // creates a new parser Parser parser = new Parser();   // sets the scanner for the parser parser.scanner = scanner;   // sets the stream to parse scanner.buffer = new Scanner.StringBuff( this .Value);   // parses the file parser.Parse();   // retrieves the output root node this .RootNode = parser.rootNode;
  • 13.
  • 14. Compiler Implementation Language framework in a managed environment February 2008 Visitor Pattern II
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Compiler Implementation Language framework in a managed environment February 2008 Adapter and Plug-ins II
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Developed Solution Language framework in a managed environment February 2008 The Modeling Environment Compiler Tools Pml Compiler Client Code Generator Lexical Analyzer Semantic Analyzer Syntactical Analyzer Pml Code Tools Syntax Highlighter Code Completer AST
  • 32.
  • 33.
  • 34. Developed Solution Language framework in a managed environment February 2008 The Configuration Environment Configuration Engine Adapter Abstraction Layer Microsoft Constraint Solver Adapter Microsoft Parallel Constraint Solver Adapter Interpretation Tools Client API Microsoft Parallel Constraint Solver Microsoft Constraint Solver AST Adapters
  • 35.
  • 36.
  • 37.
  • 38. Demo Language framework in a managed environment February 2008 Demo
  • 39.
  • 40.

Editor's Notes

  1. Welcome and thank you all for coming. My name is Joao Magalhães, I’m a trainee from the Product Builder team and I’m here to give a presentation about the creation of compilers in a managed environment. For this presentation I’m using some of he work developed during my final (thesis) project for my Master degree.