A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pmd-code.org/latest/pmd_devdocs_major_adding_dialect.html below:

Adding PMD support for a new dialect for an already existing language

How to add a new dialect.

Table of Contents What is a dialect?

A dialect is a particular form of another supported language. For example, an XSLT is a particular form of an XML. Even though the dialect has its own semantics and uses, the contents are still readable by any tool capable of understanding the base language.

In PMD, a dialect allows to set up completely custom rules, XPath functions, properties and metrics for these files; while retaining the full support of the underlying language. That means:

- All rules applicable to the base language are automatically applicable to all files processed as a dialect.

- All XPath functions existing in the base language are available when creating new rules.

- All metrics supported by the base language are available when creating new rules.

- All properties (ie: support to suppress literals in CPD) supported by the base language are supported by the dialect.


Steps 1. Create a dialect module 2. Create a language handler (Optional) 3. Create rules 4. Test the rules 5. Create documentation page

Finishing up your new dialect by adding a page in the documentation. Create a new markdown file <langId>.md in docs/pages/pmd/languages/. This file should have the following frontmatter:

---
title: <Language Name>
permalink: pmd_languages_<langId>.html
last_updated: <Month> <Year> (<PMD Version>)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
---

On this page, language specifics can be documented, e.g. when the language was first supported by PMD. There is also the following Jekyll Include, that creates summary box for the language:


{% include language_info.html name='<Language Name>' id='<langId>' implementation='<langId>::lang.<langId>.<langId>LanguageModule' supports_cpd=true supports_pmd=true since='<PMD Version>' %}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4