# Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321

Size: px
Start display at page:

Download "Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321"

Transcription

1 Sketchpad Graphics Language Reference Manual Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321 October 20, 2013

2 1. Introduction This manual provides reference information for using the SKL (Sketchpad Graphics Language). Sketchpad Graphics Language is a language designed for users to construct complex geometric graphics for mathematical analysis. By maintaining a specifically designed parent-children relationship between geometric objects, SKL enables users to change properties of the geometric objects without rewriting the whole graphics. This manual describes the lexical conventions, basic types scoping rules, built-in functions and grammar of SGL. 2. Lexical conventions 2.1 Comments The characters # introduce a comment. 2.2 Identifiers An identifier is a sequence of letters and digits including '_' in alphabet. The first character must be alphabetic or '_. Upper and lower case letters are considered no different. 2.3 Keywords The following identifiers are reserved for use as keywords, and may not be used otherwise: integer string float bool if else elif end for while break continue true false function return Object Line Circle Point 2.4 Constants There are several kinds of constants, as follows: Integer constants An integer constant is a sequence of digits from 0 to 9. Only decimal integer is supported in our language. It takes 64 bit and is signed. //Declaration and assignment of an Integer Integer m = 99; DEFAULT 2

3 2.4.2 Floating constants A floating constant consists of an integer part, a decimal point and a fraction part. The integer part and fraction part either consists of a sequence of digits and must have at least one digit. It is a 64-bit floating point number which is similar with double in C. Only decimal representations are allowed. # Declaration and assignment of a Float Float a = 0. ; Float b =.13; Float c = 26.40; Bool constants Bool type only includes two possible values: True and False String constants A String is a sequence of characters surrounded by double quotes ". String are mainly used as labels in our program so they are unchangeable after assignment. The only operation of String is concatenation. 2.5 Operators + - * / ~ && == >= <= > <!= = Addition Substraction Multiplication Division Not And Or Equality Greater or equal Less or equal Greater than Less than Not equal to Assignment 2.6 Punctations The following symbols are used to organize code and to specify different organizations of objects: Symbol ; {} [] (), Definition Marks the end of a statement Initializes lists Array declaration and visiting Function declaration and calling; and specifies operation priority Separates elements in an array DEFAULT 3

4 3. Object Types There are two broad classes of objects supported in SKL. 3.1 Basic types There are three basic types defined by the Sketchpad Graphics Language. Type identifiers always begin with an upper-case letter followed by a sequence of one or more legal identifier characters. The built-in types include: Point Line Circle These objects have properties and methods to modify their values Properties for Point Type Name Definition float float string integer [3] point point bool x y Label Color ParentA ParentB Visible x-coordinate of the point y-coordinate of the point name shown on the graph color shown on the graph: three channels RGB the first parent of the point the second point of the point whether the point can be seen on current graph Properties for Line Type Name Definition string integer [3] point point bool integer Label Color Start End Visible Type name shown on the graph color shown on the graph: three channels RGB the start point of the line the end point of the line whether the point can be seen on current graph 1: Segment; 2: Ray; 3: Line Properties for Circle Type Name Definition string integer [3] point point Label Color Center PointOnCircle name shown on the graph color shown on the graph: three channels RGB the center point of the circle one point on the circle DEFAULT 4

