Skip to content

Overview of Piranha's core framework

Ameya Ketkar edited this page Jan 4, 2023 · 1 revision
Piranha Architecture

This is the higher level architecture of Piranha. At its heart, Polyglot Piranha is a structural find/replacement (rewrite) engine and pre-build language specific cleanup rules like - like simplifying boolean expressions, simplifying if-else statements, deleting empty class, deleting files with no type declarations, inline local variables, and many more. A user provides :

  • A set (or, a graph) of structural find/replace rules
  • Path to the code base
  • Arguments to modify Piranha's behavior (like deleting associated comments).

When Piranha applies the set (or graph) of user defined rules, it triggers the pre-built language specific cleanup rules to do a deep cleanup.