DOC PREVIEW
Columbia COMS W4115 - MIRAGE A Graphical Sketching Language

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 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 16 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 16 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 16 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 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MIRAGEA Graphical Sketching LanguageA Graphical Sketching LanguageColumbia UniversityCOMS W4115 Programming Languages and TranslatorsFall 2006Prof. Stephen EdwardsTeam Members:Abhilash I [email protected] Liao [email protected] Vasudevan [email protected] Zhang [email protected] Main Objective Develop a simple, elegant but powerful graphical language Motivation Provide C like syntax with Logo drawing features Features Easy to read, write and learn – beginners Educational purposes Teach and inspire programming beginners Teach most basic computer science concepts To draw Simple 2D graphs Fractals, Space filling curves: dragon curve, hilbert curve, koch curve, etc. Animations Handling image files and I/OMirage TutorialBasics Types int - 32 bit integer  void - used for functions without return values String constants - For filenames, Eg. save “img.jpg” Control statements if-else, for, whileKeywords - 23 in totalif else while forreturn breakmain void int up down fwd bwd lft rgtcolor thick speed resetload save eraseon eraseoffGraphics Drawing Statements Graphics Motion fwd dist; bwd dist; lft degrees; rgt degrees; Simple Examplemain(){fwd 50;rgt 90;fwd 50;rgt 90;fwd 50;rgt 90;fwd 50;}More Graphics Pen State up; down; thick val; speed val; reset; eraseon; eraseoff; color <R, G, B>; Curves curve <angle, offset in percentage>; ColorfulBall.jpgImplementationInside Mirage Interpreter Walk only once All functions defined before handMirage Source codeInterpreterParserLexerWalkerSymbol TableExceptionPainterOutputControl flowmain(){int a=5, c=90, i=1;/* Define the shape of line: Half Cycle */ curve <90,0>;for(i=0; i<50; i=i+1){color <255-2*i,100+2*i,0>;thick i/3;rgt c;fwd a*i;}save "flower.jpg";}flower.jpgforfor_expr for_expr for_expr BodySave pointer to each of these and walk them as necessaryScopingo C likevoid main(){int a;{ int b;a=5;int c; /*Allowed*/b=5;}a = 6; /*OK*/b = 6; /*Error: b not visible*/}HstackHashtable{}Nxt_ptrHstackHashtable{}Nxt_ptrHstackHashtable{}Nxt_ptrHstackHashtable{}Nxt_ptrNew symbol table insertedFunctions Pass by value Return type – void or int RecursionHstackHashtable{}Nxt_ptrHstackHashtable{}Nxt_ptrPointer to the previous activation recordHstackHashtable{}Nxt_ptrFunction example /* dragon.mrg */ void dragon(int n, int a, int h) { if(n < 1) { fwd h; return; } dragon (n - 1, 90, h); rgt a; dragon (n - 1, -90, h); } main() { color <180, 0, 0>; dragon( 11, 90, 6); save "dragon.jpg"; }DEMOStatistics785Total27MirageMain.java121MirageApp.java156MirageDisplay.java19ActivationRecord.java91MirageFunction.java68Env.java37HStack.java110MirageWalker.g156MirageParserLexer.gNo. of linesFileConclusion Lessons LearnedQuestions GuaranteedAnswers are


View Full Document

Columbia COMS W4115 - MIRAGE A Graphical Sketching Language

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 MIRAGE A Graphical Sketching Language
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 MIRAGE A Graphical Sketching Language 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 MIRAGE A Graphical Sketching Language 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?