5 bool Visible whether the point can be seen on current graph 3.2 Atom types Legal atom-types are as follows: Integer: An integer constant is a sequence of digits from 0 to 9. Only decimal integer is supported in our language. It takes 64 bit and is signed. The default value of an integer is 0. Float: A floating constant consists of an integer part, a decimal point and a fraction part. The integer part and fraction part either consists of a sequence of digits and must have at least one digit. It is a 64-bit floating point number which is similar with double in C. Only decimal representations are allowed. The default value of a float is 0.0. Bool: Bool type only includes two possible values: True and False. The default value of a bool is false. String: A String is a sequence of characters surrounded by double quotes ". String are mainly used as labels in our program so they are unchangeable after assignment. The only operation of String is concatenation. String must be initialized by user before used. Array: An array is declared with bracket []. It is a contiguous region of storage for any given object types in SKL. All elements in an array are initialized with the default value o their types. 4. Expressions and Operators In this section we describe the built-in operators for SKL and define what constitutes an expression in our language. Operators are listed in order of precedence. All operators associate left to right, except for assignment, which associates right to left. 4.1 Primary expressions identifier See section constant See section ( expression ) A parenthesized expression is a primary expression whose type and value are identical to those of the unadorned expression primary-expression [ expression ] DEFAULT 5

6 A primary expression followed by an expression in square brackets is a primary expression. The intuitive meaning is index into a list primary-expression ( list of 0 or more expressions, comma separated ) A function call is a primary expression followed by parentheses containing a possibly empty, comma separated list of expressions which constitute the actual arguments to the function. 4.2 Unary operators Expressions with unary operators group right-to-left ~ expression The result of the logical negation operator ~ is a bool. It performs negation on the expression. This operator is applicable only to integers. 4.3 Multiplicative operators The multiplicative operators *, and /, all group let-to-right expression * expression The binary * operator indicates multiplication. It is valid between two integers, two floats, an integer and a float, or a Point and an integer or float. If one is an integer and the other is a float, the result is a float. If one is a Point, its x and y values are each multiplied by the other expression expression / expression The binary / operator indicates division. The same type considerations as for multiplication apply. Division by zero is not allowed. 4.4 Additive operators The additive operators + and - group left-to-right expression + expression The result is the sum of the expressions. Addition is valid between two integers, two floats, an integer and a float, or two Points. In the case of addition of an integer and a float, the result is a float. When adding two points ( x1, y1 ), ( x2, y2 ), the result is ( x1+y1, x2+y2) expression expression The result is the difference of the operands. Subtraction is defined identically to addition. 4.5 Relational operators DEFAULT 6

7 The relational operators group left-to-right expression < expression expression > expression expression <= expression expression >= expression The operators < ( less than ), > ( greater than ), <= ( less than or equal to ), >= (greater than or equal to ) all yield a bool, either true or false. The relational operators are valid for comparison between two integers, two doubles, or a float and an integer. 4.6 Equality operators expression == expression Equal to expression ~= expression Not equal to. The equality operators are valid for comparison between two integers, two floats, a float and an integer, or two Points. The result is a bool. When comparing the equality of two points, the result is true is the x and y values of the two points are identical. 4.7 Logical operators expression && expression Logical AND between two bool expressions expression expression Logical OR between two bool expressions. 4.8 Assignment operators lvalue = expression The value of the expression replaces the value of the object that the lvalue refers to. Types must match. 4.9 Conversions DEFAULT 7

8 A number of operators may, depending on their operands, cause conversion of the value o an operand from one type to another. Multiplication of an integer and a float will be a float. The rule also applies to division, addition, and subtraction. 5. Declarations 5.1 Variable declaration Each variable must be declared before used. Integer: Integer a = 10; Float: Float a = 10; Float a = 10. ; Float a =.10; Float a = 1.0; Bool: Bool a = true; String: String s = Hello! ; Array: Integer a[5] = { 1,2,3,4,5}; Integer a[100] = 0; # assign 0 to all the elements of array a. Float b[3] = {0.1, 0.2, 0.3}; Point: float x1, x2, x3, y1,y2, y3; Point A = getpoint ( x1, y1 ); Point B = getpoint ( x2, y2); Point C = getpoint ( x3, y3); Line: Line L1 = getline ( A, B ); DEFAULT 8

