1 / 18

PL/T Programming Language for Time

PL/T Programming Language for Time. Supervised by Professor Alfred V. Aho Teaching Assistant: Mr. Yan Zou Laurent Charignon (lc2817): Project Manager Sameer Choudhary (sc3363): System Integrator Imré Frotier de la Messelière (imf2108): Language Guru Tao Song (ts2695): System Architect

mariah
Download Presentation

PL/T Programming Language for Time

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. PL/TProgramming Language for Time Supervised by Professor Alfred V. Aho Teaching Assistant: Mr. Yan Zou Laurent Charignon (lc2817): Project Manager Sameer Choudhary (sc3363): System Integrator ImréFrotier de la Messelière (imf2108): Language Guru Tao Song (ts2695): System Architect AbhijeetTirthgirikar (apt2120): Tester and Validator

  2. Introduction to PL/T Example Scenario You want to make an alarm clock. Set it up to ring at 8:00pm today. You can input “y” to snooze it for another 10 mins. You have to terminate the program to stop the alarm otherwise it will keep on running for an hour. The alarm clock will ring for 1s and wait for input to snooze for 1s, and it will keep doing that for 1 hour.

  3. Introduction to PL/T (Continued…) PL/T has following properties:- • Simple and Easy to Learn • Powerful • Robust • Portable • Intuitive • Precise

  4. Sample Programs void main ( ) { #|5| every 1s{ cout << "hello"; } }

  5. Sample Programs (Continued…) void countDown(time t) { time n = now(); time p = t; #<n, n+t> every 1s{ cout << p; p = p-1s; } cout<< "Time over!"; }

  6. Motivation • In general purpose programing languages it is difficult to write time based programs • Requires knowledge of threads • Idea of having time as a primitive data type • To make writing time based general purpose operations like looping etc. easy

  7. Project Management What we wanted • Avoid stress by having something working quickly • Don't have to cross our fingers the last day • Learn new practices

  8. Project Management (Continued…) What we have actually did • Made some compromises on the scope of the project when it was needed • Considered the individual comfort as a top priority • Tried several paths when we are blocked • Refactored a lot • Tested the most critical features to feel confident and avoid this

  9. Important Language syntactic constructs Time • time t1 = 1h2m5s1i; • time t2 = 1h1m; • t1+t2 => 2h3m5s1i • 2*t2 => 2h2m • t2/2 => 30m30s • t1 < t2 => true • t1 >t2 => false

  10. Important Language syntactic constructs Time • time t = now(); cin >> t; cout << t; • number n = 5; t = NumberToTime(n); n=TimeToNumber(t);

  11. Important Language syntactic constructs # Loop • #|5|{ ... } • #|3| every 1h{ ... } • time t = now(); • #<t+1h,t+2h>{ ... } • #<t,t+3h> every 2s{ ... }

  12. Important Language syntactic constructs # Loop • #|5|{ ... } • #|3| every 1h{ ... } • time t = now(); • #<t+1h,t+2h>{ ... } • #<t,t+3h> every 2s{ ... }

  13. Compiler Architecture Fig 1: Architecture Diagram in a nutshell

  14. Compiler Architecture(Continued…) Fig 2: Detailed Architecture Diagram

  15. Execution (Continued) 1. input.plt 2. Main.java import java.util.*; import java.lang.*; class Main{ public static void main(String argv[]) double d =10000; System.out.println(BIF.intToTime((int)(p))); } void main(){ time p = 10s; cout << p; } 3. Comiler Output 10s

  16. Testing Unit Testing Functional Testing Complete test suite of PLT programs to test the compiler Same set of PL/T programs are used to test symbol table Cucumber JVM - Behavior driven development Executes plain-text functional descriptions as automated tests • JUnit Test Framework • To extensively test AST and the code it generates • Factory methods to define complex getCode functions

  17. Tools Used • JFlex • CUP • Eclipse • Egit • Cucumber • http://git-scm.com/ • http://docs.oracle.com/javase/tutorial/ • http://en.wikipedia.org/wiki/LaTeX • http://www.python.org/ • http://cukes.info/images/cuke_logo.png • http://junit.sourceforge.net/ A voir sur cette page pour reproduirele logo en texte • http://www.eclipse.org/ • http://www.eclipse.org/egit/ a decouper • http://www.eclipse.org/mylyn/ • http://jflex.de/ • http://www.cs.princeton.edu/~appel/modern/java/CUP/

  18. Conclusions • Communication! The minutes and the meetings matter more than the code, be sure that everybody knows the status of the project • Have a good morale condition: no rush and focus on building a prototype early • Keep the iteration shorts and switch roles to maintain a good morale condition. • Welcome ideas from everyone and discuss it altogether • DVCS is a very important tool, it saves you a great amount of time • Use a set of tools you are confident with, it will matter a lot • Team building matters • Don't hesitate to change your idea • Trust your tests to refactor often and have a maintainable code

More Related