1 / 14

James McCliggott Geoff Stoker Joel Winstead Greg Yukl

JIST. James McCliggott Geoff Stoker Joel Winstead Greg Yukl. “Java with lists”. WHAT IS JIST????. or. “ J ist I s S ome T ranslator”. OUTLINE. Why we did it What we did How we did it What we learned Reaction. WHY WE DID IT. Current mechanisms cumbersome

cybil
Download Presentation

James McCliggott Geoff Stoker Joel Winstead Greg Yukl

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JIST James McCliggott Geoff Stoker Joel Winstead Greg Yukl

  2. “Java with lists” WHAT IS JIST???? or “Jist Is Some Translator”

  3. OUTLINE • Why we did it • What we did • How we did it • What we learned • Reaction

  4. WHY WE DID IT • Current mechanisms cumbersome • No need to declare data structures that are only used once -- anonymous • Static type checking • Natural representation for functions that take/return tuples

  5. WHAT WE DID • Add lists to Java as first class entities • Ada/Java/C++/C vs. Lisp/Perl/Shell/TCL • Won’t break existing code

  6. JIST EXAMPLES L = [ 1, 2, 3 ]; L = [ 1, 3+4, i*j ]; L = [ 1, 2, 3, [ 4, [ 5, 6 ] ], 7 ]; Jist<Integer> intjist; intjist = [ 1, 2, 3 ]; int seconds, milliseconds; [ seconds, milliseconds ] = getTimeOfDay();

  7. //Creating an empty vector Vector v = new Vector(); //Adding some elements v.addElement(1); v.addElement(2); v.addElement(“three”); v.addElement(4); // . . . Possibly much later int i = (int) v.elementAt(2); //Runtime Error //Creating an empty Jist Jist <int> J; //Adding some elements J = [1, 2, “three”, 4]; //Compile time error

  8. FORMAL SEMANTICS L = [a0, ... , an]; i , ai == literal | expression | Jist --- i, value(L[i]) == value(ai) L[i] = j; j == literal | expression | Jist --- value(L[i]) == value(j) [a0, ..., an] = [b0,..., bm]; n == m For all i, type(ai) == type(bi) --- i, value(ai) == value(bi) where ai is assigned to bi before ai+1 is assigned to bi+1

  9. HOW WE DID IT • Implementation is a translator • Antlr Parser Generator • More powerful than yacc • LL(k) grammars vs. LR • Grammar inheritance • Tree parsers • Antlr is cool!

  10. DOING IT PARSER TRANSFORMER JIST CODE GENERATOR JAVA

  11. JIST EXPR EXPR EXPR [ 1, 2, 3 ] 1 2 3 PARSING A JIST jist: LBRACK! ( expression ( COMMA! expression )* )? RBRACK! { #jist = #( #[JIST,”JIST”], jist ); } ;

  12. WHAT WE LEARNED • Antlr is cool + Lists are cool => Jist is cool • Possible to make changes that don’t complicate a language • Our changes do not break existing code

  13. REACTION

  14. ? ? ? QUESTIONS

More Related