9 Line L2 = getline ( B, C ); Line L3 = getline ( C, A ); Circle: Circle O = getcircle ( A, B, C) ; 5.2 Function declaration The SKL language supports user-defined functions. All functions must start with the function keyword, followed by the return type and function name. A function can have any numbers of parameters, whose types and names should also be declared. Note that the parameters are passed by VALUE. Functions must be declared and implemented meanwhile, before they are called by users. function return type function name ( parameter type parameter name, ) # function declaration { # function implementation } 6. Statements Except as indicated, statements are executed in sequence. 6.1 Expression statement Most statements are expression statements, which have the form expression ; Usually expression statements are assignments or function calls. 6.2 Conditional statement The two forms of the conditional statement are if ( expression ) statement elif ( expression ) statement else statement if ( expression ) statement else statement In both cases the expression is evaluated and if it is true, the substatement is executed. 6.3 While statement The while statement has the form while ( expression ) statement The substatement is executed repeatedly so long as the value of the expression remains true. The test takes place before each execution of the statement. DEFAULT 9

10 6.4 For statement The for statement has the form for ( expression1 ; expression2; expression3 ) statement Thus the first expression specifies initialization for the loop; the second specifies a test, made before each iteration, such that the loop is exited when the expression becomes true; the third expression typically specifies an incrementation which is performed after each iteration. Any or all of the expressions may be dropped. 6.5 Break statement The statement break ; causes termination of the smallest enclosing while, or for statement; control passes to the statement following the terminated statement. 6.6 Continue statement The statement continue ; causes control to pass to the loop continuation portion of the smallest enclosing while, or for statement; that is to the end of the loop. 6.7 Return statement A function returns to its caller by means of the return statement, which has one of the forms return ; return ( expression ) ; In the first case no value is returned. In the second case, the value of the expression is returned to the caller of the function. If required, the expression is converted, as if by assignment, to the type of the function in which it appears. 7. System Functions 7.1 Arithmetic functions Float sin ( Float ): return the sin value of the parameter. Float cos ( Float ): return the cos value of the parameter. Float tan ( Float ): return the tan value of the parameter. Float exp ( Float ): return the exp value of the parameter. Float log ( Float ): return the log value of the parameter. Float sqrt ( Float ): return the square of the parameter. Integer floor ( Float ): return the greatest integer that is less than the parameter. DEFAULT 10

11 Integer ceil ( Float ): return the least integer that is greater than the parameter. Integer round ( Float ): return the integer that is closest to the parameter. 7.2 Get object functions getpoint ( float x, float y): create a new point at ( x, y ) # create three new points A, B, C float x1, x2, x3, y1,y2, y3; Point A = getpoint ( x1, y1 ); Point B = getpoint ( x2, y2); Point C = getpoint ( x3, y3); getline ( point X, point Y, integer t) : create a new line XY with type t, 1 for segment ; 2 for ray ; 3 for line # create a new segment L1, a new ray L2, a new line L3 Line L1 = getline ( A, B, 1 ); Line L2 = getline ( B, C, 2 ); Line L3 = getline ( C, A, 3 ); getcircle ( point X, point Y, point Z ) : create a new circle with three points X, Y, Z on the circle getcircle ( point Center, point X) : create a new circle with given center and point X on the circle # create a new circle O with three points A, B,C on the circle Circle O = getcircle ( A, B, C) ; # create a new circle Q with center A and point B on the circle Circle Q = getcircle ( A, B ) ; 7.3 Object operation functions delete ( object ) move ( point a, float x, float y) intersect ( line x, line y ) bisect ( point a, point b, point c) Delete an object Move the point a toward new position ( x, y) Create the intersection point of line x and line y Create the angular bisector of angel ABC DEFAULT 11

12 perpendicular ( point a, point b, point c) midpoint (line x) unhook (point a, integer index) hook (point a, integer index) Create a perpendicular line of BC through A Create the middle point of line x when it is a segment 8. Scoping Rules A scope in any programming is a region of the program where a defined variable can have its existence and beyond that variable can not be accessed. There are three places where variables can be declared in SKL: Inside a function or a block which is called local variables, Outside of all functions which is called global variables. In the definition of function parameters which is called formal parameters. 8.1 Local variables Variables that are declared inside a function or block are called local variables. They can be used only by statements that are inside that function or block of code. Local variables are not known to functions outside their own. 8.2 Global variables Global variables are defined outside of a function, usually on top of the program. The global variables will hold their value throughout the lifetime of your program and they can be accessed inside any of the functions defined for the program. A global variable can be accessed by any function. That is, a global variable is available for use throughout the entire program after its declaration. A program can have same name for local and global variables but value of local variable inside a function will take preference. 8.3 Formal parameters Function parameters, formal parameters, are treated as local variables with-in that function and they will take preference over the global variables. DEFAULT 12

### XQ: An XML Query Language Language Reference Manual

XQ: An XML Query Language Language Reference Manual Kin Ng kn2006@columbia.edu 1. Introduction XQ is a query language for XML documents. This language enables programmers to express queries in a few simple

### \n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

### egrapher Language Reference Manual

egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

### MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

### Language Reference Manual simplicity

Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna

### YOLOP Language Reference Manual

YOLOP Language Reference Manual Sasha McIntosh, Jonathan Liu & Lisa Li sam2270, jl3516 and ll2768 1. Introduction YOLOP (Your Octothorpean Language for Optical Processing) is an image manipulation language

### JME Language Reference Manual

JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

### Language Reference Manual

Programming Languages and Translators Language Reference Manual ART: Animation Rendering Tool Brett Jervey - baj2125 Gedion Metaferia - gym2103 Natan Kibret - nfk2105 Soul Joshi - srj2120 October 26, 2016

### Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

Mirage Language Reference Manual Image drawn using Mirage 1.1 Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Prof. Stephen Edwards Team Members: Abhilash I ai2160@columbia.edu

### Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

### IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

IPCoreL Programming Language Reference Manual Phillip Duane Douglas, Jr. 11/3/2010 The IPCoreL Programming Language Reference Manual provides concise information about the grammar, syntax, semantics, and

### SPARK-PL: Introduction

Alexey Solovyev Abstract All basic elements of SPARK-PL are introduced. Table of Contents 1. Introduction to SPARK-PL... 1 2. Alphabet of SPARK-PL... 3 3. Types and variables... 3 4. SPARK-PL basic commands...

### The Warhol Language Reference Manual

The Warhol Language Reference Manual Martina Atabong maa2247 Charvinia Neblett cdn2118 Samuel Nnodim son2105 Catherine Wes ciw2109 Sarina Xie sx2166 Introduction Warhol is a functional and imperative programming

### L-System Fractal Generator: Language Reference Manual

L-System Fractal Generator: Language Reference Manual Michael Eng, Jervis Muindi, Timothy Sun Contents 1 Program Definition 3 2 Lexical Conventions 3 2.1 Comments...............................................

### Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS Spoke Language Reference Manual* William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03 (yw2347, ct2459, zy2147, xc2180)@columbia.edu Columbia University,

### Learning Language. Reference Manual. George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104)

Learning Language Reference Manual 1 George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104) A. Introduction Learning Language is a programming language designed

### CHIL CSS HTML Integrated Language

CHIL CSS HTML Integrated Language Programming Languages and Translators Fall 2013 Authors: Gil Chen Zion gc2466 Ami Kumar ak3284 Annania Melaku amm2324 Isaac White iaw2105 Professor: Prof. Stephen A. Edwards

### DaMPL. Language Reference Manual. Henrique Grando

DaMPL Language Reference Manual Bernardo Abreu Felipe Rocha Henrique Grando Hugo Sousa bd2440 flt2107 hp2409 ha2398 Contents 1. Getting Started... 4 2. Syntax Notations... 4 3. Lexical Conventions... 4

### GBL Language Reference Manual

