SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
vinay arora
 
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
Paulo Morgado
 
C++ Overview
C++ OverviewC++ Overview
C++ Overview
kelleyc3
 

Was ist angesagt? (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
 

Ähnlich wie Managed Compiler

TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
dominion
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
Satish Verma
 
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
bwullems
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#
Robert Pickering
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
 

Ähnlich wie 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
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
vu2urc
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

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.

Hinweis der Redaktion

  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.