Mirage A Graphical Sketching Language Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Prof. Stephen Edwards Team Members: Abhilash I [email protected] Ming Liao [email protected] Nalini Vasudevan [email protected] Peili Zhang [email protected] Table of Contents Chapter 1 Introduction ..............................................................................…………..........…5 1.1 Overview ………………………................................……............................................……. 5 Motivation ……………………….........................................................................………...… 5 Description ………………………......................……....................................................……. 5 1.2 Language features .......................................................................………....................……. 6 Primitive Data Types ………………………...............................................................….…... 6 Key words ……………………….............................…….............................................…….. 6 Comparative and Mathematical Operators …………………...................................…...… 6 Control Statements ………………………..................……............................................….... 6 Other Features ……………………......…….................................................................…….. 6 Syntax …………………….........................…..........…….....................................……..…... 7 1.3 Design Goals ....................................……......................................……………………..…. 8 Simplicity and Intuitive ………………………....................................................…....... 8 Efficiency and Flexibility ……………………….........................................……......…....... 9 Robust and High-performance ..…….....................................……………………......…...... 9 Portability ………………………...................……......................................................…...... 9 1.4 Sample Programs ………...............................................….............................................……. 9 Chapter 2 Tutorial ......................………..........................................................................…... 12 2.1 Program Flow ...........………..........................…….......................................................….. 12 2.2 Sample Program .............……….............................……....................................................12 Chapter 3 Language Reference Manual ......................................……...........................…15 3.1 Lexical Conventions ...................................................................…………........................ 15 Tokens .................................................................................…………………................. 15 Comments .....................................................................................…………………....... 15 Identifiers .......................................................................................…………………...... 15 Keywords .....................................................................……...…………......................... 15 Constants ....................................…………………………….......................................... 15 Integers .............................................................………………………............................ 16 Strings ........................................................................……………………….................. 16 Other Kinds of Tokens............................................…............................................ 16 3.2 Types ...............................…………......................................................................... 16 3.3 Expressions .............................................………...........................................................…. 16 Primary Expressions .....................................................................................…..... 16 - Identifiers .........................................................................………............…...... 17 - Constant .........................................................................................………….... 17 - Integers, Strings .....................................................................…...………......... 17 - ( expression ) ................................................................………......................... 17 - Primary-expression < expression-list > .......................................……....…..... 17 - Primary-expression (expression-list) .........................................……......…..... 17 Arithmetic Expressions ...........................................................................………............. 17 - Unary Operators ........................................................................………............ 173 - Binary Operators ..........................................................................………......... 18 - Multiplicative Operators ..................................................................…..... 18 - Relational Operators ......................................................................…...... 18 - Equality Operators ............................................................…….................…... 18 - Logical Operators ................................................………..........................….....19 - Assignment Operator ................................................…….........................….... 19 Other Operators .........................................................................………………...... 19 Operator Precedence and Associativity ........……....................................................…... 19 3.4 Declarations
View Full Document