PFORD Bhagyashree Bohra Deepti Jindal Shringika Porwal Outline
PFORD Bhagyashree Bohra Deepti Jindal Shringika Porwal
Outline n n n Introduction Overview Examples Implementation details Lessons learned
PFORD n. A programming language for making programming easier and translates complex languages n Some Generation: C++ Java
Goals n Portability - interpreted and executed by a java interpreter. n Ease of use - very simple and quick to start
What can the language do? n Basic operations – addition, multiplication, power, modulus… n Advanced operations – complex string operations , array operations n Translation
Operations and Relations Arithmetic Operations *, /, %, /’, ‘, +, -, mod, ^ Logical Operations not and or Relational Operations >, >=, <, <=, ==, !=
Statements Block Statement {} iteration loop n runs{}; loopfrom i to f interval k{}; while(exp) loopthrough{}; = if (exp) then {}; if (exp) then {} elsedo {}; break_loop; skip_iteration; Assignments Conditional Statements Break and Continue
Functions and Function call Self Defined Functions func <id> (para-list){} Function Call id(param-list);
Internal functions (include string) • Join(a, b) joins strings a and b. • To Lower to. Lower(m) makes all the characters in a string lower case • To Upper to. Upper( m) makes all the characters in a string upper case • Mean mean() computes the mean of an array • Stddev stddev() computes the stddev of an array • Sum sum() sums all the elements of an array • Print. Array print() prints all the elements of an array • Sort sort() sorts all the elements of an array
Example 1: startprogram w = 3; x = 10; func incw() { w=w+1; return w; }; func incx() { x=x+1; return x ; } ; func myfoo(y, z) { output y+y; x = 1; output z; } ; myfoo(incw(), incx()); 8 11
What does translation entail n Multiple Walkers. (total 3 right now) – One for stand alone – On each for each language • C++ • Java
Code Statistics Parts Front-end Back-End test code (translation) Statistics (lines) 2410 Total 7650 lines (partial, currently in CVS) 4590 540
Lessons Learned 1. Fully investigate the feasibility of the supporting tools • Ie. translation 2. Get advice from experienced people 3. When an easier method of implementing classes of function exists, use it 1. power 4. When in doubt see Mx
Future 1. Additional functionality 2. Translation to more languages 1. ie perl, C#
- Slides: 14