Interface DiffLineFormulaExtractor
- All Known Implementing Classes:
AbstractingFormulaExtractor
,CPPDiffLineFormulaExtractor
,JPPDiffLineFormulaExtractor
,MarlinCPPDiffLineFormulaExtractor
public interface DiffLineFormulaExtractor
Interface for extracting a formula from a line containing an annotation.
The line might be preceded by a '-', '+', or ' '.
For example, given the line "+#if defined(A) || B()", the extractor should extract "defined(A) || B".
Further alterations of the extracted formula are allowed. For instance, the extracted formula might be abstracted (e.g., by simplifying the call to "defined(A)" leaving only the argument "A", or substituting it with "DEFINED_A").
- Author:
- Paul Bittner, Sören Viegener, Benjamin Moosherr, Alexander Schultheiß
-
Method Summary
Modifier and TypeMethodDescriptionextractFormula
(String line) Extracts the feature formula as a string from a line (possibly within a diff).default String
resolveFeatureMacroFunctions
(String formula) Resolves any macros in the given formula that are relevant for feature annotations.
-
Method Details
-
extractFormula
Extracts the feature formula as a string from a line (possibly within a diff).- Parameters:
line
- The line of which to get the feature mapping- Returns:
- The feature mapping as a String of the given line
- Throws:
UnparseableFormulaException
-
resolveFeatureMacroFunctions
Resolves any macros in the given formula that are relevant for feature annotations. For example, inMarlin
, feature annotations are given by the customENABLED
andDISABLED
macros, which have to be unwrapped.- Parameters:
formula
- The formula whose feature macros to resolve.- Returns:
- The parseable formula as string. The default implementation returns the input string.
-