Class MarlinCPPDiffLineFormulaExtractor
java.lang.Object
org.variantsync.diffdetective.feature.AbstractingFormulaExtractor
org.variantsync.diffdetective.feature.cpp.CPPDiffLineFormulaExtractor
org.variantsync.diffdetective.datasets.predefined.MarlinCPPDiffLineFormulaExtractor
- All Implemented Interfaces:
DiffLineFormulaExtractor
Extracts formulas from preprocessor annotations in the marlin firmware.
In particular, it resolves the 'ENABLED' and 'DISABLED' macros that are used in Marlin
to check for features being (de-)selected.
- Author:
- Paul Bittner
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate String
replaceAll
(Pattern pattern, String replacement, String string) resolveFeatureMacroFunctions
(String formula) Resolves any macros in the given formula that are relevant for feature annotations.Methods inherited from class org.variantsync.diffdetective.feature.cpp.CPPDiffLineFormulaExtractor
abstractFormula, extractFormula
-
Field Details
-
ENABLED_PATTERN
-
DISABLED_PATTERN
-
-
Constructor Details
-
MarlinCPPDiffLineFormulaExtractor
public MarlinCPPDiffLineFormulaExtractor()
-
-
Method Details
-
resolveFeatureMacroFunctions
Description copied from interface:DiffLineFormulaExtractor
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.
-
replaceAll
-