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

37 lines
1.1 KiB
Markdown

---
title: PMD How to Add a New CPD Language
short_title: Add a New CPD Language
tags: [customizing]
summary: How to Add a New CPD Language
series: Customizing PMD
weight: 8
last_updated: July 3, 2016
sidebar: mydoc_sidebar
permalink: adding_new_cpd_language.html
folder: 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 %}