# PieNum Language Reference Manual

Size: px
Start display at page:

Transcription

1 PieNum Language Reference Manual October 2017 Hadiah Venner (hkv2001) Hana Fusman (hbf2113) Ogochukwu Nwodoh( ocn2000)

2 Index Introduction 1. Lexical Convention 1.1. Comments 1.2. Identifiers 1.3. Keywords 1.4. Literals 2. Data Types 2.1. Primitive Types Integer Boolean Float String Void 2.2. Non-Primitive Types Arrays 3. Operators 3.1. Operators for Primitive Types Assignment Operator Arithmetic Operations Precedence of Arithmetic Operators Relational Operators Equality Operators Logical Operators 3.2. Array Operations Addition Multiplication Subtraction Cross Product

3 Inversing Return the Length of the Array 4. Statements 4.1. Expression Statements 4.2. if Statement 4.3. while Statement 4.4. for Loops 4.5. return Statement 5. Methods 5.1. Method Basics 5.2. Main Method 6. Scope 6.1. Local Variables 6.2. Global Variables 7. File I/O 7.1. Reading in a File 7.2. Output Image File 8. Sample Program (For DEMO) 8.1. Image Rotation 8.2. Image Resizing 8.3. Image Contrast 8.4. Image Morphing 8.5. Image Convolution

4 Introduction Our motivation for our language is to use some elements from the NumPy library in the Python programming language to make image processing more accessible. NumPy adds support for large, multidimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. We want to create a static language that has some of the array manipulation power of NumPy. This would then allow us to write programs that involve manipulating arrays and matrices and doing complex mathematical calculations on them. Our vision is to create a function based language that will include built in functions for image processing, while also allowing the user to create his or her own functions. 1. Lexical Conventions 1.1 Comments Comments begin with a # symbol and end with a # symbol. This convention should be used for both single line and multiline comments. 1.2 Identifiers Identifiers are entities in our language such as variables, methods and data types. Valid identifier in PieNum are characters include ASCII letters and decimal digits. The first character of an identifier cannot be a digit. Identifiers cannot be the same sequence of characters as keywords. 1.3 Keywords The following identifiers are reserved and cannot be used otherwise. They are case sensitive: int return

5 float if array else void true null rotate_matrix boolean while print for string false main global 1.4 Literals PieNum literals can be integers, booleans, floats, and strings. 2. Data Types 2.1 Primitive Types Integers Int An integer is a whole value between and The default value is Boolean Boolean A single byte that can have the value true or false. The default value is false Float float A float is an integer followed a decimal part (some fractional value). The default value is String

6 String Strings are a sequence of zero or more ASCII characters, numbers, or spaces. Strings in PieNum must be enclosed in double quotation marks. The default value is the empty string is null. In PieNum, a single ASCII character is a string. Example 1: This is a string Example 2: a Void void Use the void type to signify a function that has no return value. 2.2 Non-Primitive Types Arrays array An array is a container that holds a number of values of a single type. The array size can be specified at creation, but in PieNum arrays are dynamically resizeable. For an array holding integers, the default value is 0. For an array holding strings, the default value is null. For an array holding floats, the default value is 0.0. For an array holding booleans, the default value is false. Arrays in PieNum are zero indexed. 3. Operators 3.1 Operators for Primitive Types Assignment Operator The assignment operators assign values from the right hand operand to the left side operand. Examples:

7 int x = 8; int y = 6 + 7; int z = true; Arithmetic Operations The arithmetic operators include + (addition), - (subtraction), * (multiplication), / (division) and negation. These operations are not defined for boolean. Addition : int x = 5 + 2; Subtraction : int x = 3-2; Exponent: int x = 4^3; Multiplication : int x = 1 * 2; Division : int x = 10 / 2; Negation : int x = -4; Increment and Decrement: #increment the variable i by one and then store the result in i# i++; #decrement the variable i by one and then store the result in i# i--; Precedence of Arithmetic Operations The precedence of arithmetic operations and assignment is as follows: (Highest) Assignment operator = Increment/Decrement ++/-- Parentheses for grouping of operations () Exponent ^ Multiplication operator * Division operator /

