# CMAT Language - Language Reference Manual COMS 4115

Size: px
Start display at page:

Download "CMAT Language - Language Reference Manual COMS 4115"

Transcription

1 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 1. Introduction 2 2. Types Basic Data Types 2 3. Lexical Conventions Identifiers Keywords Constants Comments Operators Precedence 5 4. Syntax Notation Expressions Primary Expressions Postfix and Prefix Expressions Matrix References Function Calls Declarations Type Specifiers Matrix Declarations Function Declarations Initialization int double bool string matrix Statements Expression Statement Compound Statement Selection Statement Iteration Statement Standard Library Functions Math Vectors Matrix I/O Semantics Examples References 13

2 1. Introduction Welcome to the CMAT language reference manual! Our team s shared interest in mathematics led us to decide on creating a language centered around matrix manipulation. Matrices are widely used throughout math, computer science, and physics to represent data and mathematical equations. CMAT aims to make matrix manipulations and other such linear algebra operations easier for applications. CMAT is inspired by C and MATLAB, taking the best parts of both to produce a language with high versatility. Ideally, we want to allow easy, efficient computation and matrix operations without sacrificing the structure of a full programming language. Some other potential applications of our language include finding eigenvalues and eigenvectors, finding the inverse of a matrix, performing linear transformations on vectors, and solving numerical methods. 2. Types 2.1 Basic Data Types Name int Primitive Data Types Description Integers are 4 bytes. bool True and False, 1 and 0. double null 64-bit floating point number Absence of data Supported Data Types Name String T [int i[, int j]] Description A series of unsigned bytes where each byte refers to a character in the ASCII table. This can declare a vector or a matrix consisting of elements of data type T. If only i is given, it is an i-dimensional vector. If j is also given, it is an i by j matrix.

3 3. Lexical Conventions 3.1 Identifiers Identifiers can be created with any uppercase or lowercase letter and can then be followed by any arrangement of uppercase or lowercase letters, numbers and underscores. 3.2 Keywords The following identifiers are reserved for the use as keywords and may not be used otherwise: Basic Keywords Name for while if else elseif break main return void const Description Iteration until condition not met Loops until condition is not met Dynamic if accepts 1/0/True/False/null Paired with an if statement Paired with an if statement. Dynamic elseif accepts 1/0/True/False/null Will break out of the closest enclosing for or while loop First function executed in a program Returns a value of a function Nonexistent value. Used as a data type for functions that do not return anything. Denotes a constant identifier true 1 false 0

4 3.3 Constants A constant is declared by using the const keyword. A constant follows the same convention as all identifiers, but every character is capitalized. 3.4 Comments /* */ Block comments // Single line comments 3.5 Operators Name Operators Description = Assignment operator +, -, *, / Arithmetic operators ++ Increment operator -- Decrement operator > Greater than operator < Less than operator >= Greater than or equal to operator <= Less than or equal to operator == Returns 1 if values are equal, else returns 0!= Returns 0 if values are equal, else returns 1 && Logical AND operator Logical OR operator! Logical NOT operator

5 Matrix Operators Name Description +, -, * Matrix arithmetic operations and scalar arithmetic operations [x:y:z] [x] [x,:] [:,y] [x,y] Initialize a 1-by-n matrix from x to z with a delimiter of y Access specific element in vector Access specific row of 2D matrix Access specific column of 2D matrix Access specific element in 2D matrix <,<=,>,>= If 2 matrices have the same dimensions, these operators compare element by element 3.6 Precedence Operators Precedence! Highest *, / +, - <, >, <=, >= ==,!= && = Lowest 4. Syntax Notation 4.1 Expressions Primary Expressions Primary Expressions are the most basic expressions which make up more

