$30 off During Our Annual Pro Sale. View Details »

KDevelop4: Extending the language base beyond C++

KDevelop4: Extending the language base beyond C++

Piyush Verma

December 07, 2007
Tweet

More Decks by Piyush Verma

Other Decks in Programming

Transcript

  1. Kdevelop4: Beyond C++...
    extending the Language Base
    Kdevelop Unleashed.

    View Slide

  2. KDevelop ... A Superb IDE in the
    making.
    ●History and the road map of Kdevelop.
    ●Good Code Completion
    ●Great Code Navigation and features powered by Definition
    Use Chain
    ●Efficient memory management.
    ●The stats say it:

    View Slide

  3. The Current Languages Support Status
    ●C/C++
    ○Class Wizard
    ○Attribute/Method Wizard
    ○Language Parser
    ○Code Completion
    ○Problem Reporter
    ○Debugger
    ○Source Code Formatter
    ●Java
    ○Class Wizard
    ○Attribute/Method Wizard
    ○ANTLR Language parser
    ○Source Code Formatter
    ●Python
    ○Language Parser

    View Slide

  4. Face-Off : Kick-Starting the Pre-
    Requisites.
    ●a working checkout of KDE4 and Kdevelop4
    ○The briefing.
    ●The Lexer needs to be implemented/written
    ●The Parser Needs to be in shape.
    ○What should the grammar look like?
    ●Parser Generators could be used Or a hand written pasrer.
    ●Kdev-Pg is a handy tool.
    ○Kdev-PG!! what is Kdev-Pg ?
    ○What is fed into it ? How do i use it?
    ○What does it produce? How do i use the output
    ○What might be the shortcomings of using a parser-
    generator?

    View Slide

  5. Diving into the language support.
    ●Done with the parser for the language; what next?
    ○Test, Test & Test again.
    ●Write the Languagesupport headers and implementaions.
    ○derived from Iplugin and Ilanguagesupport
    ○can effectively use slots and signals to manage changes
    in the document status.
    ○Returns:
    ■The parsejob used by the the background parser to
    parse a given file.
    ■The name of the language
    ■The language being used.
    ●The Language ParseJob:
    ○Instigates the background parser, parse session and DU
    Chain for the document.

    View Slide

  6. DU aka Definition Use Chain: the key to
    glory.
    ●What is the Fuss all about?
    ●How does it work?
    ●What does it produce?
    ●What use it is?
    ●Extending the use beyond C++.
    ●Viewing the outputs for it.

    View Slide

  7. Extensions required in DUchain.
    ● EditorIntegrator implementation
    ○provides methods to integrate a text editor component
    ○helps locate the position/range of the tokens.
    ●ParseSession implementations.
    ●Contextbuilder implementation.
    ●Declarationbuilder implementation.
    ●Usebuilder implementation

    View Slide

  8. Putting the DUChain output in Use.
    ●The DUChain has been built.
    ●Use it for:
    ○Code Highlighting
    ○Advanced Syntax Highlighting
    ○Code Completion
    ○and many other features
    ●PS: Only Syntax highlighting has been implemented for
    python by me.
    ●Advanced Syntax Highlighting
    ○adding custom coloring to declarations/definitions & uses.
    ●Current DU Chain architecture that might make the use
    challenging.

    View Slide

  9. Show .... Don't Tell
    Working demonstrations, from my work on adding Python to
    Kdevelop4:-
    ●Executing a working copy of Kdevelop4.
    ●See the Python Plug-in in action, when a file is loaded.
    ○On the terminal debug messages.
    ●The DUChain works and shows the contexts created when
    a file is loaded.
    ○As a Kdevelop4 Widget.
    ●The Extended Code Highlighting after a *.py has been
    loaded.

    View Slide

  10. Acknowledgments & References:
    ●KDE 4 API reference available at
    http://api.kde.org
    ●Python plug-in code for KDevelop4 available at
    http://code.google.com/p/google-summer-of-code-2007-kde/downloads/list
    ●The C# & Java plug-ins for KDevelop4
    ●Kdevelop 4 API reference available at
    http://kdevelop.org/HEAD/doc/api/html/
    ●Thanks to:
    ○1
    ○2
    ○3

    View Slide