COMS W4115 PROGRAMMING LANGUAGES AND TRANSLATORS GBL Language Reference Manual Yiqing Cui(yc3121) Sihao Zhang(sz2558) Ye Cao(yc3113) Shengtong Zhang(sz2539) March 7, 2016 CONTENTS 1 Introduction 3 2 Syntax

### Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Contents 1 Introduction...2 2 Lexical Conventions...2 3 Types...3 4 Syntax...3 5 Expressions...4 6 Declarations...8 7 Statements...9

### The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

### The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

### The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau

The pixelman Language Reference Manual Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau October 2017 Contents 1 Introduction 2 2 Lexical Conventions 2 2.1 Comments..........................................

### Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

### 1 Lexical Considerations

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

### COMS W4115 Programming Languages & Translators FALL2008. Reference Manual. VideO Processing Language (VOPL) Oct.19 th, 2008

Reference Manual VideO Processing Language (VOPL) Oct.19 th, 2008 Baolin Shao bs2530 Xuyang Shi xs2137 Huning Dai ( hd2210 ) Jia Li jl3272 Table of Content 1. Introduction... 4 2. Document Convention...

### d-file Language Reference Manual

Erwin Polio Amrita Rajagopal Anton Ushakov Howie Vegter d-file Language Reference Manual COMS 4115.001 Thursday, October 20, 2005 Fall 2005 Columbia University New York, New York Note: Much of the content

### UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

UNIT - I Introduction to C Programming Introduction to C C was originally developed in the year 1970s by Dennis Ritchie at Bell Laboratories, Inc. C is a general-purpose programming language. It has been

### GeoCode Language Reference Manual

GeoCode Language Reference Manual Contents 1 Introduction... 3 2 Lexical Elements... 3 2.1 Identifiers... 3 2.2 Keywords... 3 2.3 Literals... 3 2.4 Line Structure... 4 2.5 Indentation... 4 2.6 Whitespace...

### PieNum Language Reference Manual

PieNum Language Reference Manual October 2017 Hadiah Venner (hkv2001) Hana Fusman (hbf2113) Ogochukwu Nwodoh( ocn2000) Index Introduction 1. Lexical Convention 1.1. Comments 1.2. Identifiers 1.3. Keywords

### Review of the C Programming Language for Principles of Operating Systems

Review of the C Programming Language for Principles of Operating Systems Prof. James L. Frankel Harvard University Version of 7:26 PM 4-Sep-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights

### C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

### UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . \$, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

### Sprite an animation manipulation language Language Reference Manual

Sprite an animation manipulation language Language Reference Manual Team Leader Dave Smith Team Members Dan Benamy John Morales Monica Ranadive Table of Contents A. Introduction...3 B. Lexical Conventions...3

### MR Language Reference Manual. Siyang Dai (sd2694) Jinxiong Tan (jt2649) Zhi Zhang (zz2219) Zeyang Yu (zy2156) Shuai Yuan (sy2420)

MR Language Reference Manual Siyang Dai (sd2694) Jinxiong Tan (jt2649) Zhi Zhang (zz2219) Zeyang Yu (zy2156) Shuai Yuan (sy2420) 1 MR Language Reference Manual 1. Introduction 1.1 Concept of MapReduce

### BC An Arbitrary Precision Desk-Calculator Language. Lorinda Cherry Robert Morris Bell Laboratories Murray Hill, New Jersey ABSTRACT

BC An Arbitrary Precision Desk-Calculator Language Lorinda Cherry Robert Morris Bell Laboratories Murray Hill, New Jersey 07974 ABSTRACT BC is a language and a compiler for doing arbitrary precision arithmetic

### ARG! Language Reference Manual

ARG! Language Reference Manual Ryan Eagan, Mike Goldin, River Keefer, Shivangi Saxena 1. Introduction ARG is a language to be used to make programming a less frustrating experience. It is similar to C

### BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

BoredGames Language Reference Manual A Language for Board Games Brandon Kessler (bpk2107) and Kristen Wise (kew2132) 1 Table of Contents 1. Introduction... 4 2. Lexical Conventions... 4 2.A Comments...

### Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

### COLOGO A Graph Language Reference Manual

COLOGO A Graph Language Reference Manual Advisor: Stephen A. Edwards Shen Wang (sw2613@columbia.edu) Lixing Dong (ld2505@columbia.edu) Siyuan Lu (sl3352@columbia.edu) Chao Song (cs2994@columbia.edu) Zhou

### RTL Reference 1. JVM. 2. Lexical Conventions

RTL Reference 1. JVM Record Transformation Language (RTL) runs on the JVM. Runtime support for operations on data types are all implemented in Java. This constrains the data types to be compatible to Java's

### TML Language Reference Manual

TML Language Reference Manual Jiabin Hu (jh3240) Akash Sharma (as4122) Shuai Sun (ss4088) Yan Zou (yz2437) Columbia University October 31, 2011 1 Contents 1 Introduction 4 2 Lexical Conventions 4 2.1 Character

### 2.2 Syntax Definition

42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

### WarmFusion Reference Manual

WarmFusion Reference Manual Robert Dong (rd2439) Table of Contents 1. Introduction... 2 2. Lexical Conventions... 2 2.1. Comments... 2 2.2. Identifiers... 2 2.3. Keywords... 2 2.4. Numerical Constants...

### Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional

### Angela Z: A Language that facilitate the Matrix wise operations Language Reference Manual

Angela Z: A Language that facilitate the Matrix wise operations Language Reference Manual Contents Fei Liu, Mengdi Zhang, Taikun Liu, Jiayi Yan 1. Language definition 3 1.1. Usage 3 1.2. What special feature

### Language Reference Manual

ALACS Language Reference Manual Manager: Gabriel Lopez (gal2129) Language Guru: Gabriel Kramer-Garcia (glk2110) System Architect: Candace Johnson (crj2121) Tester: Terence Jacobs (tj2316) Table of Contents

### Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All for repetition statement do while repetition statement switch multiple-selection statement break statement continue statement Logical

### Senet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz

Senet Language Reference Manual 26 th October 2015 Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz 1. Overview Past projects for Programming Languages and Translators have

### PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops

PRG PROGRAMMING ESSENTIALS 1 Lecture 2 Program flow, Conditionals, Loops https://cw.fel.cvut.cz/wiki/courses/be5b33prg/start Michal Reinštein Czech Technical University in Prague, Faculty of Electrical

### BC An Arbitrary Precision Desk-Calculator Language

Lorinda Cherry Robert Morris ABSTRACT BC is a language and a compiler for doing arbitrary precision arithmetic on the PDP-11 under the UNIX time-sharing system. The output of the compiler is interpreted

### Declaration and Memory

Declaration and Memory With the declaration int width; the compiler will set aside a 4-byte (32-bit) block of memory (see right) The compiler has a symbol table, which will have an entry such as Identifier

### SMURF Language Reference Manual Serial MUsic Represented as Functions

SMURF Language Reference Manual Serial MUsic Represented as Functions Richard Townsend, Lianne Lairmore, Lindsay Neubauer, Van Bui, Kuangya Zhai {rt2515, lel2143, lan2135, vb2363, kz2219}@columbia.edu

### Lecture 3 Tao Wang 1

Lecture 3 Tao Wang 1 Objectives In this chapter, you will learn about: Arithmetic operations Variables and declaration statements Program input using the cin object Common programming errors C++ for Engineers

### Review of the C Programming Language

Review of the C Programming Language Prof. James L. Frankel Harvard University Version of 11:55 AM 22-Apr-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reference Manual for the

### Lexical Considerations

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2010 Handout Decaf Language Tuesday, Feb 2 The project for the course is to write a compiler

### Lexical Considerations

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 6 Decaf Language Wednesday, September 7 The project for the course is to write a

### There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

### CSI33 Data Structures

Outline Department of Mathematics and Computer Science Bronx Community College October 24, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers Expressions and Operator Precedence

### Outline. Data and Operations. Data Types. Integral Types

Outline Data and Operations Data Types Arithmetic Operations Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and Operations Data and Operations

### DINO. Language Reference Manual. Author: Manu Jain

DINO Language Reference Manual Author: Manu Jain Table of Contents TABLE OF CONTENTS...2 1. INTRODUCTION...3 2. LEXICAL CONVENTIONS...3 2.1. TOKENS...3 2.2. COMMENTS...3 2.3. IDENTIFIERS...3 2.4. KEYWORDS...3

### Scheme Quick Reference

Scheme Quick Reference COSC 18 Fall 2003 This document is a quick reference guide to common features of the Scheme language. It is not intended to be a complete language reference, but it gives terse summaries

### COMS W4115 Programming Languages & Translators GIRAPHE. Language Reference Manual

COMS W4115 Programming Languages & Translators GIRAPHE Language Reference Manual Name UNI Dianya Jiang dj2459 Vince Pallone vgp2105 Minh Truong mt3077 Tongyun Wu tw2568 Yoki Yuan yy2738 1 Lexical Elements

### Introduction to TURING

Introduction to TURING Comments Some code is difficult to understand, even if you understand the language it is written in. To that end, the designers of programming languages have allowed us to comment

### Template Language and Syntax Reference

APPENDIX B This chapter describes the language and syntax conventions used in the VPN Solutions Center template implementation. Grammar and Syntax The Extensible Markup Language (XML) template definition

### CS4120/4121/5120/5121 Spring 2016 Xi Language Specification Cornell University Version of May 11, 2016

CS4120/4121/5120/5121 Spring 2016 Xi Language Specification Cornell University Version of May 11, 2016 In this course you will start by building a compiler for a language called Xi. This is an imperative,

### do fifty two: Language Reference Manual

do fifty two: Language Reference Manual Sinclair Target Jayson Ng Josephine Tirtanata Yichi Liu Yunfei Wang 1. Introduction We propose a card game language targeted not at proficient programmers but at

### DEPARTMENT OF MATHS, MJ COLLEGE

T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

### corgi Language Reference Manual COMS W4115

corgi Language Reference Manual COMS W4115 Philippe Guillaume Losembe (pvl2109) Alisha Sindhwani (as4312) Melissa O Sullivan (mko2110) Justin Zhao (jxz2101) October 27, 2014 Chapter 1: Introduction corgi

### Scheme Quick Reference

Scheme Quick Reference COSC 18 Winter 2003 February 10, 2003 1 Introduction This document is a quick reference guide to common features of the Scheme language. It is by no means intended to be a complete

### A First Look at ML. Chapter Five Modern Programming Languages, 2nd ed. 1

A First Look at ML Chapter Five Modern Programming Languages, 2nd ed. 1 ML Meta Language One of the more popular functional languages (which, admittedly, isn t saying much) Edinburgh, 1974, Robin Milner

### The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Op. Use Description + x + y adds x and y x y

### Full file at

Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional

### The Arithmetic Operators

The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Examples: Op. Use Description + x + y adds x

### Cellular Automata Language (CAL) Language Reference Manual

