LicenseGNU LGPLv3
Maintainerpaul.bittner@uni-ulm.de
Safe HaskellNone

EditPatterns

Description

This module provides Examples to reproduce each edit pattern we inspected in the evaluation of feature trace recording (Section 5 in our paper). As each pattern describes a possible type of edit and not an edit itself, each example shows one possible instance for a pattern (not the pattern itself as this is not possible). For some patterns, we thus have to show multiple examples as described in the paper. Most notably, distinguishing between the case when no feature traces are present (in general case) and the case when an optional outer scope of the edit code fragment is already mapped to the target feature mapping.

Synopsis

Documentation

feature_m :: Feature Source #

A dummy feature that is edited in each example. We name it m (mapping) here according to the variable used in the paper.

feature_FOO :: Feature Source #

Another dummy feature that can be edited.

rootName :: String Source #

Name for the AST root of each example instance. We use file nodes to represent the roots of the ASTs.

buildPCName :: String -> FeatureFormula -> String Source #

Describe the feature mapping of a node with the given name as text.

featurecolours :: MonadColorPrinter m => FeatureFormulaColourPalette m Source #

Colours for features and feature formulas used in the pattern examples.

emptyfile :: State UUID SSJavaAST Source #

AST representing an empty file.

code_then :: State UUID SSJavaAST Source #

AST representing the source code in the then branch of a preprocessor annotation.

code_else :: State UUID SSJavaAST Source #

AST representing the source code in the else branch of a preprocessor annotation.

somefunction :: State UUID SSJavaAST Source #

AST representing a method 'void foo()'.

createPatternExample :: MonadColorPrinter m => String -> SSJavaAST -> History SimpleJavaGrammar String -> Example m SimpleJavaGrammar String Source #

Create an Example for a specific pattern. Calls createPatternExampleWithStartTrace and defaults its first argument to an empty feature trace that assigns null to every node (emptyTrace).

addIfdef :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdef pattern in general case.

addIfdefWithPC :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdef pattern when an outer optional scope is already mapped to the target feature mapping.

addIfdefElse_IfBranch :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefElse pattern in general case. As AddIfdefElse has to be reproduced using two variants, we need two different examples here, one for the then-branch and one for the else-branch. This is the Example of the then branch.

addIfdefElse_IfBranchWithPC :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefElse pattern when an outer optional scope is already mapped to the target feature mapping. As AddIfdefElse has to be reproduced using two variants, we need two different examples here, one for the then-branch and one for the else-branch. This is the Example of the then branch.

addIfdefElse_ElseBranch :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefElse pattern in general case. As AddIfdefElse has to be reproduced using two variants, we need two different examples here, one for the then-branch and one for the else-branch. This is the Example of the else branch.

addIfdefElse_ElseBranchWithPC :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefElse pattern when an outer optional scope is already mapped to the target feature mapping. As AddIfdefElse has to be reproduced using two variants, we need two different examples here, one for the then-branch and one for the else-branch. This is the Example of the else branch.

addIfdefWrapElse :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefWrapElse pattern.

addIfdefWrapThen :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddIfdefWrapThen pattern.

addNormalCode_nonvariational :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddNormalCode pattern where non-variational code is added (code mapped to true).

addNormalCode_outerpc :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the AddNormalCode pattern when an outer optional scope is already mapped to the target feature mapping.

remNormalCode_null :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the RemNormalCode pattern when no feature traces are present initially.

remNormalCode_notnull :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the RemNormalCode pattern when feature traces are present initally.

remIfdef :: MonadColorPrinter m => State UUID (Example m SimpleJavaGrammar String) Source #

Example instance of the RemIfdef pattern. This behaves the same as remNormalCode_notnull.