# GeoCode Language Reference Manual

Size: px
Start display at page:

Transcription

1 GeoCode Language Reference Manual Contents 1 Introduction Lexical Elements Identifiers Keywords Literals Line Structure Indentation Whitespace Comments Data Types Primitive Data Types Class List Point Point LCS: Local Coordinate System Geoclass Expressions and Operators Expressions Assignment Operators Arithmetic Operators Comparison Operators Type Casts Operator Precedence Statements if Statement while Statement for Statement... 13

2 5.4 return Statement Functions Function Declarations Function Definitions Calling Functions The main Function print Function Program Structure and Scope Include Scope Standard Library Geometry Classes Utility Classes... 17

3 1 Introduction With the advent of 3d machining and the availability of affordable routers, CNC machines have become quite common. The driving force behind a CNC machine is G- Code, an old language that is very cumbersome and verbose. The G-Code language focuses on the mechanics of the machine and this verbosity obscures the meaning of the final program. GeoCode is a language that focuses on allowing the user to describe the program through the definition of the geometrical entities that should be machined. By allowing the user to focus on higher logic, the program will be less obscured by the details of the machining process. The user will create the geometric entities that compose the target motions and Geocode will produce the output in a G-Code file that can be run on a CNC machine. 2 Lexical Elements 2.1 Identifiers Identifiers are strings used for naming variables, functions, and objects. All identifiers must start with an upper of lower case letter and can be followed by any upper or lower case character, digit, or underscore. The identifier is case sensitive. 2.2 Keywords Special identifiers are reserved by the Geocode language. These identifiers are: bool class double else false for geoclass if include int LCS list return string text true while 2.3 Literals Literals are notations for constant values of primitive types. 1) Integer Constant: A sequence of digits (0-9). Example: 42 2) Double Constant: A sequence of digits (0-9) that contain the decimal. character. The decimal may be the first character in the sequence as long as digits follow the decimal. Example: 13.2 or.17

4 3) String Constant: A sequence of zero or more characters, digits, and escape sequences surrounded by quotation marks. Example: 4) Text Constant: A sequence of upper and lower case letters a-z, A-Z, or the digits 0-9 signified with the starting constant letter t and surrounded by quotation marks. Example: t SimpleText1 5) List Constant: A sequences of the same data type surrounded in square brackets. Any of the above 4 data types can be used in a list. Example: [1, 2, 3, 4, 5] 2.4 Line Structure A Geocode program is divided into a group of lines that are terminated by the Unix form using ASCII LF (linefeed). A statement must be on a single line (cannot cross multiple lines). 2.5 Indentation Leading tabs at the beginning of a line are used to signify the indentation level. The indentation level for a group of statements must be the same. 2.6 Whitespace Spaces and tabs (except for leading tabs) are ignored. 2.7 Comments Comments begin with the character sequence /* and end with character sequence */. Everything in a comment is ignored by the compiler. 3 Data Types 3.1 Primitive Data Types There are 5 primitive types in the Geocode language: integer, double, bool, string, and text.

5 3.1.1 Integer Types Integer values are numbers from 2 30 to , that is to Uninitialized integers are set to the value Double Types Double values are numbers in floating-point representation. The current implementation uses double-precision floating-point numbers conforming to the IEEE 754 standard, with 53 bits of mantissa and an exponent ranging from 1022 to Uninitialized doubles are set to the value Bool Types Boolean values are the truth values true or false. Uninitialized bools are set to the value false String Types String values are a sequences of characters. All characters are valid except for the character which is used to signify the termination of the string. Uninitialized strings are set to the value Text Types Text values are similar to strings, except they are more limited in the character set they can hold. Text values can only contain upper and lower case letters a-z, A-Z, and the digits 0-9. Uninitialized texts are set to the value. 3.2 Class A class is a user-defined data type made up of variables of primitive types and other classes. The inclusion of class types are allowed with two exceptions: 1) A class may not include itself (recursion). 2) Two classes may not mutually include each other (mutual recursion) Defining Classes A class is defined with the keyword class followed by the name and then a colon. On the next line, a series of variables can be defined. A member variable is declared the

6 same as a regular variable. Following the member variable declaration is the member function declaration. A member function declaration is the same as a regular function declaration. A class must have either at least one member variable or one member function. The class definition is signified by the end of the indentation for the class member declarations. Here is an example of defining a simple object for a person: class Person: string name int age Print(): print(name) This defines a class named Person which has two member variables (name and age) and one member function (Print) Declaring Class Variables Variables of a class are declared the same as primitive variables. The line must include the name of the class and then the instance name. Person bill, ted That example declares two variables of type Person named bill and ted Initializing Class Members You can initialize the members of a class on the same line as the declaration of the class variable. The initialization must start on the same line as the variable declaration, be surrounded in parentheses, and follow the pattern member name : value. Multiple member initializations must be separated by a comma operator. Person bill(name: Bill, age:42) Uninitialized variables will be set to the default variables for the primitive type Accessing Class Members Class members are accessed using the member access operator, which is the period symbol. To access a member, type the name of the class variable followed by the access operator followed by the member name. class Person:

7 string name Print(): print(name) main(): Person bill bill.name = Bill bill.print() 3.3 List A list is a container type that holds a collections of primitive types or classes. All members of a list must be the same data type Declaring Lists List variables are declared similar to primitive variables, except the type that the list contains must be enclosed in square brackets. list[int] numbers Initializing Arrays List variables can be initialized by enclosing the values in square brackets. All values in the initialization list must be of the same type as the declared list type. list[int] numbers = [ 0, 1, 2, 3, 4 ] Accessing Array Elements Elements of the list can be accessed by zero-based index value. To access an element of the list, surround the index value by square brackets. numbers[0] = 1 Negative integer values index from the back of the list. To access the last element of a non-empty list, use the follow syntax: print(numbers[-1]) List Functions The list type provides the following functionality: count(): Return the number of elements in the list.

8 insert(index, element): Insert element into the list at index value. pop(): Remove and return the last element on the list. push(element): Add element to the end of the list. remove(index): Remove and return the element at index value. reverse(): Reverse the order of the list. List functions are called the same as class functions: list[int] numbers = [ 0, 1, 2, 3, 4 ] print(numbers.count()) Concatenating Lists Lists of the same type can be concatenated with the + operator. The order of newly created list1 + list2 will be list1 followed by list2. list[int] small_numbers = { 0, 1, 2, 3, 4 } list[int] big_numbers = { 1000, 1001, 1002, 1003, 1004 } list[int] all_numbers all_numbers = small_numbers + big_numbers 3.4 Point2 The Point2 class represents a 2-dimensional point. The class contains 2 double members: x, y. The data members can be accessed with the class access operator: Point3 start start.x = Point3 The Point3 class represents a 3-dimensional point. The class contains 3 double members: x, y, z. The data members can be accessed with the class access operator: Point3 start start.z = 4.2

9 3.6 LCS: Local Coordinate System The variable LCS exists at all times to represent the current coordinate system. The local coordinate system consists of a 3-dimensional origin and axis LCS Origin The LCS origin is a Point3 variable and may be accessed the same as a Point3 class. double current_x current_x = LCS.origin.x The default value for the LCS origin is 0.0 for all members LCS Axis The LCS axis is an object consisting of 3 Point3 members: u, v, w. The data members can be accessed through the class access operator: double current_w_x current_w_x = LCS.axis.w.x The default value for the LCS axis is the standard XYZ axes: w=x, y=y, w=z LCS Functions The LCS type provides the following functionality: identity(): Set the LCS to the default value. rotate(double angle, Point3 orientation): Rotate the coordinate system by angle degrees around the orientation vector. translate(point3 shift): Translate the coordinate system by the shift vector. LCS functions are called the same as class functions: Point3 shift(x: 1.0, y: 1.0, z: 1.0) LCS.translate(shift)

10 3.6.3 LCS Scope Modifications made to the local coordinate system are only observable for statements in the same scope. 3.7 Geoclass The geoclass type is a special class type that must declare and implement a set of predefined functions. The geoclass has an implicit member variable LCS which signifies the class variables coordinate system Geoclass LCS The geoclass LCS is assigned upon creation by using the current scope LCS. This data member is available to the class by using the LCS keyword Geoclass Required Functions The following are the set of functions that all geoclass classes must declare and define: 1) Translate(Point2 shift): Translate the geometry class in the u,v plane. 2) Rotate(double angle): Rotate the geometry around the w vector in the u,v plane. 3) Scale(Point2 scale): Scale the geometry in the u,v plane. 4) Print(): Output the geometry as NC Code Geoclass Declaration A geoclass declaration and definition is identical to a regular class:

11 4 Expressions and Operators 4.1 Expressions An expression is a literal, an identifier, a binary operator, an assignment, a function call, of a grouping of expressions surrounded by parentheses. Here are some examples: * 2 print(42) 4.2 Assignment Operators Assignment operators store values in variables. The assignment operator = stores the value of its right operand in the variable specified by its left operand. String test = Hello World 4.3 Arithmetic Operators Addition +, subtraction -, multiplication *, division /, and modular division % are accomplished with the use of the operators identified. Arithmetic operators only operate on variables of the same type. Arithmetic operators are fully supported for integers: x = x = 101 % 2 All arithmetic operators can be used with double types except for modular division. x = 5.1 * 2.1 The string and text type can allow the use of the addition operator. x = Hello + World

12 4.4 Comparison Operators Two variables of the same type can be compared through comparison operators. The comparison operators are equality ==, not equal!=, less than <, less than or equal <=, greater than >, and greater than or equal >=. All primitive data types can use the equality and not equal operators. if ( Hello!= World ) The rest of the comparison operators are only supported for double and integers. if (2 < 3) 4.5 Type Casts Type casts are not supported at this time. 4.6 Operator Precedence The operators are listed in the order of precedence: Left Associative multiplication and division * \ Left Associative addition and subtraction + - Left Associative less than and greater than < <= > >= Left Associative equality and not equal ==!= Right Associative assignment = 5 Statements Statements cause actions and control flow within the program.

13 5.1 if Statement The if statement executes a group of code when the predicate is true. The form of the if statement is the keyword if followed by a predicate surrounded by parentheses, ending with a colon. There may be an else associated with the if statement, which will be executed if the predicate is not true. if (predicate): predicate-true else predicate-false The if statement and the statement to be executed can be on the same line as long as a single statement is to be executed: x = if (x == 8): print( Eight is great! ) If there is more than one statement to execute, then the statements must be entered on separate lines with an indentation level greater than the if statement: x = if (x == 8): x = x + 5 print( Thirteen is great! ) else: x = 8 print( Now x is great! ) 5.2 while Statement The while statement is similar to the if statement except that the statement loops and continues looping until the predicate is false: int counter = 0 while (counter < 7): print("need more counter ); counter = counter for Statement The for statement is similar to the while statement in that it will continually loop as long as the predicate is true. The for statement has 3 parameters:

14 1) Initialization expression: The expression will be executed once before entering the for loop body. 2) Predicate expression: The for loop will continue as long as the predicate is true. 3) Step expression: At the end of each iteration of the loop, this expression will be called. for (initialize; test; step) statement An example: int x for (x = 0; x < 10; x++): print(x); 5.4 return Statement The return statement is used inside a function to stop the execution of that function and return the value to the caller. string WhatTheCatSay(): return Meow main(): string answer answer = WhatTheCatSay() 6 Functions Functions are used to group logical code into a unit that can be called later in the program. A function must be declared and defined before it is used in the program. Every program requires at least one function, called main. That is where the program's execution begins. 6.1 Function Declarations A function is declared with an optional return type, a function name, and a parameter list surrounded by parentheses. Here is the general form: optional-return-type function-name (parameter-list):

15 The return type is the data type that is being returned from the function. If the function does not return, then no return type should be specified. A parameter is a variable type followed by a variable name. A parameter list is a sequence of parameters separated with commas. The parameter list can be empty. Here is an example of a function declaration with two parameters: int add(int x, int y): 6.2 Function Definitions A function must be defined right after the declaration. The function definition is a group of statements following the function declaration that have a greater indentation than the function declaration. int add(int x, int y): return x + y 6.3 Calling Functions A function is called by its name along with any parameters that are required. The assignment operator can be used to save data returned from the function. a = add(2, 40); 6.4 The main Function Every program must have one function, called main. This is where the program begins executing. The main function has no return type and no parameter list. main (): print( Hello World! ) 6.5 print Function The print function directs the parameters to the final output of the program. The following program would print the text Hello World upon completion of the program: main (): print( Hello World! )

16 The print function takes only one parameter. If this parameter is a primitive type, then print will output a string representation of this data type. If a class variable is passed to the print function, then the print function will try to call the function Print() on the class. If this function does not exist, this statement will result in an error. include "standard.geo" main (): Circle circle(radius:5) print(circle) 7 Program Structure and Scope A program is a file that contains the main function. This program may contain any number of other functions that assist in the program s execution. 7.1 Include A program may include another file by using the include command. The include command inserts the specified file in the current file as if the file was embedded. include "standard.geo" main (): Circle circle(radius:5) print(circle) 7.2 Scope Scope refers to what parts of the program can see a declared object. Any line in the program has access to: 1) All variables in the current statement group. 2) All variables declared in the previous lines of the same function that are of a lesser indentation level. 3) All function parameters of the enclosing function. 4) All global variables. The current statement group is defined as all lines that are of the same indentation level.

17 The LCS keyword makes extension use of the scope. All modifications to the LCS are only available to the lines in the same scope. main (): Circle circle1, circle2 Point3 up_in_z(0.0, 0.0, 42.0) LCS.Translate(up_in_z) circle1 = Circle(radius:5) circle2 = Circle(radius:5) Since circle1 is in the scope of the LCS translate, circle1 will be created with an LCS that is at 42 in the Z. The variable circle2 is not in the same scope as the LCS transform, therefore, it will be created with the default transform. 8 Standard Library A standard library standard.geo is included with the compiler. This file defines the basic geometry classes and some utility classes. 8.1 Geometry Classes The standard library will define the following geometry classes for NC Code output: 1) Line 2) Polyline 3) Rectangle 4) Circle 5) Arc 6) Textbox 8.2 Utility Classes There is only one utility class defined right now, Math. The following functions will be exposed: 1) Sin 2) Cos 3) Tan

18

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Chapter 2: Introduction to C++

Chapter 2: Introduction to C++ Copyright 2010 Pearson Education, Inc. Copyright Publishing as 2010 Pearson Pearson Addison-Wesley Education, Inc. Publishing as Pearson Addison-Wesley 2.1 Parts of a C++

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

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

### Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Copyright 2009 Publishing Pearson as Pearson Education, Addison-Wesley Inc. Publishing as Pearson Addison-Wesley

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

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

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

### String Computation Program

String Computation Program Reference Manual Scott Pender scp2135@columbia.edu COMS4115 Fall 2012 10/31/2012 1 Lexical Conventions There are four kinds of tokens: identifiers, keywords, expression operators,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### CSC Web Programming. Introduction to JavaScript

CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

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

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

### 2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Parts of a C++ Program Parts of a C++ Program // sample C++ program

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

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

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

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

### EZ- ASCII: Language Reference Manual

EZ- ASCII: Language Reference Manual Dmitriy Gromov (dg2720), Feifei Zhong (fz2185), Yilei Wang (yw2493), Xin Ye (xy2190), Joe Lee (jyl2157) Table of Contents 1 Program Definition... 3 2 Lexical Conventions...

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

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

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

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

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

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

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

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

### Chapter 2 Working with Data Types and Operators

JavaScript, Fourth Edition 2-1 Chapter 2 Working with Data Types and Operators At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics

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

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

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

### TED Language Reference Manual

1 TED Language Reference Manual Theodore Ahlfeld(twa2108), Konstantin Itskov(koi2104) Matthew Haigh(mlh2196), Gideon Mendels(gm2597) Preface 1. Lexical Elements 1.1 Identifiers 1.2 Keywords 1.3 Constants

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

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

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

### CHAPTER 3 BASIC INSTRUCTION OF C++

CHAPTER 3 BASIC INSTRUCTION OF C++ MOHD HATTA BIN HJ MOHAMED ALI Computer programming (BFC 20802) Subtopics 2 Parts of a C++ Program Classes and Objects The #include Directive Variables and Literals Identifiers

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

### Chapter 2: Using Data

Chapter 2: Using Data Declaring Variables Constant Cannot be changed after a program is compiled Variable A named location in computer memory that can hold different values at different points in time

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

### Chapter Overview. C++ Basics. Variables and Assignments. Variables and Assignments. Keywords. Identifiers. 2.1 Variables and Assignments

Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Copyright 2011 Pearson Addison-Wesley. All rights

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

### Creating a C++ Program

Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

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

### The C++ Language. Arizona State University 1

The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

### Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

### Basic Operations jgrasp debugger Writing Programs & Checkstyle

Basic Operations jgrasp debugger Writing Programs & Checkstyle Suppose you wanted to write a computer game to play "Rock, Paper, Scissors". How many combinations are there? Is there a tricky way to represent

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

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

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

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

### Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

### Standard 11. Lesson 9. Introduction to C++( Up to Operators) 2. List any two benefits of learning C++?(Any two points)

Standard 11 Lesson 9 Introduction to C++( Up to Operators) 2MARKS 1. Why C++ is called hybrid language? C++ supports both procedural and Object Oriented Programming paradigms. Thus, C++ is called as a

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

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

### LECTURE 02 INTRODUCTION TO C++

PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 02 INTRODUCTION

### Reserved Words and Identifiers

1 Programming in C Reserved Words and Identifiers Reserved word Word that has a specific meaning in C Ex: int, return Identifier Word used to name and refer to a data element or object manipulated by the

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

### Decaf Language Reference

Decaf Language Reference Mike Lam, James Madison University Fall 2016 1 Introduction Decaf is an imperative language similar to Java or C, but is greatly simplified compared to those languages. It will

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

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