Presentation is loading. Please wait.

Presentation is loading. Please wait.

Examples of using Grapacc

Similar presentations


Presentation on theme: "Examples of using Grapacc"— Presentation transcript:

1 Examples of using Grapacc

2 Demo 1 Given a text file, use Scanner object to read tokens in that text file: Using following objects: File, Scanner And control: while()

3 Developer filling phase
Developer input objects and while control. Each task should be enclosed in one method as in example.

4 Code Recommendation phase
Developer press Ctrl + Space to call code completion tool. Based on the context of objects and controls, Grapacc will suggest relevant patterns

5 Code completion phases
After Developer choosing the most relevant pattern and pressing Enter, Grapacc will automatically fill additional code into corresponding location in the program.Developer will count number of tokens filled by himself and by Grapacc (or copy from Google without change if he uses Google Code Search). # tokens filled by developer: (File, f, new, File, Scanner, sc, while) = 7 # tokens filled by Grapacc: (new, Scanner, f, sc,hasNext, sc,Next) = 6

6 Demo 2 Given an ArrayList, read all of its element using iterator:
Using following objects: ArrayList, Iterator And control: for()

7 Developer filling phase

8 Code Recommendation phase

9 Code completion phases
# tokens filled by developer: (ArrayList, arlist, for) =3 # tokens filled by Grapacc: (new, ArrayList, Iterator, it, arlist, iterator, for, it, hasNext, it, Next) = 11

10 Demo 3 Given an ArrayList, check if its size >0:
Using following objects: ArrayList And control: if()

11 Developer filling phase

12 Code Recommendation phase

13 Code completion phases
# tokens filled by developer: (ArrayList, arlist, if) =3 # tokens filled by Grapacc: (new, ArrayList, arlist, size) = 4

14 Table of counted tokens
Task Use #Tokens filled by developer #Tokens filled by Grapacc #Tokens copied from Google Demo1 Grapacc 7 6 NA Developer will send Anh the summary table for each tasks.


Download ppt "Examples of using Grapacc"

Similar presentations


Ads by Google