DCSPM Develop and Compile Subset of PASCAL Language
DCSPM: Develop and Compile Subset of PASCAL Language to MSIL 1 MASTER PROJECT PROPOSAL ABDULLAH SHENEAMER MSCS GRADUATE CANDIDATE COMMITTEE MEMBERS: DR. ALBERT GLOCK DR. EDWARD CHOW ALBERT BROUILLETTE SPRING 2012 Abdullah Sheneamer Master project proposal 4/10/2012
Outline 2 � Introduction to MSIL � Why PASCAL to MSIL � PASCAL Compiler � Project Plan � Verify Compilation Results � Tasks � References Abdullah Sheneamer Master project proposal 4/10/2012
Introduction to MSIL 3 �Microsoft intermediate language(MSIL) is the lowest -level human readable programming language defined by the Common Language Infrastructure (CLI) specification and. NET Framework �(MSIL) includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations. Abdullah Sheneamer Master project proposal 4/10/2012
Why PASCAL to MSIL 4 - Allow PASCAL to run on. NET platform - Study how compiler in. NET environment work - PASCAL can now be run on modern machines - MSIL is platform independent - JIT compilers can be optimized for specific machines and architectures Abdullah Sheneamer Master project proposal 4/10/2012
PSCAL Compiler 5 �Compilation process: takes a PASCAL source code and produce (MSIL) Microsoft intermediate language. �Execution process: MSIL must be converted to CPU-specific code, usually by a just-in-time(JIT) Compiler. Native code is computer programming (code) that is compiled to run with a particular processor (such as an Intel x 86 - class processor) and its set of instructions. Abdullah Sheneamer Master project proposal 4/10/2012
6 Abdullah Sheneamer Master project proposal 4/10/2012
Compilation Process 7 PASCAL Source Code Lexical Analysis Parser Symbol Table Error Handler MSIL Abdullah Sheneamer Master project proposal 4/10/2012
Project Plan 8 � Design and Implement subset of PASCAL language Lexical analysis, Parser. ( 3 Weeks). Lexical is done. Parser almost is done � Design and Compile Assignment statement to MSIL such as “ a: =b+c/d-e “ or “ a: =5; “ ( 2 Weeks) � Writeln Statement and Readln Statement such as “ writeln('This writeln is compiled into MSIL '); “ ( 2 Weeks). Writeln statement is done � , If statement such as “If variable 1 > , < , = , >=, <= variable 2 Then Begin variable 3 : = variable 1*variable 2; End; “ (3 weeks) � Design and Compile If/Else Statement to MSIL such as “If variable 1 > / < / = / >=/<= Number Then Begin variable 3 : = variable 1+, -, *, / variable 2; End Else Begin Writeln(‘ Condtitional statement’); End “ ( 1 week) Abdullah Sheneamer Master project proposal 4/10/2012
Project Plan 9 � Design and Compile While Statement to MSIL such as “While Variable 1 >, <. , =, <=, >= Number Do Begin Writeln(‘ While Statement’); Variable 1: = Variable 1 + 1; End; ” (3 Weeks) � Design and Compile For Statement to MSIL such as “For I: = Number To Number Do Begin If variable 1 > , < , = , >=, <= variable 2 Then Begin Writeln(‘ Conditional statement ‘) End; ( 3 Weeks) * Design and Compile Switch statement to MSIL such as “Case Variable of Value 1 Writeln(‘A’); Case Variable of Value 2 Writeln(‘B’); Case Variable of Value 3 Writeln(‘C’); Else Writeln(‘D’); End “ ( 4 Weeks) Abdullah Sheneamer Master project proposal 4/10/2012
Project Plan 10 �Improve subset of PASCAL Compiler and MSIL by observing the performance. �Evaluate the compiler design and Test the compiler results by comparing. Abdullah Sheneamer Master project proposal 4/10/2012
Verify Compilation Results 11 � ildasm. EXE: Converts IL to human readable code C: Program FilesMicrosoft SDKsWindowsv 7. 0 Abin � ILASM. EXE: Converts human readable code to IL C: WINDOWSMicrosoft. NETFrameworkv 1. 1. 4322 Or C: WindowsMicrosoft. NETFrameworkv 2. 0. 50727 Abdullah Sheneamer Master project proposal 4/10/2012
Tasks 12 � 1 - A working c# based PASCAL compiler. � 2 - A master report documenting the design and implementation of the subset of PASCAL compiler. �Additionally, improvements in the compilation process will be demonstrated and documented. Abdullah Sheneamer Master project proposal 4/10/2012
References 13 � 1 - http: //msdn. microsoft. com/en-us/library/c 5 tkafs 1(v=vs. 71). aspx � 2 - C# To Program By H. M Deitel & P. J. Deitel& J. Listfield & T. R. Nieto & C. Yaeger & � � � � � M. Zlatkina. 3 - Compiler Construction principles and practice by Kennth C. louden 4 - Data Structure using Java By D. S. Malik & P. S. Nair. 5 - An introduction to formal languages and automata. Fourth Edition. Peter Linz 6 - Compilers Principles, Techniques and Tools by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman. 1985 7 - Develop a Compiler in Java for a Compiler Design Course Abdul Sattar and Torben Lorenzen 8 - Guide to assembly language [electronic resource] : a concise introduction / James T. Streib, James T. London ; New York : Springer, c 2011. 9 - Using a Stack Assembler Language in a Compiler Course by Dr. Gerald Wildenberg St. John Fisher College, Rochester, NY Bristol Polytechnic, England (1989 -1990 ) 10 - Expert. NET 2. IL assembler/ Serge Lidin, Serge. 1956 - Berkeley, CA 11 - http: //www. codeproject. com/Articles/3778/Introduction-to-IL-Assembly. Language Abdullah Sheneamer Master project proposal 4/10/2012
- Slides: 13