EcoSL - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

EcoSL

Description:

A language which allows users to manipulate on sets of data in ... Let's have some different fodder for the newbie! * A Sample program. func max(a,b){ if (a =b) ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 15
Provided by: lalitk
Category:
Tags: ecosl | fodder

less

Transcript and Presenter's Notes

Title: EcoSL


1
EcoSL
Economical Spreadsheet Language
Lalit K Kanteti Somenath Srinivas
2
Feeling like this??
Image from www.spreadsheet-factory.com/presentati
on.html
3
We have EcoSL for you!!
Image from www.spreadsheet-factory.com/presentati
on.html
4
Whats 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. Its an Interpreter

5
Tired of hello world? Lets have some different
fodder for the newbie!
  • /
  • A Sample program
  • /
  • func max(a,b)
  • if (agtb)?
  • return a
  • else
  • return b
  • 12 2
  • 35 6
  • max(5,99)
  • c max(5,99)
  • println(c)
  • print(max(12,35))
  • The adjacent sample program prints the following
    output
  • 99
  • 6

6
Does the previous code look cool. Guess why???
  • EcoSL is characterized by a simple syntax.
  • xy 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

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

8
Ecosl Parser
  • Our entry point into the parser is shown below
  • program LBRACE! (statement)
  • RBRACE!
  • program (PROGRAM,
  • "program", program)
  • Some key parser productions
  • Statement
  • (LBRACE! (statement)
  • RBRACE!)
  • statement (STMT_BLOCK,
  • "stmt_block",
    statement) )
  • Contd
  • 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)

9
Walker Ecosl runs!!!
  • program returns Program prog
  • prognullStmt s null
  • (PROGRAM prog new Program()
  • (s statement
  • prog.addStmt(s)
  • )
  • )
  • (FUNC_DECL ID (argsformal_args)?
  • s1 new StmtBlock()
  • (s2statement
    ((StmtBlock)s1).addStmt(s2)
  • )
  • s new FunctionDecl (ID.getText(), args,
    s1)
  • formal_args returns java.util.Vector formalArgs
  • formalArgs null
  • (FORMAL_ARGS formalArgs
    new java.util.Vector() (ID formalArgs.add
    (new Variable(ID.getText())) ))
  • (COORDINATE aexpr bexpr
  • e new Coordinate(a, b)
  • )

10
Program
Statements
Expr Statement
While
For
Break
If
Continue
.........
Plus
Minus
Mod
Func Call
Variable
IntConstant
...........
11
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

12
Looking for the something new?? It is there in
EcoSL!!
  • Coordinates
  • Operations on coordinates
  • String operations
  • No types
  • Functions returns

13
Problem in coordination??
  • We have a repository!!!!!!!!!!
  • CVS through Clic machines
  • Google Code (svn)

14
Thanks!!!!!
  • Let's explore EcoSL.
  • Time for Demo!!!!
Write a Comment
User Comments (0)
About PowerShow.com