Cellular Automata Language (CAL) Language Reference Manual Calvin Hu, Nathan Keane, Eugene Kim {ch2880, nak2126, esk2152@columbia.edu Columbia University COMS 4115: Programming Languages and Translators

### These are reserved words of the C language. For example int, float, if, else, for, while etc.

Tokens in C Keywords These are reserved words of the C language. For example int, float, if, else, for, while etc. Identifiers An Identifier is a sequence of letters and digits, but must start with a letter.

### Built-in Types of Data

Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

### LECTURE 3 C++ Basics Part 2

LECTURE 3 C++ Basics Part 2 OVERVIEW Operators Type Conversions OPERATORS Operators are special built-in symbols that have functionality, and work on operands. Operators are actually functions that use

Visual C# 2005 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion Topics Additional Projects Additional Resources Key Terms

### DAVE. Language Reference Manual. Hyun Seung Hong. October 26, 2015

DAVE Language Reference Manual Hyun Seung Hong Min Woo Kim Fan Yang Chen Yu hh2473 mk3351 fy2207 cy2415 Contents October 26, 2015 1 Introduction 3 2 Lexical Conventions 3 2.1 Character Set 3 2.2 Comment

### VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

VENTURE COMS 4115 - Language Reference Manual Zach Adler (zpa2001), Ben Carlin (bc2620), Naina Sahrawat (ns3001), James Sands (js4597) Section 1. Lexical Elements 1.1 Identifiers An identifier in VENTURE

### BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

### GraphQuil Language Reference Manual COMS W4115

GraphQuil Language Reference Manual COMS W4115 Steven Weiner (Systems Architect), Jon Paul (Manager), John Heizelman (Language Guru), Gemma Ragozzine (Tester) Chapter 1 - Introduction Chapter 2 - Types

### Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

### Typescript on LLVM Language Reference Manual

Typescript on LLVM Language Reference Manual Ratheet Pandya UNI: rp2707 COMS 4115 H01 (CVN) 1. Introduction 2. Lexical Conventions 2.1 Tokens 2.2 Comments 2.3 Identifiers 2.4 Reserved Keywords 2.5 String

### GOLD Language Reference Manual

GOLD Language Reference Manual Language Guru: Timothy E. Chung (tec2123) System Architect: Aidan Rivera (ar3441) Manager: Zeke Reyna (eer2138) Tester: Dennis Guzman (drg2156) October 16th, 2017 1 Introduction

### Department of Computer Science

Department of Computer Science Definition An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and

### EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

EDIABAS Electronic Diagnostic Basic System BEST/2 LANGUAGE DESCRIPTION VERSION 6b Copyright BMW AG, created by Softing AG BEST2SPC.DOC CONTENTS CONTENTS...2 1. INTRODUCTION TO BEST/2...5 2. TEXT CONVENTIONS...6

### Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

Name Closed notes, book and neighbor. If you have any questions ask them. Notes: Segment of code necessary C++ statements to perform the action described not a complete program Program a complete C++ program

### Unit 3. Operators. School of Science and Technology INTRODUCTION

INTRODUCTION Operators Unit 3 In the previous units (unit 1 and 2) you have learned about the basics of computer programming, different data types, constants, keywords and basic structure of a C program.

### Operators. Java operators are classified into three categories:

Operators Operators are symbols that perform arithmetic and logical operations on operands and provide a meaningful result. Operands are data values (variables or constants) which are involved in operations.

### CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing Lecture 2-3 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 2 Problem Solving Using C++ 2 Objectives In this

### Scheme Tutorial. Introduction. The Structure of Scheme Programs. Syntax

Scheme Tutorial Introduction Scheme is an imperative language with a functional core. The functional core is based on the lambda calculus. In this chapter only the functional core and some simple I/O is

### Programming for Engineers Iteration

Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers

### SFPL Reference Manual

1 SFPL Reference Manual By: Huang-Hsu Chen (hc2237) Xiao Song Lu(xl2144) Natasha Nezhdanova(nin2001) Ling Zhu(lz2153) 2 1. Lexical Conventions 1.1 Tokens There are six classes of tokes: identifiers, keywords,

### Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions

### CHAD Language Reference Manual

CHAD Language Reference Manual INTRODUCTION The CHAD programming language is a limited purpose programming language designed to allow teachers and students to quickly code algorithms involving arrays,

### Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates