DES CARTES. COMS W4115 Fall 2011 Prof. Stephen Edwards Language Reference Manual

Size: px
Start display at page:

Download "DES CARTES. COMS W4115 Fall 2011 Prof. Stephen Edwards Language Reference Manual"

Transcription

1 COMS W4115 Fall 2011 Prof. Stephen Edwards Language Reference Manual Eric Chao [ehc2129] Susan Fung [sgf2110] Jim Huang [jzh2103] Jack Shi [xs2139] DES CARTES

2 page 2 Introduction Card games have been a popular form of entertainment for centuries, evolving from the traditional 52 unique cards (Poker) to over unique cards (Magic the Gathering). Descartes is a specialized computer language specifically designed to allow the easy creation of simple card games that use the standard 52-card deck. This Language Reference Manual is intended to help developers understand how to develop their own card game using this language and also describes the different components in the language that can be used. Printing To print constants, use the print keyword. Commas between constants denote adding spaces. Integers and Booleans are automatically converted to Strings and printed. Expressions that can be evaluated to constants are evaluated and printed. When calling print on nonconstant objects, the tostring method is called on the object and the returned value is printed. Example: String A = 100 ; int i = 999; print i, -,A, =, ; Output: = 899 Lexical Convention There are four types of tokens that Descartes uses: comments, identifiers, constants and keywords. Blanks, tabs, newlines, and comments are ignored unless used as token separators. At least one of these characters must be used to separate the other adjacent tokens. Comments Comments start with the characters /* and are terminated with */ Examples:

3 page 3 /* This is a comment */ /* This is a multi-line comment */ Identifiers An identifier is a sequence of letters, numbers, and/or underscore characters _. The identifier must start with a character. Upper and lower case letters are considered different. For example, the identifier cat is different from Cat. Constants There are several types of constants: integer, string, escape, boolean, tuple and list. Integer constants An integer constant is a sequence of digits. String constants A string constant is a sequence of characters enclosed in double quotes ( ). If the string needs a double quote to be part of the string, it must use the escape constant with a back slash (\ ). Escape constants An escape constant is a special string constant of 1 or 2 characters preceded by a backslash. Without a backslash, they would be regular string constants: Escape constant Description \n new line

4 page 4 \t tab \ single quote \ double quote \\ back slash Boolean constants A boolean constant is used to define whether an expression is true or false. It has either a true or false value. As an alternative, the integer constant 0 can be used in place of true and any other integer constant can be used to represent false. Tuple constants A tuple constant is an ordered set of string, boolean, or integer constants separated by commas and enclosed in parenthesis except when included in a list as stated below. Example: tuple a = (1,2); tuple b = ( alpha,100); tuple c = (true, false); List constants A list constant is an immutable sequence of the same data type. It is defined by placing the list items in brackets using a semicolon to separate each item. A List can contain tuple constants which are represented as comma-separated-values without a parenthesis. Example: List alist = [1;2;3;4]; /* This is a list of 4 integers */

5 page 5 List a = [1,2; 3,4; 5,6]; /* This is a list of 3 tuples */ Keywords The following identifiers are reserved as keywords and cannot be used other than its sole purpose: int break for String true char continue while List false null if switch goto boolean return else extend case default print Default Object Types Descartes includes default object types that allow the creation of representations of simple games that use the standard 52-card deck. These objects are Card, CardStack, Player, Field and Game. These objects can be customized for a specific card game. Card This object represents a card to be played in the game. Functions initialize(string value) tostring() getvalue() getsuit() Description Returns a card object. Takes in a String value ( 5H ). Returns a printable descriptive string representation of the object. ( 5H ) Returns the value (A,2,3 J,Q,K) of the card as a string. Returns the suit (spades, hearts, diamonds or clubs) of the card as a String getsuitletter() Returns the suit (S, H, D, or C) of the card as a 1-