6 complex expressions. These include identifiers, constants, strings, or expressions in parentheses Postfix and Prefix Expressions Postfix Expressions in CMAT include the following: expression[expression] expression(parameter-list) expression.identifier expression++ expression-- Prefix Expressions include: ++expression --expression Matrix References Matrix elements are referenced through postfix expressions of the form: expression[expression] where the first expression is the identifier of an initialized matrix. In the case of a 1-dimensional matrix, the expression in brackets is simply an integer value. For a 2-dimensional matrix, the expression in brackets is a pair of comma separated values. The values can either be two integers or an integer and a colon (reference matrix operators in 3.4). Additionally, a matrix can be referenced by its identifier if it is part of a proper matrix expression. In other words, it is preceded or followed by one of the matrix operators Function Calls Function calls are postfix expressions of the form: expression(parameter-list) where expression is an existing function identifier and the optional parameter-list consists of comma-separated expressions that are passed as the function parameters.

7 4.2 Declarations Type Specifiers Type specifiers: void String String identifier; //declaration of a string Int int identifier; //declaration of an int double double identifier; //declaration of a double Matrix Declarations T [int i[, int j]] name Define a vector/matrix by stating datatype brackets and name. Inside brackets can be one number for a vector, or two numbers for a matrix. A matrix declaration follows the format seen above. This format can define a vector (1D array) or a matrix (2D array). In order to declare a matrix, we first state the primitive data type that will make up the vector/matrix. Then we have brackets with either one number inside or two numbers inside separated by a comma. If only one number is stated then a vector is created with a length of the number. If two numbers are stated then a matrix is created with the following size number by number matrix. The numbers in this declaration must be positive. The vector/matrix created is initialized to 0. Then, we specify the name of the vector/matrix which must start with a letter character followed by any number of characters including _ Function Declarations T name (T arg,...) { statements } Define a function by stating return type, name of function, and arguments in parenthesis. Braces are followed with statements inside.

8 To declare a function, we define the return type by stating the data type. Then, we specify the name which must start with a letter character followed by any number of characters including _. After, in parentheses are formal arguments, if any. Formal arguments are stated by writing the data type of the argument and the identifier. Multiple arguments are separated by commas. Then, braces are written in with statements in between the braces. 4.3 Initialization When an object is declared, the declaration may include an initial value. This declaration has = with an initial value following it for the object. If a declaration does not include an initial value, the object (not a matrix) is initialized to null. If a vector/matrix is declared without an initial value, the vector/matrix is initialized as a zero vector/matrix. The following subsections explain how to initialize an object during and after a declaration int During a declaration, a = with an initial integer value follows the declaration. After a declaration, the identifier used to declare the int will have a = with an initial integer value following the identifier double During a declaration, a = with an initial integer value or floating-point number follows the declaration. After a declaration, the identifier used to declare the double will have a = with an initial integer value or floating-point number following the identifier bool During a declaration, a = with an True or False follows the declaration. After a declaration, the identifier used to declare the bool will have a = with an initial True or False following the identifier string During a declaration, a = with any character in the ASCII table follows the declaration. After a declaration, the identifier used to declare the string will have a = with any character in the ASCII table following the identifier matrix A declaration is followed by a = with brackets specifying the elements in the matrix. If the matrix is one dimensional, then the elements can be stated with commas or a space separating them in a bracket. The number of elements in the initialization must equal the size of the 1D matrix (vector). If the matrix is 2D then the elements for each row are specified with commas or spaces

9 separating. Rows are separated by a semicolon. These elements must also be in brackets like the following: matrix1 = [ ]; //1D matrix (vector) matrix2 = [ ; ]; //2D matrix (size 2x4) 4.4 Statements Expression Statement Expression statements consist of standalone expressions which are executed before continuing to the next statement. An expression statement in CMAT is of the form: expression; These are usually assignments or function calls. Expression statements may be empty if represented only by a semicolon Compound Statement A compound statement (also known as a block ) consists of several statements that can be used where a single statement is expected. For example, the body of a function definition is a compound statement. Compound statements are of the form: { declaration-list statement-list } declaration-list and statement-list are both optional meaning that it is possible to have an empty compound statement. Variables declared within compound statements do not live outside of that block Selection Statement A selection statement chooses a specific flow to follow based on whether a condition is met or not. In CMAT, selection statements include if and else statements in the following forms: if (expression) statement if (expression) statement else statement expression must be of bool or arithmetic type so that the program can evaluate whether a condition is met or not. The if statement is executed when expression does not evaluate to false, null, or 0. Otherwise, the statement within else is

10 executed. An else cannot stand by itself and when used, it is paired with the last Encountered else-less if at the same block nesting level Iteration Statement Iteration statements are meant for looping in the following forms: while (expression) statement for (expression; expression; expression) statement For while loops, statement is executed as long as expression meets the same conditions required for an if statement to be executed. For for loops, the three expressions within the parentheses specify at the very beginning the number of iterations that the loop will iterate over. The first expression initializes a value of any type. The second expression is evaluated in the same manner as an if condition. The statement will continue to be executed as long as this condition is met (similar to a while loop). The third expression is evaluated after the current iteration is executed in order to re-initialize the loop. 5. Standard Library Functions 5.1 Math double PI, double EUL Numerical values of π = e = double sqrt(int double x) Returns the square root of the int or double x double nroot(int double x, int n) Returns the nth root of int or double x double pow(int double x, int n) Returns x n as a double double cos(double x) double sin(double x) Returns cosine of double x (in radians) as a double Returns sine of double x (in radians) as a double

11 5.2 Vectors A vector, in CMAT, is simply a 1-dimensional matrix. Vectors are treated as row vectors. int size(t [i] x) double norm(t [i] x) double dot(t [i] x, T [i] y) T [j] roots(t [i] x) Returns the dimension of vector x as an int Returns the normal Euclidean length of vector x (square root of the sum of the components squared) as a double Returns the dot product of two same-dimensional vectors x and y For a vector x representing a polynomial f(x) = c x n n + c x n 1 n c 1 x + c 0 as x = [ c n, c n 1,..., c 1, c 0 ], return a vector of the roots of f(x) 5.3 Matrix T typeof(t [i,j] A) double det(t [n,n] A) T [n,n] identity(int n) T [j,i] transpose(t [i,j] A) T [n,n] inverse(t [n,n] A) T [n] eigenvalues(t [n,n] A) Returns the data type that matrix A holds Returns the determinant of square matrix A Returns the n by n identity matrix For an i by j matrix, returns the transpose a j by i matrix If it exists, returns the inverse of a square matrix A Else, return null Returns the eigenvalues of a square n by n matrix A in an n-dimensional vector T [n,n] eigenvectors(t [n,n] A) Returns the eigenvectors of a square n by n matrix A in an n by n matrix with each row corresponding to an

12 eigenvector 5.4 I/O void print_line(string s) String get_line() String itos(int i) String dtos(double d) String btos(bool b) double itod(int i) int dtoi(double d) Prints string s to stdout and then prints a newline Gets a \n -terminated String from stdin Returns the int i as a String Returns the double d as a String Returns the bool b as either true or false Returns the int i cast to a double (e.g. int 1 double 1.0 Returns the double d cast to an int by truncating the fractional part (e.g. double 1.8 int 1) 6. Semantics In CMAT, every statement must end with a semicolon ;. Code blocks in control flow statements (if, else, elseif, for, while) must always be enclosed in braces. Braces provide more visual understanding of scope. The program begins with a main function in a file. The main function must always have a return type int. The main function calls other functions defined which in turn may call other functions or files. When a function is called the number actuals must match the number of formal arguments in the function declaration. If a function has a return type, the end of the function must return type specified in the function declaration. If a return object from a function is being stored in a variable, the variable type must match the type of the return object from the function. 7. Examples int main() { print_line( 2D Rotation ); int [2] x1, int [2] x2; // Declares 2 2D vectors int [2,2] rot = [0, -1; 1, 0]; // Declares and initializes a

13 } // 2x2 rotation matrix for // theta = 90 x1 = [1/sqrt(2),1/sqrt(2)]; // Initializes x1 to be unit // vector in direction of // theta = 45 x1 = 2*x1; // Multiply x1 by 2 x2 = rot*x1; // Initialize x2 to be 2*x1 // rotated by 90. Should be // x2 = [-2/sqrt(2),2/sqrt(2)] return 0; T [j,i] transpose(t [i,j] M) { typeof(m) [j,i] tr; } int ii, jj; for(ii=0; ii < i; ii++) { for(jj=0; jj < j; jj++) { tr[jj, ii] = M[ii, jj]; } } return tr; // Create a j by i matrix // to hold the transpose // Set every element // tr[j,i] to M[i,j] 8. References Kernighan, Brian W., and Dennis M. Ritchie. "Appendix A - Reference Manual." The C Programming Language. Englewood Cliffs, NJ: Prentice Hall, N. pag. Print.

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

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

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

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

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

### C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 1 (Minor modifications by the instructor) References C for Python Programmers, by Carl Burch, 2011. http://www.toves.org/books/cpy/ The C Programming Language. 2nd ed., Kernighan, Brian,

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

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

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

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

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

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

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

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

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

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

### Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

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

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

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

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

### Chapter 2: Basic Elements of C++

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

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

Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

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

### SSOL Language Reference Manual

SSOL Language Reference Manual Madeleine Tipp Jeevan Farias Daniel Mesko mrt2148 jtf2126 dpm2153 Manager Language Guru System Architect October 15, 2018 Contents 1 Lexical Conventions 2 1.1 Identifiers...............................................

CS6202 - PROGRAMMING & DATA STRUCTURES UNIT I Part - A 1. W hat are Keywords? Keywords are certain reserved words that have standard and pre-defined meaning in C. These keywords can be used only for their

### Objectives. In this chapter, you will:

Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates arithmetic expressions Learn about

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

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

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

### SMPL - A Simplified Modeling Language for Mathematical Programming

SMPL - A Simplified Modeling Language for Mathematical Programming Mihály Csaba Markót November 3, 2008 1 Purpose and Scope This working paper describes SMPL, an initiative of a Simplified Modeling Language

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

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

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

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

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

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

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

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

### Programming with Java

Programming with Java Data Types & Input Statement Lecture 04 First stage Software Engineering Dep. Saman M. Omer 2017-2018 Objectives q By the end of this lecture you should be able to : ü Know rules

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

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

### LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

LESSON 1 FUNDAMENTALS OF C The purpose of this lesson is to explain the fundamental elements of the C programming language. C like other languages has all alphabet and rules for putting together words

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

### 12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Java How to Program, 9/e Education, Inc. All Rights Reserved. } Java application programming } Use tools from the JDK to compile and run programs. } Videos at www.deitel.com/books/jhtp9/ Help you get started

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

### OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

1 LECTURE 3 OUTLINES Variable names in MATLAB Examples Matrices, Vectors and Scalar Scalar Vectors Entering a vector Colon operator ( : ) Mathematical operations on vectors examples 2 VARIABLE NAMES IN

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

### JVM (java) compiler. A Java program is either a library of static methods (functions) or a data type definition

Programming Model Basic Structure of a Java Program The Java workflow editor (Code) P.java compiler (javac) P.class JVM (java) output A Java program is either a library of static methods (functions) or

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

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

### c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords.

Chapter 1 File Extensions: Source code (cpp), Object code (obj), and Executable code (exe). Preprocessor processes directives and produces modified source Compiler takes modified source and produces object

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

Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine

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

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

### Primitive Data Types: Intro

Primitive Data Types: Intro Primitive data types represent single values and are built into a language Java primitive numeric data types: 1. Integral types (a) byte (b) int (c) short (d) long 2. Real types

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

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

### Fundamentals of Programming

Fundamentals of Programming Lecture 3 - Constants, Variables, Data Types, And Operations Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad Outline C Program Data types Variables

### Lecture 2 Tao Wang 1

Lecture 2 Tao Wang 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common programming errors

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

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

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

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

### Chapter 2 Basic Elements of C++

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

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

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

### Key Differences Between Python and Java

Python Python supports many (but not all) aspects of object-oriented programming; but it is possible to write a Python program without making any use of OO concepts. Python is designed to be used interpretively.

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

### B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

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

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

### Basics of Programming

Unit 2 Basics of Programming Problem Analysis When we are going to develop any solution to the problem, we must fully understand the nature of the problem and what we want the program to do. Without the

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

### INTRODUCTION 1 AND REVIEW

INTRODUTION 1 AND REVIEW hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Programming: Advanced Objectives You will learn: Program structure. Program statements. Datatypes. Pointers. Arrays. Structures.

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

### MATLAB COURSE FALL 2004 SESSION 1 GETTING STARTED. Christian Daude 1

MATLAB COURSE FALL 2004 SESSION 1 GETTING STARTED Christian Daude 1 Introduction MATLAB is a software package designed to handle a broad range of mathematical needs one may encounter when doing scientific

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

### HAWK Language Reference Manual

HAWK Language Reference Manual HTML is All We Know Created By: Graham Gobieski, George Yu, Ethan Benjamin, Justin Chang, Jon Adelson 0. Contents 1 Introduction 2 Lexical Convetions 2.1 Tokens 2.2 Comments

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

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

### Pace University. Fundamental Concepts of CS121 1

Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

### COAL (COmplex Arithmetic Language) Reference Manual

COAL (COmplex Arithmetic Language) Reference Manual March 09, 2009 COMS W4115 Eliot Scull (CVN) e.scull@computer.org 1 Introduction This manual describes the COAL language (COmplex Arithmetic Language)

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

### GAWK Language Reference Manual

GAWK Language Reference Manual Albert Cui, Karen Nan, Mei-Vern Then, & Michael Raimi So good, you re gonna GAWK. 1.0 Introduction This manual describes the GAWK language and is meant to be used as a reliable

### Functions. Lecture 6 COP 3014 Spring February 11, 2018

Functions Lecture 6 COP 3014 Spring 2018 February 11, 2018 Functions A function is a reusable portion of a program, sometimes called a procedure or subroutine. Like a mini-program (or subprogram) in its

### Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

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;

### c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

2.1 Introduction (No questions.) 2.2 A Simple Program: Printing a Line of Text 2.1 Which of the following must every C program have? (a) main (b) #include (c) /* (d) 2.2 Every statement in C

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

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

### Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Matlab By: Dr. Maher O. EL-Ghossain Outline: q What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control

### Full file at C How to Program, 6/e Multiple Choice Test Bank

2.1 Introduction 2.2 A Simple Program: Printing a Line of Text 2.1 Lines beginning with let the computer know that the rest of the line is a comment. (a) /* (b) ** (c) REM (d)

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

### CLIP - A Crytographic Language with Irritating Parentheses

CLIP - A Crytographic Language with Irritating Parentheses Author: Duan Wei wd2114@columbia.edu Yi-Hsiu Chen yc2796@columbia.edu Instructor: Prof. Stephen A. Edwards July 24, 2013 Contents 1 Introduction

### High Institute of Computer Science & Information Technology Term : 1 st. El-Shorouk Academy Acad. Year : 2013 / Year : 2 nd

El-Shorouk Academy Acad. Year : 2013 / 2014 High Institute of Computer Science & Information Technology Term : 1 st Year : 2 nd Computer Science Department Object Oriented Programming Section (1) Arrays

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

### Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

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