• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/codegen

Code Generation and Refactoring library

Overview | Refactoring and Code Generation

The code generation api provides a system to simplify the creation of refactoring and code generating tools. The definition-use chain (duchain) and the language's specific abstract syntax tree (AST) provide the basis of a two-tiered, high-level and low-level api respectively. This gives you the simplicity and reusability of working with a language-independent api (the duchain) while still having the full power to manipulate language specifics (the AST).

To perform code generation, you should create a new duchain (eg. starting with a KDevelop::DUContext or KDevelop::Declaration) and then if desired attach AST branches where required.

To perform refactoring, a change set needs to be created against pre-existing duchains and/or ASTs; the chains/ASTs are not modified directly. Create a KDevelop::DUChangeSet and/or an KDevelop::AstChangeSet. Once created, this api will use the KDevelop::EditorIntegrator to modify the editor text, or directly edit on-disk files.

Refactoring which includes some code generation can combine the two different approaches (direct creation of objects and change sets).

License(s):
LGPLv2

For questions and discussons about editor either contact the author or the [email protected] mailing list.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Mar 7 2021 23:29:26 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/language/codegen

Skip menu "kdevplatform/language/codegen"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal