EcoSL Economical Spreadsheet Language Lalit K Kanteti Somenath Srinivas Feeling like this Image from www spreadsheet factory com presentation html We have EcoSL for you Image from www spreadsheet factory com presentation html What s this Language A language which allows users to manipulate on sets of data in a spreadsheet like manner Key features of Spreadsheets Data Interpretations Software should be more than Scientific Cal Mathematical Computations on data Graphical representations No need to know too much of Programming concepts EcoSL was motivated and had started with above goals EcoSL is not a compiler It s an Interpreter Tired of hello world Let s have some different fodder for the newbie A Sample program func max a b if a b return a else return b 1 2 2 3 5 6 max 5 99 c max 5 99 println c print max 1 2 3 5 The adjacent sample program prints the following output 99 6 Does the previous code look cool Guess why EcoSL is characterized by a simple syntax x y defines a basic unit of computation in a spreadsheet called a cell Not to annoy the seasoned programmer we also support the traditional identifiers Built in functions of Sigma Avg Print Println In addition the user can easily define any function of his choice Observe No declarations for identifiers No return type defined for functions Built in functions synonymous to mathematical operations EcoSL Lexer Converts stream of program input to tokens An example comment matching rule COMMENT options generateAmbigWarnings false LA 2 r n newline r n newline r n setType Token SKIP Ecosl Parser Our entry point into the parser is Contd shown below program LBRACE statement RBRACE program PROGRAM program program Some key parser productions Statement LBRACE statement RBRACE statement STMT BLOCK stmt block statement func decl func ID LPAREN formal args RPAREN LBRACE statement RBRACE func decl FUNC DECL func decl func decl coordinate LBRAC expr COLON expr RBRAC coordinate COORDINATE coordinate coordinate Walker Ecosl runs program returns Program prog prog null Stmt s null prog null Stmt null PROGRAM prog new Program s statement prog addStmt s formal args returns java util Vector formalArgs formalArgs null FORMAL ARGS formalArgs new java util Vector ID formalArgs add new Variable ID getText FUNC DECL ID args formal args s1 new StmtBlock COORDINATE a expr b expr e new Coordinate a b s2 statement StmtBlock s1 addStmt s 2 s new FunctionDecl ID getText args s1 Program Statements While Plus For Continue Minus Expr Statement Mod Func Call If Variable Break IntConstant Looking for the same old features It is there in EcoSL User defined functions Built in functions Iterations while for Comments Conditional statements if else Scope Data types Integer float Basic arithmetic operations Break continue Looking for the something new It is there in EcoSL Coordinates Operations on coordinates String operations No types Functions returns Problem in coordination We have a repository CVS through Clic machines Google Code svn Thanks Let s explore EcoSL Time for Demo
View Full Document
Unlocking...