Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cross Language Clone Analysis Team 2 October 13, 2010.

Similar presentations


Presentation on theme: "Cross Language Clone Analysis Team 2 October 13, 2010."— Presentation transcript:

1 Cross Language Clone Analysis Team 2 October 13, 2010

2 Current Tasks Spike – GOLD Parser Demo Project Layout Team Collaboration Path Forward 2

3  Allen Tucker  Patricia Bradford  Greg Rodgers  Brian Bentley  Ashley Chafin 3

4 What we are tackling… 4

5  Current tasks created for the first user story “Source Code Load & Translate”: ◦ Load & parse C# source code. ◦ Load & parse JAVA source code. ◦ Load & parse C++ source code. ◦ Translate the parsed C# source code to CodeDOM. ◦ Translate the parsed JAVA source code to CodeDOM. ◦ Translate the parsed C++ source code to CodeDOM. ◦ Associate the CodeDOM to the original source code. 5

6 6

7 7

8 8

9 Spike 9

10  What is it?  How does it work?  What can we use it for?  How can we extend it? 10

11  GOLD is a free parsing system that you can use to develop your own programming languages, scripting languages and interpreters. It strives to be a development tool that can be used with numerous programming languages and on multiple platforms. – www.devincook.com/goldparserfree 11

12 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data 12

13 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data Three Major Components 1.Builder – Reads a source grammar to construct a Compiled Grammar Table 2.Compiled Grammar Table – Stores LALR and DFA parse tables 3.Engine – Performs actual parsing 13

14 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data Step 1 Write the grammar for the language being implemented. (GOLD-Meta Language) Rules: Backus-Naur Form Terminals: Regular Expressions Character sets: Set Notation 14

15 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data Step 2 Analyze Grammar Construct LALR and DFA parse tables which are saved in a Compiled Grammar Table file. 15

16 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data Step 3 Analyze source text with parser engine and construct parse tree Engine can be implemented in any number of programming languages 16

17 Compiled Grammar Table (*.cgt) Source Code Parsed Data CodeDOM Conversion Need to write routine to move data from Parsed Tree to CodeDOM Parsed data trees from parser are stored in consistent data structure, but are based on rules defined within grammars AST 17

18  Three Step Process Step 1 Code Translation Step 2 Clone Detection Step 3 Visualization Source Files Translator Common Model Inspector Detected Clones UI Clone Visualization 18

19 Grammar Compiled Grammar Table (*.cgt) Source Code Parsed Data Enhance Grammars Update Java Update C# Define C++ Share among other classmates with similar interest Share with greater community 19

20  What is a grammar? ◦ A set of rules of a specific kind, for forming strings in a formal language. The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax. A grammar does not describe the meaning of the strings or what can be done with them in whatever context —only their form. 20

21  Gold Parser uses context-free grammars that can be used to do Lookahead Left-to-Right (LALR) parsing.  LALR compliant grammars that we already have: ◦ C# ◦ Java ◦ Visual Basic.Net 21

22 22

23  Currently no LALR compliant C++ grammar exists due to the overall complexity.  Other C++ parsers exist, but give an output format different than the other languages we already have grammars for using Gold Parser.  We are still searching for C++ parsing solutions. 23

24  We plan to use GOLD Parsing System.  Tasks we have to complete: ◦ Update JAVA grammer ◦ Update C# grammer ◦ Research “Define C++ grammer” ◦ Create a CodeDOM conversion to move data from Parsed Tree to CodeDOM 24

25 GOLD Parsing System 25

26 Key Points, Architecture, & Unit Test 26

27  Multilanguage support  Configurable for different platforms ◦ Stand-along application ◦ plug-in ◦ backend service  Extendable 27

28 C# Service Java Service C++ Service User Interface Communication Layer Code Model Clone Detection Algorithms Core API Language Service Interface 28

29 29

30  Code Model ◦ Stores the code in common format  Application Programming Interface ◦ Used to embed clone detection in applications  Language Service Interface ◦ Communication layer between the core and the specific language services Code Model Clone Detection Algorithms Core API Language Service Interface 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 Team 2 & Team 4 38

39  Due to Team 4’s team size, we have taken responsibility of gathering & sharing grammers.  Both Teams will… ◦ Use the same grammers & engines  We will both have limitations based on this.  Ex: JAVA grammer is based off 1.4 -> we are limited to using JAVA 1.4 ◦ Test the same grammers & engines  We will have two test beds. 39

40  Method of collaboration: ◦ Google code project site:  http://code.google.com/p/uah-studio-2010-2011/ http://code.google.com/p/uah-studio-2010-2011/  Team 4 team members have access to this site. ◦ Meetings ◦ Email  What does our google code project contain? ◦ Source control for grammers & engines ◦ Bugs/Issues  Team 4 will have ability to document new bugs. ◦ Documents/Artifacts 40

41 Next Iteration & Schedule 41

42  Finalize Iteration 1  Iteration 2 Planning/Elaboration Path Forward

43 Schedule


Download ppt "Cross Language Clone Analysis Team 2 October 13, 2010."

Similar presentations


Ads by Google