This preview shows page 1-2-3-4-5-6-7-8-9-10-11-79-80-81-82-83-84-85-86-87-88-89-90-159-160-161-162-163-164-165-166-167-168-169 out of 169 pages.
Columbia UniversityProgramming Languages and TranslatorsSpring 2007Professor EdwardsSLAWscript Final ReportSteve HendersonLevi ListerAbe SkolnikWei TengSLAWscript Final Report Page 2 of 169Table of ContentsSection Starting Page NumberSection 1: Introduction................................................................................................51.1 Executive Summary..............................................................................................61.2 Introduction...........................................................................................................61.3 Key Features.........................................................................................................61.4 Representative program........................................................................................71.5 Examples of Syntax..............................................................................................71.6 Relevant Terminology...........................................................................................7Section 2: Language Tutorial......................................................................................82.1 Getting Started .....................................................................................................92.2 Using Variables ....................................................................................................92.4 Control Flow.......................................................................................................103.1 Introduction.........................................................................................................123.1.1 Hello World.....................................................................................................................123.2 Lexical Conventions...........................................................................................123.2.1 Comments.......................................................................................................................123.2.2 Constants.........................................................................................................................123.2.3 Identifiers.........................................................................................................................123.2.4 Keywords........................................................................................................................133.2.5 Numeric Literals..............................................................................................................133.2.6 String Literals..................................................................................................................133.2.7 White Space.....................................................................................................................133.3 Subroutines.........................................................................................................143.3.1 Subroutine Scope (summarily: static).............................................................................143.3.2 Procedures.......................................................................................................................143.3.3 Functions.........................................................................................................................143.4 Variables..............................................................................................................153.4.1 Data Types.......................................................................................................................153.4.2 Assignment......................................................................................................................153.4.3 Variable Scope (summarily: dynamic)............................................................................153.4.4 Randomization................................................................................................................163.5 Operators.............................................................................................................163.5.1 Unary Operators..............................................................................................................163.5.2 Binary and Tertiary Operators.........................................................................................173.5.3 Operator Precedence.......................................................................................................173.5.4 Operator Chaining...........................................................................................................183.6 Auto-conversion..................................................................................................183.6.1 Unary Operator Auto-conversion....................................................................................183.6.2 Binary Operator Auto-conversion...................................................................................193.6.3 Boolean Context..............................................................................................................203.6.4 Integer Context................................................................................................................20SLAWscript Final Report Page 3 of 1693.7 Conditionals........................................................................................................203.8 Loops..................................................................................................................213.8.1 “repeat … times” Loops..................................................................................................213.8.2 “repeat with” Loops........................................................................................................213.8.2.1 Note on “repeat with” Precision...................................................................................223.8.3 “while” Loops.................................................................................................................223.9 Input and Output.................................................................................................233.9.1 Input................................................................................................................................233.9.2
View Full Document