EZ-ASCII: a Language for ASCII-Art Manipulation
Total Page:16
File Type:pdf, Size:1020Kb
EZ-ASCII: A Language for ASCII-Art Manipulation Dmitriy Gromov (dg2720) Joe Lee (jyl2157) Yilei Wang (yw2493) Xin Ye (xy2190) Feifei Zhong (fz2185) December 19th, 2012 EZ-ASCII Table of Contents 1 Introduction ............................................................................................................................ 4 1.1 Motivation .................................................................................................................................... 4 1.2 Background .................................................................................................................................. 4 2 Language Tutorial ................................................................................................................. 5 2.1 Getting Started .............................................................................................................................. 5 2.1.1 Compiler Requirements......................................................................................................... 5 2.1.2 How to Compile and Run Program................................................................................................ 5 2.1.3 A First EZ-ASCII Program...................................................................................................... 6 2.2 Variables and Arithmetic Expressions............................................................................... 6 2.2.1 Types......................................................................................................................... 6 2.2.2 Operators..................................................................................................................... 7 2.2.3 Selection..................................................................................................................... 7 2.3 Branch Statement ...................................................................................................................... 7 2.4 Loop Statement........................................................................................................................... 8 2.5 Functions ...................................................................................................................................... 8 2.6 Built-in Canvas Functions ....................................................................................................... 8 2.7 Examples ....................................................................................................................................... 9 2.7.1 A Simple ACSII Art file....................................................................................................... 9 2.7.2 Draw New ACSII Art........................................................................................................... 10 2.7.3 More Examples................................................................................................................ 10 3 Language Reference Manual ........................................................................................ 14 3.1 Program Definition ................................................................................................................ 14 3.2 Lexical Conventions ............................................................................................................... 14 3.2.1 Tokens....................................................................................................................... 14 3.2.2 Comments..................................................................................................................... 14 3.2.3 Identifiers.................................................................................................................. 14 3.2.4 Keywords..................................................................................................................... 14 3.2.5 Constants.................................................................................................................... 15 3.2.6 Granularity and Intensity.................................................................................................... 16 3.3 Meaning of Identifiers ........................................................................................................... 16 3.3.1 Types........................................................................................................................ 16 3.4 Expressions ............................................................................................................................... 17 3.4.1 Unary Minus Operator......................................................................................................... 17 3.4.2 Multiplicative Operators..................................................................................................... 17 3.4.3 Additive Operators........................................................................................................... 18 3.4.4 Relational Operators......................................................................................................... 18 3.4.5 Logical Negation Operator.................................................................................................... 18 3.4.6 Equality Operators........................................................................................................... 18 3.4.7 Logical AND Operator......................................................................................................... 19 3.4.8 Logical OR Operator.......................................................................................................... 19 3.4.9 Comma Operator............................................................................................................... 19 3.4.10 Selection Operator.......................................................................................................... 19 3.4.11 Mask Operator............................................................................................................... 20 3.4.12 Arrow Operator.............................................................................................................. 20 3.4.13 Canvas Attribute Accessor (read-only)....................................................................................... 21 3.4.14 Function Calls.............................................................................................................. 21 3.4.15 Include..................................................................................................................... 21 3.5 Declarations ............................................................................................................................. 21 3.5.1 Function Declarations........................................................................................................ 21 3.5.2 Variable Declarations........................................................................................................ 22 3.6 Statements ................................................................................................................................ 22 3.6.1 Assignment/Output Statements ................................................................................................ 23 3.6.2 Conditional Statement ....................................................................................................... 23 3.6.3 For Statement................................................................................................................ 23 3.6.4 Return Statement ............................................................................................................ 24 3.7 Scope and Linkage ................................................................................................................. 24 3.7.1 Lexical Scope................................................................................................................ 24 3.8 System Functions .................................................................................................................... 25 3.8.1 Blank........................................................................................................................ 25 3.8.2 Load......................................................................................................................... 25 3.8.3 Shift........................................................................................................................ 26 4 Project Plan ........................................................................................................................ 27 4.1 Project Process ........................................................................................................................ 27 4.1.1 Proposal phase............................................................................................................... 27 4.1.2 LRM phase.................................................................................................................... 27 4.1.3 Code Design and Implementation................................................................................................. 27 4.2 Programming Style Guide ...................................................................................................... 27 4.3 Project Timeline ....................................................................................................................... 28 4.4 Member Roles and Responsibilities .................................................................................