6 page 6 character String getcolor() getcolorletter() getvisibility() setvisibility(player []) removevisibility(player []) Returns the color (black or red) of the card as a String Returns the color (B or R) of the card as a 1-character String Returns a list of Players that can see this card Sets which players have access to the card. It takes an array of Player objects as a parameter Revokes players access to the card. It takes an array of Player objects as a parameter Cards are compared based on value and suit. Equal comparisons are based on suit and value. Less than and more than comparisons are based on value. You can also use shorthand Card A = (Card) S5 instead of Card A = Card.initialize( S5 ) Examples: Card A = Card.initialize( S5 ); String x = A.getValue(); String y = A.getSuit(); String z = A.getColor(); print x,y,z; Output: 5 S black CardStack A card stack can be the deck of the card or an individual hand that a player has.

7 page 7 Functions initialize(int) tostring() setpoints(int) getpoints() changepoints(int) addcard(card, int) getcard(string) drawcard() drawcard(int) shuffle() reverse() contain(card) setvisibility(player []) removevisibility(player []) getvisibility() Description Generates a cardstack object. This is to represent either a deck to pick from or an individual player s hand. Must be called first to declare. It takes an integer as a parameter that defines how many cards to create in this stack. Returns a printable string representation of the object. This is how many points the card stack is worth. It takes an integer as a parameter Returns the number of points in the card stack Takes in an integer and changes the number of points by that number. Adds a Card to the stack. It takes a Card object as a parameter and an int to represent where in the stack to add the card. Returns a Card in the stack. It takes a String, the value of the card, as a parameter. Removes the first Card off the stack and returns a Card object Takes a positive integer as a parameter and returns that many Card objects in reverse order. Randomizes the sequence of the cards in the card stack Reverses the current sequence of cards in the card stack Returns a boolean whether a card is in the stack or not. It takes a Card object as a parameter Sets which players have access to the cards in the card stack. This is the default access if the individual access in the Card objects is not set. It takes an array of Player objects as a parameter Revokes players access to the cards in the stack. It takes an array of Player objects as a parameter Returns an array of Players that can access this card

8 page 8 stack size() default() Returns an integer that describes the size of the card stack Generates the CardStack with the default 52-card deck CardStacks support the plus (+) and minus (-) operators. The addition operator adds CardStacks together in order, as if the right CardStack is stacked on top of the left one. Example: CardStack deck = CardStack.default() + CardStack.default(); The subtract operator removes Cards and is the same as getcard. Example: CardStack A = CardStack.default(); print (A.getCard( A5 ) == A- A6 ); Output: False Player A player is the person involved in a game. It can be a dealer or any participant of the game. Functions setname(string) getname() setbetsize(int) getbetsize() setpoints(int) Description Sets who the player s name. It takes a string as a parameter Returns the name of the player Sets the current size of the bet the user wishes to place. If not set, the default is 0 meaning that no bet is required for the game. Returns the size of the bet Sets the total points in the player has. If not set, the default is 0. It takes an integer as a parameter.

9 page 9 getpoints() setplayertype(string) getplayertype() setcardstack(cardstack) getcardstack() Returns an int that describes the total points a player has. Sets the type of player. It takes a string as a parameter. Some examples of player types are dealer, team A Returns a string to represent the type of the player Sets the hand that the player holds. It takes a CardStack as a parameter Returns a CardStack that represents the player s hand Field This object will help in dividing a board game if needed. Functions setname(string) getname() setvalue(string) getvalue() setposition(int) getposition() addcardstack(cardstack) getcardstack() removecardstack(int) Description Sets what the field s name. It takes a string as a parameter Returns a string that represents the field s name Sets the value of the field. It takes a string as a parameter Returns a string that represents the value of the field Takes in an integer representing the position of the field. Possible values are integers from 0 to 9 and the positions correspond to the same positions of the numbers on a standard keyboard numeric keypad. This corresponds to where the CardStacks of this field are printed. The default position is 0 which denotes that the CardStack is not printed. Returns the position as an integer value. Adds a CardStack to the Field. Returns an array of CardStacks in the Field in order. Removes a CardStack from the Field.

