DOC PREVIEW
Columbia COMS W4115 - EcoSL - Economical Spreadsheet Language

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

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

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14EcoSLEcoSLLalit K KantetiLalit K KantetiSomenathSomenathSrinivasSrinivasEconomical Spreadsheet LanguageFeeling like this??Feeling like this??Image from: www.spreadsheet-factory.com/presentation.htmlWe have EcoSL for you!!We have EcoSL for you!!Image from: www.spreadsheet-factory.com/presentation.htmlWhat’s this Language?What’s this Language?A language which allows users to manipulate on sets of data A language which allows users to manipulate on sets of data in a spreadsheet like mannerin a spreadsheet like mannerKey features of Spreadsheets: Data InterpretationsKey features of Spreadsheets: Data InterpretationsSoftware should be more than Scientific CalSoftware should be more than Scientific CalMathematical Computations on dataMathematical Computations on dataGraphical representationsGraphical representationsNo need to know too much of Programming conceptsNo need to know too much of Programming conceptsEcoSL was motivated and had started with above goalsEcoSL was motivated and had started with above goalsEcoSL is not a compiler. It’s an InterpreterEcoSL is not a compiler. It’s an InterpreterTired of hello world? Let’s have some different fodder for the Tired of hello world? Let’s have some different fodder for the newbie!newbie!{{ /*/* * A Sample program* A Sample program */ */ func max(a,b){func max(a,b){ if (a>=b)if (a>=b) return a;return a; else else return b;return b;} } [1:2] = 2;[1:2] = 2;[3:5] = 6;[3:5] = 6;max(5,99);max(5,99);c = max(5,99);c = max(5,99); println(c);println(c); print(max([1:2],[3:5]));print(max([1:2],[3:5]));} } The adjacent sample program The adjacent sample program prints the following outputprints the following output 9999 66Does the previous code look cool. Guess why???Does the previous code look cool. Guess why???•EcoSL is characterized by a simple syntax. EcoSL is characterized by a simple syntax. •[x:y] defines a basic unit of computation in a spreadsheet [x:y] defines a basic unit of computation in a spreadsheet called a cellcalled a cell•Not to annoy the seasoned programmer we also support the Not to annoy the seasoned programmer we also support the traditional identifiers. traditional identifiers. •Built in functions of Sigma, Avg, Print, PrintlnBuilt in functions of Sigma, Avg, Print, Println•In addition the user can easily define any functionIn addition the user can easily define any function of his choiceof his choiceObserveObserveNo declarations for identifiersNo declarations for identifiersNo return type defined for functionsNo return type defined for functionsBuilt-in functions synonymous to mathematical operationsBuilt-in functions synonymous to mathematical operationsConverts stream of program input to tokensConverts stream of program input to tokensAn example comment matching ruleAn example comment matching rule COMMENT: "/*" ( COMMENT: "/*" ( options { generateAmbigWarnings = options { generateAmbigWarnings = false; }: { LA(2) != '/' }? '*'false; }: { LA(2) != '/' }? '*'| "\r\n"{ newline(); }| "\r\n"{ newline(); }| ( '\r' | '\n' ){ newline(); }| ( '\r' | '\n' ){ newline(); }| ~( '*'| '\r' | '\n' )| ~( '*'| '\r' | '\n' ))* "*/"{ $setType(Token.SKIP); })* "*/"{ $setType(Token.SKIP); };;EcoSL-LexerEcoSL-LexerEcosl ParserEcosl Parser Our entry point into the parser is Our entry point into the parser is shown belowshown belowprogram: LBRACE! (statement)+ program: LBRACE! (statement)+ RBRACE! { RBRACE! { #program = #([PROGRAM, #program = #([PROGRAM, "program"], program);"program"], program); } ;} ;Some key parser productionsSome key parser productionsStatement : ……Statement : …… | (LBRACE! (statement)+ | (LBRACE! (statement)+ RBRACE!) {RBRACE!) { #statement = #([STMT_BLOCK, #statement = #([STMT_BLOCK, "stmt_block"], statement); "stmt_block"], statement); }) }) Contd…Contd…func_decl : func_decl : "func"! ID LPAREN! (formal_args)* "func"! ID LPAREN! (formal_args)* RPAREN! LBRACE! (statement)* RPAREN! LBRACE! (statement)* RBRACE! {RBRACE! { #func_decl = #([FUNC_DECL, #func_decl = #([FUNC_DECL, "func_decl"], func_decl);"func_decl"], func_decl); } ;} ;coordinate : coordinate : LBRAC! (expr) COLON! (expr) RBRAC!LBRAC! (expr) COLON! (expr) RBRAC!{ { #coordinate = #([COORDINATE, #coordinate = #([COORDINATE, "coordinate"] , coordinate); "coordinate"] , coordinate); }}Walker – Ecosl runs!!!Walker – Ecosl runs!!!program program returnsreturns [Program prog] [Program prog] { prog={ prog=nullnull;Stmt s = ;Stmt s = nullnull; }; } : #(PROGRAM { prog = : #(PROGRAM { prog = newnew Program();} Program();} (s = statement (s = statement {{ prog.addStmt(s); prog.addStmt(s); }} )*)* ););#(FUNC_DECL ID (args=formal_args)?#(FUNC_DECL ID (args=formal_args)?{{ s1 = s1 = newnew StmtBlock(); StmtBlock();} } (s2=statement (s2=statement { ((StmtBlock)s1).addStmt(s{ ((StmtBlock)s1).addStmt(s2); }2); } )*)* {{ s = s = newnew FunctionDecl (#ID.getText(), args, s1); FunctionDecl (#ID.getText(), args, s1); }}formal_args formal_args returnsreturns [java.util.Vector [java.util.Vector formalArgs]formalArgs]{formalArgs = {formalArgs = nullnull; }; } : #(FORMAL_ARGS : #(FORMAL_ARGS { formalArgs = { formalArgs = newnew java.util.Vector(); } java.util.Vector(); } (ID { formalArgs.add ((ID { formalArgs.add (newnew Variable(#ID.getText())); })*);Variable(#ID.getText())); })*);#(COORDINATE a=expr b=expr {#(COORDINATE a=expr b=expr { e = e = newnew Coordinate(a, b); Coordinate(a, b); } } ) )ProgramStatementsExpr StatementWhile For BreakIfContinuePlus Minus Mod Func Call Variable IntConstant....................Looking for the same old features?? It is there in EcoSL!!Looking for the same old features?? It is there in EcoSL!!User defined functionsUser defined functionsBuilt-in functionsBuilt-in functionsIterations (while, for)Iterations (while, for)CommentsCommentsConditional statements (if else)Conditional statements (if else)ScopeScopeData types (Integer, float)Data types (Integer, float)Basic arithmetic operationsBasic arithmetic operationsBreak,continueBreak,continueLooking for the something new?? It is there in


View Full Document

Columbia COMS W4115 - EcoSL - Economical Spreadsheet 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 EcoSL - Economical Spreadsheet 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 EcoSL - Economical Spreadsheet 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 EcoSL - Economical Spreadsheet 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?