DOC PREVIEW
Columbia COMS W4115 - Report on CHAD

This preview shows page 1-2-3-4-5-6-7-8-9-10-72-73-74-75-76-77-78-79-80-81-82-145-146-147-148-149-150-151-152-153-154 out of 154 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 154 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Report on CHADDesigned, Implemented and Documented by:Haronil Estevez, Diana Jackson, Catherine MacInnes, Adam RosenzweigTable of ContentsIntroduction: the white paperLanguage TutorialLanguage Reference ManualProject PlanArchitectural DesignTest PlanLessons LearnedAppendix A: Sample test code and write-upsAppendix B: Complete Listing of Interpreter CodeWHITE PAPERLanguage OverviewThe instruction of computer science is often hampered by the abstract nature ofprogramming. Data and data structures are represented in programs with formallanguage and some students have difficulty visualizing what is actually going on. This problem is made worse when the data structures are manipulated in algorithms,even ones as simple a searches and sorts. Instructors are often reduced to drawingcrude illustrations on the board or even calling on students to act as array elements. Itis our belief that many instructors would appreciate a way to easily illustrate thesedata structures and algorithms in the context of a program which could then beincluded as part of a class demonstration. We hope to implement some of the morecommon complex data structures in a language that is syntactically and semanticallyeasy to extend to other data structuresGoalThe goal of our language is to allow instructors to quickly and easily write algorithmspertaining to the arrays, queues and stacks which are then illustrated through theinterpreting process. To this end, CHAD provides a set of basic functions for each ofthe native data types which allow them to be easily manipulated in the context of thelanguage and which the interpreter then knows how to illustrate.Easy to UseOne of the main goals of this language is to make the illustration of data structuresand algorithms easy. To this end we will implement a syntactically simple languagesacrificing power for simplicity. The language will be able to express certain datastructures and algorithms very succinctly at the expense of not being able to expressother data structures at all. We will also maintain a syntactic style that will befamiliar to users of other common programming languages.Complex Native Data TypesProgramming in our language will be oriented around a small number of native typeswhich include the complex data types arrays, queues, and stacks. In the future thelanguage could easily be extended to include other complex types such as linked lists,or trees.PortableOne of the things which is most important in terms of actually making CHAD usefulis that it will be extremely portable. Instructors will be able to run CHAD programsanywhere and can even make them available for students online. This is possiblebecause the CHAD interpreter will be written in Java, and will be the only thingnecessary to run a CHAD program.Language TutorialCHAD TutorialSection I. Getting Started with…· Basic Operators· Control StatementsSection II. Working with…· Integers· Strings· Arrays· Queues· StacksSection III. Writing your own FunctionsSection IV. Displaying with CHAD GUISection V. Simple ExampleSection I (a). Basic OperatorsProvided below is a table listing all of the supported CHAD operators along with adescription.Operator Description ExamplesAssignment (=) Assigns a value to a variableint i = 0; string s1 = “string”;Addition (+)Adds integers/Concatenatesstringsint j = 1;string s2 = “s”;int k = j + i; (k = 1)string s3 = s1 + s2; (s3 =“strings”)Subtraction (-)Subtracts integers/DenotesNegationk = k – j; (k = 0)k = -1;Multiplication (*) Multiplies integers k = 3 * 4; (k = 12)Division (/) Divides integers k = 12 / 3; (k = 4)Increment (++) Increases integer variable by 1 k++; (k = 5)Decrement (--) Decreases integer variable by 1 k--; (k = 4)Parentheses ( () )Specifies which operations toevaluate firstk = (5 + 4) * 2; (k = 18 becausethe “5+4” is evaluated first,then multiplied by 2)Comparison OperatorsDescriptionExamples*In each of these cases (as well as cases to follow in the Logical Conjunction Operators section),0 is returned if the comparison yields a false result. 1 is returned if it yields a true one. Typically, these comparison operators will be used in the context of an if-statement, but for thepurpose of demonstrated its use, that notion is not demonstrated here.IsEqualTo (==)Compares both sides of operatorfor equalityk == 18 (returns 1)IsGreaterThan ( > )Compares both sides of operatorto see if the right is greater thanthe left k > 19 (returns 0)IsLessThan ( < )Compares both sides of operatorto see if the right is less than therightk < 19 (returns 1)IsGreaterThanOrEqualTo ( >= )Compares both sides of operatorto see if the right is greater than orequal to the leftk >= 15 (returns 1)IsLessThanOrEqualTo ( <= )Compares both sides of operatorto see if the right is lessgreaterthan or equal to the leftk <= 15 (returns 0)Logical ConjunctionOperatorsDescription ExamplesANDSignifies logical conjunction oftwo expressions(K > 15) AND (K < 20) (true)ORSignifies logical disjunction oftwo expressions(K > 15) OR (K < 1) (true)NOTSignifies logical negation of anexpressionNOT (K == 15) (true)Section I (b). Control StatementsFor-Loops allow a block of code to be run multiple times. The syntax is as follows:for (int i=0; i<10; i++)statementsendforThe first parameter takes an integer for which the iteration should begin. The secondparameter specifies when the iteration will end. In this case, the range will be fromzero to 9. The third parameter specifies that the integer variable will increment witheach iteration. Next, “statements” represent whatever action you want to occur witheach iteration of this loop. Finally, a for-loop must be ended with the keywordendfor.If-Then-Else Statements allow statements to be executed provided that a testexpression proves true. Let’s say for example that you have the numbers five and six. You would like to assign the variable, i, to be equal to the greater of the two. Here isthe code:int int5 = 5; int int6 = 6;int i;if (int5 > int6)i = int5;endifelsei = int6;endelseAdditionally, you can use an elseif statement if you want to check multiple expressionprior to resulting to the execution of the statements in the body of the else block. Finally, an important point to mention is that regardless of which type you use, eachmust be ended with the appropriate keyword: if -> endif, elseif -> endelseif, else ->endelseSection II (a). IntegersIntegers must be in the range of –999 to 999. The syntax along


View Full Document

Columbia COMS W4115 - Report on CHAD

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Download Report on CHAD
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Report on CHAD and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Report on CHAD 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?