SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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

Semelhante a 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
 

Semelhante a 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
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

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.

Notas do Editor

  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.