8 Addition operator + (Lowest) Subtraction or negation operator - int y = 3 * (4-7)^3 ; # y is assigned the value Relational Operators value < value value > value value <= value value >= value The operators are < (less than), >(greater than), <= (less than or equal to) and >=(greater than or equal to). The relational operators group left to right Equality Operators value == value value!= value The == (equal to) and!= (not equal to) operators evaluate the expression to determine if the two expressions are equal or not equal Logical Operators boolean_value && boolean_value boolean_value boolean_value The && (logical AND) returns true if both expressions are met and false otherwise. The (logical OR) returns true if at least one expression is true and false if no expressions are met. 3.2 Array Operations

9 The array operations include + (addition), - (subtraction), * (multiplication), ** (Cross Product), ~ (inverse). These operations are not defined for boolean Addition On two 1D arrays this creates an array with the elements of both arrays. int[] array1 = {1, 2, 3, 4}; int[] array2 = {4, 5, 7, 8}; int[] array3 = array1 + array2; #array3 contains the elements of both array1 and array2# On two matrices with the same dimensions this creates a matrix with the elements of both matrices. This throws an error if done between matrices of different dimensions. This throws an error if done between a primitive data type and array. int[] matrix1 = { {1, 2}, {3, 4 }}; int[] matrix2 = { {7, 8}, {9, 10}}; int[] matrix3 = matrix1+ matrix2; # the contents of matrix 3 are: [ 8, 10] [12, 14] # Multiplication Between an array (1D or 2D) and a non-boolean primitive data type, this multiplies all values of the matrix by the data type(scalar multiplication).. The type of the data type and the matrix data type must be the same. Between two 1D arrays this calculates the dot product. Between two matrices this performs matrix multiplication. If matrix A s width is not equal to matrix B s height, then an error is thrown. int[] matrix1 = { {1, 2}, {3, 4 }};

10 int[] matrix2 = { {7, 8}, {9, 10}}; int[] matrix3 = matrix1 * matrix2; # the contents of matrix3 are: [ 25, 28] [57, 64] # 0.5 * matrix3; #The above is an invalid operation, matrix of int cannot be multiplied by float value# matrix3 =* 2; #multiplies all values of matrix3 by 2# int[] array1 = {1, 2, 3, 4}; int[] array2 = {4, 5, 7, 8}; # the value of x is 67 # int x = array1 * array2; Subtraction On two 1D arrays this creates an array with the elements of the matrix on the left hand side of the operator minus the elements on the right hand side of the operator. This throws an error if done between two matrices. int[] matrix1 = { {1, 2}, {3, 4 }}; int[] matrix2 = { {7, 8}, {9, 10}}; int[] matrix3 = matrix1 - matrix2; # the contents of matrix 3 are: [ -6, -6] [-6, -6] # Cross Product Between two 1D arrays of the same dimensions this calculates the cross product. This throws an error if done between two matrices or 1D arrays that don t have the same dimensions. int[] matrix1 = {2,3,4}; Int[] matrix2 = {5,6,7};

11 Int[] cross_product = matrix1 ** matrix2 #the content of cross_product [-3,6,-3] Inversing Creates a matrix that is the inverse of the original matrix by multiplying it by its identity matrix. Throws an error if done on a primitive data type, 1D array, or matrix that is not square. If a matrix is composed of int values and inverting yields floating point values, the floating point component of the number will be thrown out. int[] matrix1 = { {1, 2}, {3, 4}}; int [] inverse = ~matrix1; #the content of inverse is [-2, 1] [1, 0] # Return the length of the array This returns the length of a one-dimensional array. int[] array = [2,3,4]; #size = 3# int size = array.length() 4. Statements 4.1 Expression Statements Expression statements are in the form: statement ; Usually expression statements are assignments or function calls. int value; int value = 14;