10 page 10 setcardstack(cardstack[]) Sets the Field s CardStacks to an array of given CardStacks. Game This is the core of the card game. It encapsulates all the required elements that make up a card game. Functions getplayers() setbetsize(int) getbetsize() end() start() nextturn() move(card, CardStack, CardStack) setturnorder(list Player) getturnorder() setfields(field[]) print() Description Returns the List of Player objects currently in the game Sets the size of the bet for a given game. It takes an int as a parameter. If not set, the default is 0 meaning that no bet is required for the game. Returns an int that represents the size of the bet for a given game This stops/finishes the game and determines the winner. It returns a Player object This starts the game. This will control the order that the Players go. This returns the Player object This will move a Card Object from one card stack to another card stack. It removes the card in the second parameter (CardStack) to the third parameter (CardStack) This sets the order the players turn in the game. It takes a Player List as a a parameter Returns a List of Player objects to represent the order that the players are playing in Takes in an array of Fields and adds them to the Game. There must be no Fields with the same printed position (multiple Fields can have position 0. prints the CardStacks according to Fields.

11 page 11 Conversions The cast operator can be used to convert numerical types (int) into string and the reverse. It can also convert Cards to Strings and the reverse. (String) 122 will convert into 122 (int) 122 will convert into 122 (String) Card.initialize( A5 ) will convert into A5. (Card) A5 will convert into the corresponding card. Primary Expressions The primary expressions in Descartes are identifiers, constants, strings, and expressions contained inside parentheses. primary_expression: identifier constant literal (expression) An identifier is a primary expression only if it has the lexical conventions as defined in section Identifiers. Each identifier must have a type, which is determined by its declaration. A constant is a primary expression only if it has the lexical conventions as defined in Constants section and is one of the types defined in Descartes. A literal is a primary expression that has the primitive type string. It must follow the lexical conventions of the type string as defined in String Constants section and is immutable. An expression contained inside parentheses is a primary expression that has the same type and value as that not contained inside parentheses. The parentheses are only used to administer order of operations. Unary Operators unary_expression: unary_operator: one of postfix_expression + unary_operator expression -!

12 page 12 The unary plus operator (+) must have an operand of an arithmetic type. The type and value of the result are consistent with those of the operand. The unary minus operator (-) must have an operand of an arithmetic type. The type of the result is consistent with that of the operand. The value of the result is the negative value of the operand. The unary negation operator (!) must have an operand of boolean type. The type of the result is boolean and the result is true if the value of the operand compares equal to false and the result is false if the value of the operand compares equal to true. Cast Operators cast_expression: unary_expression (type_name) cast_expression The cast operator will convert the expression after the parentheses to the desired type specified in the parentheses before. It only operates on the unary expression immediately following the operator unless parentheses are used to alter. Multiplicative Operators multiplicative_expression: unary_expression multiplicative_expression * unary_expression multiplicative_expression / unary_expression multiplicative_expression % unary_expression The multiplicative operator * evaluates from left to right and denotes multiplication. The * operator can only take integers as operands and is a binary operator. The result is the expected arithmetic calculation, which is an integer. The multiplicative operator / evaluates from left to right and denotes division. The / operator can only take integers as operands and is a binary operator. The result is integer quotient for integer operands. The multiplicative operator % evaluates from left to right and denotes the modulus function. The % operator can only take integers as operands and is a binary operator. The result is an integer remainder of the division of the first operand by the second. Additive Operators

13 page 13 additive_expression: multiplicative_expression additive_expression + multiplicative_expression additive_expression multiplicative_expression The additive operator + evaluates from left to right and denotes addition. The + operator can only have integers as operands. It is a binary operator, so both operands must only be integers. The + operator also denotes string concatenation, but only if both operands are or string type. The additive operator - evaluates from left to right and denotes subtraction. The - operator can only have integers and floats as operands separately. It is a binary operator, so both operands must only be integers or only floats. Relational Operators Relational expressions can only evaluate to the result of true or false, which can be expressed as 1 an 0, respectively. relational_expression: additive_expression relational_expression < additive_expresion relational_expression > additive_expression relational_expression <= additive_expression relational_expression >= additive_expression The relational operator < evaluates left to right and denotes less than. The < operator can only have integers as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be integer 0. The relational operator > evaluates from left to right and denotes greater than. The > operator can only have integers as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be integer 0. The relational operator <= evaluates from left to right and denotes less than or equal to. The <= operator can only have integers as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be integer 0. The relational operator >= evaluates from left to right and denotes greater than or equal to. The >= operator can only have integers as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be integer 0.

14 page 14 Equality Operators equality_expression: relational_expression equality_expression == relational_expression equality_expression!= relational_expression The equality operator == evaluates from left to right and result in true or false, which can be expressed as integer 1 and integer 0, respectively. The == operator denotes equal to and accepts integers and strings as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be the integer 0. The equality operator!= evaluates from left to right and result in true or false, which can be expressed as integer 1 and integer 0, respectively. The!= operator denotes not equal to and accepts integers and strings as operands. The result, if the expression evaluates to true will be integer 1 and the result, if the expression evaluates to false will be the integer 0. In Descartes, equality operators only compare by value. Logical AND Operator logical_and_expression: equality_expression (logical_and_expression AND equality_expression) The logical AND operator is represented by &&. If the expression evaluates to true, the result will be integer 1 and if the expression evaluates to false, the result will be integer 0. The parentheses are required for the logical AND expression. Logical OR Operator logical_or_expression: logical_and_expression (logical_or_expression OR logical_and_expression) The logical OR operator is represented by. If the expression evaluates to true, the result will be integer 1 and if the expression evaluates to false, the result will be integer 0. The parentheses are required for the logical OR expression. Assignment Operator

15 page 15 expression: logical_or_expression unary_expression assignment_operator expression The assignment operator is represented by =. The type of the left operand must be the end type of the operand on the right. The value that the expression on the right evaluates to replaces the value of the left operand. Declarations Declarations are used within function definitions to specify the interpretation of each identifier. A declaration is composed of declaration-specifiers (one or two) and the necessary declarator list (any number one or more). Form: declaration-specifiers declarator-list; Sample: List lista; List lista, listb; The declarator-list contains a number of comma-separated identifiers being specified. The declaration-specifier consists of optional storage specifiers and one type-specifier. Form: storage specifier type-specifier Sample: static final List lista; Storage Specifier The possibilities are: static - Shared by any instance of the class no-modifier - Unique to that class final - Cannot be changed, immutable.

16 page 16 Type-Specifiers int boolean String List standard and user-defined types Declarators The declarator-list appearing in a declaration is a comma-separated sequence of declarators. Form: declarator declarator, declarator-list The specifiers in the declaration indicate the type and storage of the objects to which the declarators refer. Declarator Form: identifier declarator [constant-expression] or declarator[] Meaning of declarators Each declarator is an assertion that when the declarator form is used in an expression, it yields an object of the specified type and storage. Each declarator is declaring one identifier and if an identifier without specifiers appears as a declarator in a declaratorlist, then it has the type indicated by the specifier heading the declarator list. A declarator may have the form D[constant-expression] or D[ ] The constant expression represents the a compile-time-determinable value whose type is int and defaults to 1 if left blank. This generates an array of the type of the declarator

17 page 17 identified by the identifier. Some restrictions are: functions may not return functions and there are no arrays of functions. Statements Statements in DesCartes are executed sequentially unless otherwise noted. There are several different types of statements. Expression Statement The majority of statements in DesCartes are expression statements, which typically make assignments or call functions. The format of the expression statement is: expression; Compound Statement A sequence of statements can be executed where one is expected by using the compound statement: compound-statement: { statement-list } statement-list: statement statement statement-list If Statement There are two basic conditional statements in DesCartes: if ( expression ) statement if ( expression ) statement else statement

18 page 18 In both cases, the expression is evaluated first. If it is true, the following statement is executed. If it is false, the first conditional statement does not do anything but the second conditional statement executes the statement indicated by else. While Statement The while statement allows for looping over a statement until a certain condition is no longer valid. The format is as follows: while ( expression ) statement The statement is executed repeatedly until the expression is no longer true. The test of the expression happens before each statement is executed. For Statement The for statement is another looping statement with the following format: for (expression-1; expression-2; expression-3) statement It is equivalent to: expression-1; while (expression-2) { statement expression-3; } Expression-1 initializes the loop. Expression-2 sets the condition of the loop that is tested each time the loop starts. Expression-3 usually determines the increment value that is considered after each iteration, which allows for looping over the statement a finite number of times. Any or all of the expressions in the for statement may be dropped, resulting in the for statement s equivalent without the dropped expressions.

19 page 19 Switch Statement The switch statement allows for multiple execution paths based on the value of a single expression. switch ( expression ) statement With the expression being a primitive type, the switch statement leads to the following statement, which is typically compound. The statements within the compound statement are typically of the following forms: case expression default expression Depending on the expression, one of the case constants will be executed. They are checked in an undefined order. If none of the case constants are satisfied, then the default constant will execute. If there is no default constant, then nothing happens. Two case constants cannot have the same value. Here is an example. The formatting is as follows: int month = 8; String monthstring; switch (month) { case 1: monthstring = "January"; case 2: monthstring = "February"; case 3: monthstring = "March"; case 4: monthstring = "April"; case 5: monthstring = "May"; case 6: monthstring = "June"; case 7: monthstring = "July"; case 8: monthstring = "August"; case 9: monthstring = "September"; case 10: monthstring = "October"; case 11: monthstring = "November";

20 page 20 case 12: monthstring = "December"; default: monthstring = "Invalid month"; } Break Statement The break statement terminates the smallest while, do, for, or switch statement and allows for the execution of the statement following the terminated statement. Form: break; Continue Statement The continue statement skips the current iteration of a while, do, or for statement. Form: continue; Return Statement A return statement allows a function to return to its caller. The two forms are: Form: return; return ( expression ); In the second case, the value of the expression is returned to the caller, converted to the proper type if needed. Note that transferring flow to the end of a function is equivalent to the first case. Scope Rules The lexical scope of an identifier is the region of a program during which it may be used.

21 page 21 The lexical scope of external definitions, those outside functions and compound statements, extends from their definition to the end of the file. The lexical scope of names declared at the head of functions is limited to the body of the function. Declaring identifiers already declared in the current scope will cause an error. Special Compiler Commands Special Compiler Commands This is an explanation of some special compiler commands not especially treated elsewhere in this document. Token replacement (static final) A compiler-control line of the form: Static final identifier token-string Without a trailing semicolon will cause the compiler to replace all instances of the identifier after this line with the string of tokens, given that the string of tokens is a constant. This is the same as Java s static final declaration. The replacement tokenstring has comments removed from it, and it is surrounded with blanks. It is treated as a constant. Sample: static final size 100 int List[size]; Multiple Classes To include other classes or files, use the import statement. Form: import "filename ; Compiling and Running a program

22 page 22 Our language will be compiled to a java program so sample command-line instructions can be: desc Texas.des -> Creates a Texas.java javac Texas.java -> Creates a Texas.class java Texas -> Runs the Texas java program. desc will compile a.des Descartes program into a JAVA file. Then, JAVA-related commands javac and java will respectively compile a java program into a JAVA class and run the compiled JAVA program. The rationale for this is 1) Our language is built to be similar to JAVA but specialized for a game using a 52-card standard deck and compiled by/written using O Caml. 2) JAVA is universal and there is a high chance that the JAVA runtime environment is already installed in the machines on which our language is used. Example This sample code shows what the setup for a game of Texas Hold Em might look like: Texas { CardStack deck, p1hand, p2hand; Player[] players; Game(int numplayers) { /* If number of players is not 2, print Wrong number of players. and quit.*/ if(numplayers!=2) { print "Wrong number of players."; end(); } /* Create a deck composing of 2 default 52 card decks. */ CardStack Deck1 = CardStack.default().shuffle(); CardStack Deck2 = CardStack.default().shuffle(); CardStack deck = Deck1 + Deck2; deck.visibility = []; /* Initialize players and hands with default visibility. */ Player P1 = Player(); Player P2 = Player();

23 page 23 } players = [P1;P2]; p1hand.visibility = [P1]; P1.setCardStack(p1Hand); p2hand.visibility = [P2]; P2.setCardStack(p2Hand); /* Deal card to each player. */ Deal(2, [p1hand,p2hand]); } /* Deal function. Moves numcards from top of deck to designated card stack.*/ Deal(int numcards, CardStack[] cardstacks) { /* For each card stack, move numcards from deck to that stack. */ for(int i = 0; i < cardstack.size(); i++) { deck.drawcard(numcards)>> cardstack[i]; } }

COMS W4115 Fall 2011 Prof. Stephen Edwards Final Report. Eric Chao [ehc2129] Susan Fung [sgf2110] Jim Huang [jzh2103] Jack Shi [xs2139] DES CARTES

COMS W4115 Fall 2011 Prof. Stephen Edwards Final Report. Eric Chao [ehc2129] Susan Fung [sgf2110] Jim Huang [jzh2103] Jack Shi [xs2139] DES CARTES COMS W4115 Fall 2011 Prof. Stephen Edwards Final Report Eric Chao [ehc2129] Susan Fung [sgf2110] Jim Huang [jzh2103] Jack Shi [xs2139] DES CARTES page 2 Table of Contents 1 Introduction... 5 1.1 Motivation...

More information

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

\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

More information

Language Reference Manual simplicity

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

More information

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

More information

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

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

More information

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

More information

The Warhol Language Reference Manual

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

More information

1 Lexical Considerations

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

More information

Typescript on LLVM Language Reference Manual

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

More information

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

More information

Lexical Considerations

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

More information

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

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

More information

Lexical Considerations

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

More information

Introduction to Programming Using Java (98-388)

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;

More information

Operators. Java operators are classified into three categories:

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.

More information

SFPL Reference Manual

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

More information

CSC Web Programming. Introduction to JavaScript

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

More information

Basics of Java Programming

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

More information

The SPL Programming Language Reference Manual

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

More information

RTL Reference 1. JVM. 2. Lexical Conventions

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

More information

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

More information

egrapher Language Reference Manual

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

More information

corgi Language Reference Manual COMS W4115

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

More information

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

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

More information

Computer Programming, I. Laboratory Manual. Experiment #3. Selections

Computer Programming, I. Laboratory Manual. Experiment #3. Selections Think Twice Code Once The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2005 Khaleel I. Shaheen Computer Programming, I Laboratory Manual Experiment #3

More information

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual Programming Languages & Translators (COMS W4115) Department of Computer Science Columbia University Summer 2007 XML Document Manipulation Language (XDML) Language Reference Manual Luba Leyzerenok ll2310@columbia.edu

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

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

More information

Java+- Language Reference Manual

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

More information

JME Language Reference Manual

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.

More information

DINO. Language Reference Manual. Author: Manu Jain

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

More information

do fifty two: Language Reference Manual

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

More information

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

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

More information

XQ: An XML Query Language Language Reference Manual

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

More information

DaMPL. Language Reference Manual. Henrique Grando

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

More information

Language Reference Manual

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

More information

GraphQuil Language Reference Manual COMS W4115

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

More information

Sprite an animation manipulation language Language Reference Manual

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

More information

The PCAT Programming Language Reference Manual

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

More information

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

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

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

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

More information

UNIT- 3 Introduction to C++

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

More information

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

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

More information

Program Fundamentals

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

More information

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

More information

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

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

More information

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

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

More information

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

More information

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

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,

More information

CHIL CSS HTML Integrated Language

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

More information

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

More information

Language Reference Manual

Language Reference Manual PixMix Language Reference Manual Table of Contents Lexical Elements 4 Identifiers 4 Keywords 4 Constants 5 Integer Constants 5 Characters and Character Arrays 5 String Constants 5 Floating Point Constants

More information

Information Science 1

Information Science 1 Information Science 1 Simple Calcula,ons Week 09 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 8 l Simple calculations Documenting

More information

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

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

More information

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Programming in C++ 5. Integral data types

Programming in C++ 5. Integral data types Programming in C++ 5. Integral data types! Introduction! Type int! Integer multiplication & division! Increment & decrement operators! Associativity & precedence of operators! Some common operators! Long

More information

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

More information

ARG! Language Reference Manual

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

More information

Chapter 2. Lexical Elements & Operators

Chapter 2. Lexical Elements & Operators Chapter 2. Lexical Elements & Operators Byoung-Tak Zhang TA: Hanock Kwak Biointelligence Laboratory School of Computer Science and Engineering Seoul National Univertisy http://bi.snu.ac.kr The C System

More information

Visual C# Instructor s Manual Table of Contents

Visual C# Instructor s Manual Table of Contents 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

More information

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

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

More information

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI CSCI 2010 Principles of Computer Science Data and Expressions 08/09/2013 CSCI 2010 1 Data Types, Variables and Expressions in Java We look at the primitive data types, strings and expressions that are

More information

Chapter 2: Introduction to C++

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

More information

L-System Fractal Generator: Language Reference Manual

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

More information

Full file at

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

More information

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

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

More information

EZ- ASCII: Language Reference Manual

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

More information

YOLOP Language Reference Manual

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

More information

ASML Language Reference Manual

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

More information

4. Inputting data or messages to a function is called passing data to the function.

4. Inputting data or messages to a function is called passing data to the function. Test Bank for A First Book of ANSI C 4th Edition by Bronson Link full download test bank: http://testbankcollection.com/download/test-bank-for-a-first-book-of-ansi-c-4th-edition -by-bronson/ Link full

More information

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

More information

GBL Language Reference Manual

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

More information

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

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

More information

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

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

More information

Language Reference Manual

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

More information

C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal

C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal TOKENS C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal Tab, Vertical tab, Carriage Return. Other Characters:-

More information

Review of the C Programming Language for Principles of Operating Systems

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

More information

DEPARTMENT OF MATHS, MJ COLLEGE

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,

More information

Lecture 3. More About C

Lecture 3. More About C Copyright 1996 David R. Hanson Computer Science 126, Fall 1996 3-1 Lecture 3. More About C Programming languages have their lingo Programming language Types are categories of values int, float, char Constants

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Chapter 2: Using Data

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

More information

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

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

More information

Reference Grammar Meta-notation: hfooi means foo is a nonterminal. foo (in bold font) means that foo is a terminal i.e., a token or a part of a token.

Reference Grammar Meta-notation: hfooi means foo is a nonterminal. foo (in bold font) means that foo is a terminal i.e., a token or a part of a token. Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2002 Handout 6 Decaf Language Definition Wednesday, September 4 The project for the 12-unit flavor

More information

Cellular Automata Language (CAL) Language Reference Manual

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

More information

SECTION II: LANGUAGE BASICS

SECTION II: LANGUAGE BASICS Chapter 5 SECTION II: LANGUAGE BASICS Operators Chapter 04: Basic Fundamentals demonstrated declaring and initializing variables. This chapter depicts how to do something with them, using operators. Operators

More information

Operators & Expressions

Operators & Expressions Operators & Expressions Operator An operator is a symbol used to indicate a specific operation on variables in a program. Example : symbol + is an add operator that adds two data items called operands.

More information

Decaf Language Reference Manual

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

More information

Language Reference Manual

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

More information

JAVA Programming Fundamentals

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

More information

GOLD Language Reference Manual

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

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

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

More information

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics 1 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 Slide 2-3 2.1 Variables and Assignments 2

More information

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

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

More information

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

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,

More information

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

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

More information

Java Programming Fundamentals. Visit for more.

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

More information

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

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)

More information

Language Design COMS W4115. Prof. Stephen A. Edwards Spring 2003 Columbia University Department of Computer Science

Language Design COMS W4115. Prof. Stephen A. Edwards Spring 2003 Columbia University Department of Computer Science Language Design COMS W4115 Prof. Stephen A. Edwards Spring 2003 Columbia University Department of Computer Science Language Design Issues Syntax: how programs look Names and reserved words Instruction

More information

MATLIP: MATLAB-Like Language for Image Processing

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)

More information