120 likes | 223 Views
Pas2Mips. Presentation of. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding. Jacqueline BOLLET Loïc GARDE Stéphane GRAZIANO Thierry GRENIER Frédéric OTALORA
E N D
Pas2Mips Presentation of
Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Jacqueline BOLLET Loïc GARDE Stéphane GRAZIANO Thierry GRENIER Frédéric OTALORA Carine PALCOUX Gunilla SVANFELDT Anne-Lise TARDIVAUD Group presentation
Pas2Mips is a compiler for a Pseudo Pascal language. Pas2Mips generates MIPS code. Tool for compiling and debugging. Because I’m worth it! Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding What is Pas2Mips ?
Lightweight Speed Easy to use Modularity Flexibility Free Support Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Why Pas2Mips ?
Types: integer, float, character, boolean, const, array, pointer, record. Loops: While. Tests: If. Input / Output: read, write. Operations: addition, subtraction, multiplication, division, modulo, greater than, greater than or equal, less than, less than or equal. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding The Language
Logical operations: and, or, not. Functions: functions with zero or more parameters, procedures with zero or more parameters. Restrictions: An array cannot contain another array. A pointer cannot point at another pointer. Strings are not treated. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding The Language
Lexical Analysis. Syntactical Analysis. Semantical Analysis. Code Generation. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Structure
The source program is partitioned into keywords ( including parentheses, commas etc) by Lexx according to the definition of our pseudo-Pascal grammar. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Structure: Lexical Analysis
The source program is tested according to the pseudo-Pascal grammar. If an syntactical error is found: Execution interrupted. The line number, where the error has occurred, is given. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Structure: Syntactical Analysis
Semantical errors: Incoherences between the type of variables. Example: error if a := b ; with a: boolean and b: character. Pas2Mips give the line number and the type of an error. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Structure: Semantical Analysis
Pas2Mips generates Mips code (3 address code as Intel, Motorola). Modest use of registers. Pas2Mips doesn't charge the memory. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Structure: Code Generation
Code written in C. Tested with Lclint (-weak option): Easy to understand if modifications are necessary. Group Presentation What is Pas2Mips ? Why Pas2Mips ? The language Structure: Lexical analysis Syntactical Analysis Semantical Analysis Code Generation Encoding Encoding