{'fraction_non_alphanumeric': 0.02104499274310595, 'fraction_numerical': 0.0, 'mean_word_length': 5.44392523364486, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generalizing recognition of an individual dialect in program analysis and transformation

We present a novel method for generalizing the recognition capability of a tool from one dialect of a language to other dialects. The framework defines a novel base-dialect-specific map layer for representing program geography as recognised/unrecognised program zones in terms of an annotated preprocessor token stream. Error call stacks generated in the front-end syntax-analysis are also stored in the map for invoking programmable, error handling and repair transformations to obtain recognizable constructs from un-recognized ones. An iterative process is followed, wherein for each transformation, reversion-identifying edits are also stored in the map to provide a handle on (and preserved semantics of) the unchanged, original form.
 To advance unconstrained dialect variation from the recognised base dialect, the map's edit components and all transformations are defined on text form, for which a novel datatype minimizing transformation conflict is defined denotationally. The datatype, anchored text, gives primacy to locations in the initial sources, independently of the code located thereat. This results in greater commutativity of software transformations.
 A case study of the approach in generalizing a sequential dialect of C to UPC (Unified Parallel C) is carried out.