pmd/docs/pages/customizing/adding_new_cpd_language.md
Andreas Dangel b193bb28d8 Add 'docs/' from commit '106142b25c9387ffd002437027ced1b04f494205'
git-subtree-dir: docs
git-subtree-mainline: 23545aa7ea599faf17737de9879733a1bde700d1
git-subtree-split: 106142b25c9387ffd002437027ced1b04f494205
2017-05-25 10:01:42 +02:00

1.1 KiB

title short_title tags summary series weight last_updated sidebar permalink folder
PMD How to Add a New CPD Language Add a New CPD Language
customizing
How to Add a New CPD Language Customizing PMD 8 July 3, 2016 mydoc_sidebar adding_new_cpd_language.html mydoc

{% include custom/series_customizing.html %}

How to Add a New Language to CPD

If you wish CPD to parse a unsupported language, you can easily develop a new parser for CPD. All you need to is implements the following interface:

  • net.sourceforge.pmd.cpd.Language
  • net.sourceforge.pmd.cpd.Tokenizer

Do not forget to the follow the proper naming convention, as the CPD parser factory use this convention:

  • Language Name + "Language"
  • Tokenizer Name + "Tokenizer"

For instance, if you develop a python parser, you should have two classes named PythonLanguage and PythonTokenizer.

To test your parser, just package it in a jar and add your jar to the classpath.

{% include custom/series_customizing_previous.html %} {% include custom/series_customizing_next.html %}

{% include links.html %}