1 / 43

Presentation 4

Presentation 4. Cross Language Clone Analysis Team 2 October 13, 2010. Agenda. Current Tasks Spike – GOLD Parser Demo Project Layout Team Collaboration Path Forward. Our Team. Allen Tucker Patricia Bradford Greg Rodgers Brian Bentley Ashley Chafin. Current Tasks.

vivi
Download Presentation

Presentation 4

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. Presentation 4 Cross Language Clone Analysis Team 2 October 13, 2010

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

  3. Our Team • Allen Tucker • Patricia Bradford • Greg Rodgers • Brian Bentley • Ashley Chafin

  4. Current Tasks What we are tackling…

  5. Current Tasks (Review) • 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.

  6. UML Model – Load & Parse

  7. UML Model – Translate

  8. UML Model – Associate

  9. GOLD Parsing System Spike

  10. Topics To Discuss • What is it? • How does it work? • What can we use it for? • How can we extend it?

  11. What Is GOLD? • 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/goldparser

  12. How It Works (Block Structure) Source Code Grammar Builder Compiled Grammar Table (*.cgt) Engine Parsed Data

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

  14. How It Works (Process) Source Code Grammar Builder Compiled Grammar Table (*.cgt) Engine 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

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

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

  17. Usage within CloneDigger Source Code Compiled Grammar Table (*.cgt) Engine Parsed Data CodeDOM Conversion AST • 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

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

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

  20. Grammars • 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.

  21. Gold Parser Grammars • 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

  22. Grammar Example

  23. C++ Grammar Issue • 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.

  24. GOLD Parser Conclusion • 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

  25. Demonstrations GOLD Parsing System

  26. Project Layout Key Points, Architecture, & Unit Test

  27. Key Architecture Points • Multilanguage support • Configurable for different platforms • Stand-along application • plug-in • backend service • Extendable

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

  29. Visual Studio Solution

  30. Core Unit • 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 Core Clone Detection Algorithms Code Model API Language Service Interface

  31. Core

  32. Core - API

  33. Language Service

  34. Language Service

  35. Language Service

  36. App Configuration

  37. Unit Testing

  38. Team Collaboration Team 2 & Team 4

  39. Team Collaboration • 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.

  40. Team Collaboration • Method of collaboration: • Google code project site: • 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

  41. Path Forward Next Iteration & Schedule

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

  43. Schedule

More Related