12 4.2 if statement The two forms of conditional statements are: 1. if(expression) {statement} 2. if (expression) {statement1} else {statement2} The expression is evaluated in both cases and if it is true then the first statement is executed, if it evaluates to false statement2 is executed. 4.3 while statement The while statement has the form: while (expression) {statement} The statement is executed repeatedly as long as the expression evaluates to true. 4.4 for loops The for loop has the form: for(int i = j; i < k; i++){ } statements; The statement is executed repeatedly as long as the condition is still in the range. 4.5 return statement The return statement has the form: 1. return null; 2. return (expression); In the first case nothing is returned to the caller of the function, in the second case the expression is returned.

13 5. Methods 5.1 Method Basics A method is a program procedure that is defined as part of a class. It is collection of statements that are grouped together to perform an operation. A void method returns nothing when called. If the void keyword is not present in the method declaration then the method must return another datatype. A method may or may not take in parameters. The data type of the parameters must be declared. There is no method overloading in this language. An example of a method declaration: datatype methodname(datatype param1 ) { #group of statements that do something# return datatype; } #this method does not take in any parameters or return anything# void methodname(){ #group of statements that do something# } 5.2 Main Method The main method is a method that calls other methods in other files or the methods in the same file it is defined in. There can only be one main method in a file. The parameters for the main method is always a String array called args. This String array are command line arguments that are space separated. The main method always returns void. Main method declaration: void main(string[] args)

14 { } # do something # 6. Scope Scope refers to the lifetime and accessibility of a variable. The scope of the variable depends on where it is declared. 6.1 Local Variables Local variables are those declared within designated brackets within a method, conditional statements, etc. Local variables can only be used within the method they are defined in. The variable is created when the method is entered or conditional begins and are garbage-collected once the method is exited or conditional ends. int dostuff(int a) { # a and i only exists within this method and once the method returns a is garbage collected # } int i = 0; while(i < 100) { int b = a+2; a = a+b; i++; # b only exists within this loop, once the loop exists, b is garbage collected# } return a; 6.2 Global Variables Global variables are declared outside of all functions, and therefore they are available to be used throughout the

15 entire program. Global variables are declared with the keyword global. #a is a global variable# global int a = 2; if (expression) { a = a + 3; } 7. File I/O Since this is a matrix-oriented language file I/O will be be for reading in files in portable pixmap format (PPM) and outputting files in portable pixmap format. 7.1 Reading in a File The readimage function takes in a String of a PPM file and outputs a matrix corresponding to the matrix of the image. int[][] matrix = readimage( image.ppm ); 7.2 Output Image File The postimage function takes in a matrix and outputs a PPM file corresponding to that matrix of the given name. The file will be outputted in the current directory of the program. postimage(int[][] matrix, outputfile.ppm );

16 8. Sample Program (For DEMO) 8.1 Image Rotation In PieNum, the image rotation function rotates a matrix around the X-axis by a specified angle. This is generally used for image rotation. # -1 rotates the image counterclockwise 90 degrees and 1 rotates the image clockwise 90 degrees. This returns a new rotated matrix# int rotate_matrix(int[][] matrix, -1 ); int rotate_matrix(int[][] matrix, 1 ); 8.2 Image Resizing In PieNum, the resize matrix function takes in two parameters, the first parameter is the size and name of the original matrix, and the second parameter is the new size of the matrix. It returns the newly resized matrix. #This resize function takes a 4 by 4 matrix and resizes it to a 2 by 1 matrix# int resize_matrix(int[4][4] matrix, int [2][1] new_size ); 8.3 Image Contrast Image contrasting in PieNum, offset the r, g, and b components of colors in an image to contrast the color of the image.

17 image_contrast(offset_r, offset_g, offset_b); 8.4 Image Morphing A Transformation is a function that maps one set to another set after performing some operations.the startpicture parameter is the original image, the endpicture parameter is the image the picture is blended with, and the degreeofmorphing parameter is the degree the morphing is done to. degreeofmorphing is a float ranging from 0.0 to 1.0. image_morph(int[][] startpicture, int[][] endpicture, float degreeofmorphing); 8.5 Image Convolution The image convolution method(image_convolute) takes in the original image as a matrix and a 3 X 3 matrix which represents a kernel. The kernel is then applied to each pixel to produce different effects like Gaussian blurring, image sharpening and edge detection(each effect requires a unique kernel). image_convolute(int[][] kernel, int[][] original_image);

### 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

### 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..........................................

### 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

### MATLIP: MATLAB-Like Language for Image Processing

COMS W4115: Programming Languages and Translators MATLIP: MATLAB-Like Language for Image Processing Language Reference Manual Pin-Chin Huang (ph2249@columbia.edu) Shariar Zaber Kazi (szk2103@columbia.edu)

### 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

### 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

### Java+- Language Reference Manual

Fall 2016 COMS4115 Programming Languages & Translators Java+- Language Reference Manual Authors Ashley Daguanno (ad3079) - Manager Anna Wen (aw2802) - Tester Tin Nilar Hlaing (th2520) - Systems Architect

### Photogram. Programmable Photoshop Language Language Reference Manual. ( ), Group Leader. (

Photogram Programmable Photoshop Language Language Reference Manual Ohan Oda Neesha Subramaniam Richard Ng Seikwon Kim ( oo2116@columbia.edu ), Group Leader ( ns2295@columbia.edu ) ( rjn2003@columbia.edu

### 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

### GridLang: Grid Based Game Development Language Language Reference Manual. Programming Language and Translators - Spring 2017 Prof.

GridLang: Grid Based Game Development Language Language Reference Manual Programming Language and Translators - Spring 2017 Prof. Stephen Edwards Akshay Nagpal Dhruv Shekhawat Parth Panchmatia Sagar Damani

### 3. Java - Language Constructs I

Educational Objectives 3. Java - Language Constructs I Names and Identifiers, Variables, Assignments, Constants, Datatypes, Operations, Evaluation of Expressions, Type Conversions You know the basic blocks

### Program Fundamentals

Program Fundamentals /* HelloWorld.java * The classic Hello, world! program */ class HelloWorld { public static void main (String[ ] args) { System.out.println( Hello, world! ); } } /* HelloWorld.java

### \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

### 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.

### JAVA OPERATORS GENERAL

JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

### 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

### 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

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

Sketchpad Graphics Language Reference Manual Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321 October 20, 2013 1. Introduction This manual provides reference information for using the SKL (Sketchpad

### CMAT Language - Language Reference Manual COMS 4115

CMAT Language - Language Reference Manual COMS 4115 Language Guru: Michael Berkowitz (meb2235) Project Manager: Frank Cabada (fc2452) System Architect: Marissa Ojeda (mgo2111) Tester: Daniel Rojas (dhr2119)

### 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

### 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

### 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...

### 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

### 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.

### SIPL: Simple Image Processing Language

2017 Fall COMS 4115 PLT Language Reference Manual SIPL: Simple Image Processing Language Simon Zhai, Ci Chen, Shanshan Zhang, Yihan Zhao, Yuedong Wang {yz3116, cc4192, sz2648, yz2996, yw2931}@columbia.edu

### Chapter 3: Operators, Expressions and Type Conversion

101 Chapter 3 Operators, Expressions and Type Conversion Chapter 3: Operators, Expressions and Type Conversion Objectives To use basic arithmetic operators. To use increment and decrement operators. To

### Decaf Language Reference Manual

Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

### 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

### 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

### 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

### 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

### 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...

### CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

CS5000: Foundations of Programming Mingon Kang, PhD Computer Science, Kennesaw State University Overview of Source Code Components Comments Library declaration Classes Functions Variables Comments Can

### CMPT 125: Lecture 3 Data and Expressions

CMPT 125: Lecture 3 Data and Expressions Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University January 3, 2009 1 Character Strings A character string is an object in Java,

### 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

### Twister: Language Reference Manual

Twister: Language Reference Manual Manager: Anand Sundaram (as5209) Language Guru: Arushi Gupta (ag3309) System Architect: Annalise Mariottini (aim2120) Tester: Chuan Tian (ct2698) February 23, 2017 Contents

### Chapter 2: Using Data

Chapter 2: Using Data TRUE/FALSE 1. A variable can hold more than one value at a time. F PTS: 1 REF: 52 2. The legal integer values are -2 31 through 2 31-1. These are the highest and lowest values that

### easel LANGUAGE REFERENCE MANUAL

easel LANGUAGE REFERENCE MANUAL Manager Danielle Crosswell dac2182 Language Guru Tyrus Cukavac thc2125 System Architect Yuan-Chao Chou yc3211 Tester Xiaofei Chen xc2364 Table of Contents 1. Introduction...

### Language Reference Manual

TAPE: A File Handling Language Language Reference Manual Tianhua Fang (tf2377) Alexander Sato (as4628) Priscilla Wang (pyw2102) Edwin Chan (cc3919) Programming Languages and Translators COMSW 4115 Fall

### Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

### 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

### 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

### JAVA Programming Fundamentals

Chapter 4 JAVA Programming Fundamentals By: Deepak Bhinde PGT Comp.Sc. JAVA character set Character set is a set of valid characters that a language can recognize. It may be any letter, digit or any symbol

### 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

Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

### Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

### 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

### Crayon (.cry) Language Reference Manual. Naman Agrawal (na2603) Vaidehi Dalmia (vd2302) Ganesh Ravichandran (gr2483) David Smart (ds3361)

Crayon (.cry) Language Reference Manual Naman Agrawal (na2603) Vaidehi Dalmia (vd2302) Ganesh Ravichandran (gr2483) David Smart (ds3361) 1 Lexical Elements 1.1 Identifiers Identifiers are strings used

### 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

### 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

### Java Primer 1: Types, Classes and Operators

Java Primer 1 3/18/14 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Java Primer 1: Types,

### 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

### Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Basic Operators Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

### 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

### 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

### VLC : Language Reference Manual

VLC : Language Reference Manual Table Of Contents 1. Introduction 2. Types and Declarations 2a. Primitives 2b. Non-primitives - Strings - Arrays 3. Lexical conventions 3a. Whitespace 3b. Comments 3c. Identifiers

### 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.

### Loops and Expression Types

Software and Programming I Loops and Expression Types Roman Kontchakov / Carsten Fuhs Birkbeck, University of London Outline The while, for and do Loops Sections 4.1, 4.3 and 4.4 Variable Scope Section

### CA4003 Compiler Construction Assignment Language Definition

CA4003 Compiler Construction Assignment Language Definition David Sinclair 2017-2018 1 Overview The language is not case sensitive. A nonterminal, X, is represented by enclosing it in angle brackets, e.g.

### 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

### Object-Oriented Programming

Object-Oriented Programming Java Syntax Program Structure Variables and basic data types. Industry standard naming conventions. Java syntax and coding conventions If Then Else Case statements Looping (for,

### Chapter 12 Variables and Operators

Chapter 12 Variables and Operators Highlights (1) r. height width operator area = 3.14 * r *r + width * height literal/constant variable expression (assignment) statement 12-2 Highlights (2) r. height

### 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

### Fundamental of Programming (C)

Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

### FRAC: Language Reference Manual

FRAC: Language Reference Manual Justin Chiang jc4127 Kunal Kamath kak2211 Calvin Li ctl2124 Anne Zhang az2350 1. Introduction FRAC is a domain-specific programming language that enables the programmer

### 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...............................................

### 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

### Zheng-Liang Lu Java Programming 45 / 79

1 class Lecture2 { 2 3 "Elementray Programming" 4 5 } 6 7 / References 8 [1] Ch. 2 in YDL 9 [2] Ch. 2 and 3 in Sharan 10 [3] Ch. 2 in HS 11 / Zheng-Liang Lu Java Programming 45 / 79 Example Given a radius

### PIXL. Maxwell Hu (mh3289) Justin Borczuk (jnb2135) Marco Starger (mes2312) Shiv Sakhuja (ss4757)

PIXL Maxwell Hu (mh3289) Justin Borczuk (jnb2135) Marco Starger (mes2312) Shiv Sakhuja (ss4757) Description Point processing is the enhancement or modification of an image through individual pixel manipulation.

### Variables and Operators 2/20/01 Lecture #

Variables and Operators 2/20/01 Lecture #6 16.070 Variables, their characteristics and their uses Operators, their characteristics and their uses Fesq, 2/20/01 1 16.070 Variables Variables enable you to

### 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

### Full file at

Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

### Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

Data and Variables Data Types Expressions Operators Precedence String Concatenation Variables Declaration Assignment Shorthand operators Review class All code in a java file is written in a class public

### 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

### Java Programming Fundamentals. Visit for more.

Chapter 4: Java Programming Fundamentals Informatics Practices Class XI (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra, PGT (Comp.Sc.)

### 3. Java - Language Constructs I

Names and Identifiers A program (that is, a class) needs a name public class SudokuSolver {... 3. Java - Language Constructs I Names and Identifiers, Variables, Assignments, Constants, Datatypes, Operations,

### 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

### Basics of Java Programming

Basics of Java Programming Lecture 2 COP 3252 Summer 2017 May 16, 2017 Components of a Java Program statements - A statement is some action or sequence of actions, given as a command in code. A statement

### BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

### Operators and Expressions

Operators and Expressions Conversions. Widening and Narrowing Primitive Conversions Widening and Narrowing Reference Conversions Conversions up the type hierarchy are called widening reference conversions

### 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

### Petros: A Multi-purpose Text File Manipulation Language

Petros: A Multi-purpose Text File Manipulation Language Language Reference Manual Joseph Sherrick js2778@columbia.edu June 20, 2008 Table of Contents 1 Introduction...................................................

### Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Object oriented programming Instructor: Masoud Asghari Web page: http://www.masses.ir/lectures/oops2017sut Ch: 3 1 In this slide We follow: https://docs.oracle.com/javase/tutorial/index.html Trail: Learning

### A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g.

1.3a Expressions Expressions An Expression is a sequence of operands and operators that reduces to a single value. An operator is a syntactical token that requires an action be taken An operand is an object

### 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

### Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify

### Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

Introduction Operators are the symbols which operates on value or a variable. It tells the compiler to perform certain mathematical or logical manipulations. Can be of following categories: Unary requires

### Values and Variables 1 / 30

Values and Variables 1 / 30 Values 2 / 30 Computing Computing is any purposeful activity that marries the representation of some dynamic domain with the representation of some dynamic machine that provides

### Java Notes. 10th ICSE. Saravanan Ganesh

Java Notes 10th ICSE Saravanan Ganesh 13 Java Character Set Character set is a set of valid characters that a language can recognise A character represents any letter, digit or any other sign Java uses

### COMP Primitive and Class Types. Yi Hong May 14, 2015

COMP 110-001 Primitive and Class Types Yi Hong May 14, 2015 Review What are the two major parts of an object? What is the relationship between class and object? Design a simple class for Student How to

### Mr. Monroe s Guide to Mastering Java Syntax

Mr. Monroe s Guide to Mastering Java Syntax Getting Started with Java 1. Download and install the official JDK (Java Development Kit). 2. Download an IDE (Integrated Development Environment), like BlueJ.

### 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

### ASML Language Reference Manual

ASML Language Reference Manual Tim Favorite (tuf1) & Frank Smith (fas2114) - Team SoundHammer Columbia University COMS W4115 - Programming Languages & Translators 1. Introduction The purpose of Atomic

### 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

### Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types and

CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting