TDoc - Bringing Documentation to Tool

Embed Size (px)

DESCRIPTION

Prefinal Report for the Compiler Construction Course 2010 at EPFL in Switzerland.

Citation preview

  • 1. TDoc Bringing Documentation to Tool Andrea Gallidabino Florian Gysin Compiler Construction 2010

2. Vision

  • Coding ishard 3. Old / foreign code =harder

4. Vision

  • Coding ishard 5. Old / foreign code =harder 6. Support developers withdocumentation

7.

  • TDoc = Tool Documentation 8. Documentation Framework 9. Similar to JavaDoc 10. Annotated Comments

General Idea 11.

  • Progress up to now 12. Example Doc 13. Not yet finished!

Demo 14. AST Base Implementation Code Generator Parser Lexer Analyzer recursive descent add/connect symbols check types used CAFEBABE ready to run... lookahead of one source code JVM Code 15.

  • Annotated comments 16. Describe:
    • Parameters 17. Return value
  • Generates.html

@Comments /* * The method foo will say hello * if you ask it nicely. *@paramnameYour name. *@returnA friendly greeting.*/ def foo(name:String) : String = { return hello + name; } 18.

  • Assertions for methods in comments 19. Checked on runtime 20. Throwexceptions if not satisfied

@Preconditions /* * The method divide will divide * two integers. *@preconditionb != 0 */ def divide(a:int, b:int) : int = { return a / b; } 21. AST

  • tokenize comment lines 22. parse the one expression 23. symbol and type check 24. put stuff into AST 25. generate assertion code

TDoc Implementation Code Generator Parser Lexer Analyzer TDoc Generator comments source code JVM Code Html Doc 26.

  • Make it actually work... 27. Obvious: introducepostconditions 28. variable condition : assert certain value/range through the whole method

Things to do... 29.

  • Support developers withdocumentation

Summary 30.

  • Support developers withdocumentation 31. UseTDoc
    • annotate comments 32. Preconditions

Summary 33.

  • Support developers withdocumentation 34. UseTDoc
    • annotate comments 35. Preconditions
  • Question?

Summary