Skip to content

History

Showing with 38 additions and 1 deletion.
  1. +38 −1 RenameAll.md
39 changes: 38 additions & 1 deletion RenameAll.md
@@ -1,7 +1,44 @@
RenameAll is a [[grammar mutation]] that enforces the use of a particular naming convention for nonterminal symbols. A naming convention is characterised by specifying two parameters: its capitalisation policy and a word separator.

Possible capitalisation policy:
* UPPERCASE
* lowercase
* mixedCase
* CamelCase

A separator is just a string

## RenameAll implementations
There are three different implementations of RenameAll, varying in authorship, robustness and usage.

### [[Prolog]]
Four modes of operating:

* 1: convert everything to **UPPERCASE**
* 2: convert everything to **lowercase**
* 3: convert the first character to **Uppercase**
* 4: convert the first character to **lowerCase**

Any other combination is not implemented, and nonterminal names are perceived as containing one word each.

### [[Python]]
Implements all for capitalisation policies and separators that are:
* any one letter (usually `-`, `_` or `.`)
* `!`, meaning no separation
* `s`, meaning whitespace separation

(Using `s` to denote space makes sense since no naming conventions have been observed as having the actual letter “s” as a separator, and the expected use of the implementation as a [[command line tool]]).

Obviously, if the source naming convention is uppercase or lowercase without separators, no multiword names will be detected and processed correctly (advanced dictionary-based methods are required).

### [[Rascal]]
Defines an ADT for capitalisation policy and uses any (possibly empty) string as a separator. Contains a universal function, as well as several other pre-encoded functions to use together with the unified `mutate()` function.

## Relevant files
* [`shared/generators/casexbgf`](../blob/master/shared/generators/casexbgf)
* [`shared/prolog/cli/casexbgf.pro`](../blob/master/shared/prolog/cli/casexbgf.pro)

* [`shared/rascal/src/mutate/Namine.rsc`](../blob/master/shared/rascal/src/mutate/Namine.rsc)
* [`topics/mutation/naming/enforce.py`](../blob/master/topics/mutation/naming/enforce.py)

## Contributors
* [Ralf Lämmel (@rlaemmel)](https://github.com/rlaemmel)
Expand Down