Permalink
Browse files

Minor name refactor.

  • Loading branch information...
aJanker authored and aJanker committed Mar 25, 2014
1 parent 652864b commit 81e9508cc0f95840b973c3b93b9a34c216737ee8
@@ -136,7 +136,7 @@ trait Verification extends Evaluation {
})
}

private def genAllConfigVariantsForFeatures(ff: FileFeatures, enabledFeatures: List[SingleFeatureExpr],
private def genAllConfigVariantsForFeatures(ff: KnownFeatures, enabledFeatures: List[SingleFeatureExpr],
affectedFeatures: List[FeatureExpr], fm: FeatureModel,
startCounter: Int = 0): List[SimpleConfiguration] = {

@@ -11,7 +11,7 @@ import de.fosd.typechef.conditional._

object ConfigurationHandling {
def loadConfigurationsFromCSVFile(csvFile: File, dimacsFile: File,
ff: FileFeatures, fm: FeatureModel, fnamePrefix: String = ""):
ff: KnownFeatures, fm: FeatureModel, fnamePrefix: String = ""):
(List[SimpleConfiguration], String) = {
var retList: List[SimpleConfiguration] = List()

@@ -92,7 +92,7 @@ object ConfigurationHandling {
(retList, "Generated Configs: " + retList.size + "\n")
}

def loadConfigurationFromKconfigFile(ff: FileFeatures, fm: FeatureModel,
def loadConfigurationFromKconfigFile(ff: KnownFeatures, fm: FeatureModel,
file: File): (List[SimpleConfiguration], String) = {
val features = ff.features
val correctFeatureModelIncompatibility = false
@@ -242,7 +242,7 @@ object ConfigurationHandling {



def buildConfigurationsSingleConf(tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
def buildConfigurationsSingleConf(tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
opt: FamilyBasedVsSampleBasedOptions, configDir: File,
caseStudy: String, extasks: List[Task]): (String, List[Task]) = {
var tasks: List[Task] = List()
@@ -275,7 +275,7 @@ object ConfigurationHandling {
(log, tasks)
}

def buildConfigurationsPairwise(tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
def buildConfigurationsPairwise(tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
opt: FamilyBasedVsSampleBasedOptions, configDir: File,
caseStudy: String, extasks: List[Task]): (String, List[Task]) = {
var tasks: List[Task] = List()
@@ -323,7 +323,7 @@ object ConfigurationHandling {
(log, tasks)
}

def buildConfigurationsCodecoverageNH(tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
def buildConfigurationsCodecoverageNH(tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
configDir: File, caseStudy: String, extasks: List[Task])
: (String, List[Task]) = {
var tasks: List[Task] = List()
@@ -346,7 +346,7 @@ object ConfigurationHandling {
(log, tasks)
}

def buildConfigurationsCodecoverage(tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
def buildConfigurationsCodecoverage(tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
configDir: File, caseStudy: String, extasks: List[Task])
: (String, List[Task]) = {
var tasks: List[Task] = List()
@@ -390,7 +390,7 @@ object ConfigurationHandling {
* This corresponds to the view of the developer of a ".c" file.
* @return
*/
def configurationCoverage(astRoot: TranslationUnit, fm: FeatureModel, ff: FileFeatures,
def configurationCoverage(astRoot: TranslationUnit, fm: FeatureModel, ff: KnownFeatures,
existingConfigs: List[SimpleConfiguration] = List(), preferDisabledFeatures: Boolean,
includeVariabilityFromHeaderFiles: Boolean = false):
(List[SimpleConfiguration], String) = {
@@ -555,7 +555,7 @@ object ConfigurationHandling {
* @param model input feature model
* @return
*/
private def completeConfiguration(expr: FeatureExpr, ff: FileFeatures, model: FeatureModel,
private def completeConfiguration(expr: FeatureExpr, ff: KnownFeatures, model: FeatureModel,
preferDisabledFeatures: Boolean = false):
SimpleConfiguration = {
expr.getSatisfiableAssignment(model, ff.features.toSet, preferDisabledFeatures) match {
@@ -24,7 +24,7 @@ object FamilyBasedVsSampleBased extends EnforceTreeHelper with ASTNavigation wit
* the configs-list contains pairs of the name of the config-generation method and
* the respective generated configs
*/
private def buildConfigurations(tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
private def buildConfigurations(tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
opt: FamilyBasedVsSampleBasedOptions,
configdir: File, caseStudy: String): (String, List[Task]) = {
var msg: String = ""
@@ -105,7 +105,7 @@ object FamilyBasedVsSampleBased extends EnforceTreeHelper with ASTNavigation wit
countNumberOfASTElementsHelper(ast)
}

private def initSampling(fm_scanner: FeatureModel, fm: FeatureModel, ast: TranslationUnit, ff: FileFeatures,
private def initSampling(fm_scanner: FeatureModel, fm: FeatureModel, ast: TranslationUnit, ff: KnownFeatures,
opt: FamilyBasedVsSampleBasedOptions, logMessage: String): (String, String, List[Task]) = {
var caseStudy = ""
var thisFilePath: String = ""
@@ -171,7 +171,7 @@ object FamilyBasedVsSampleBased extends EnforceTreeHelper with ASTNavigation wit

def checkErrorsAgainstSamplingConfigs(fm_scanner: FeatureModel, fm: FeatureModel, ast: TranslationUnit,
opt: FamilyBasedVsSampleBasedOptions, logMessage: String) {
val ff: FileFeatures = new TUnitFeatures(ast)
val ff: KnownFeatures = new TUnitFeatures(ast)
val (log, fileID, samplingTasks) = initSampling(fm_scanner, fm, ast, ff, opt, logMessage)
val samplingTastsWithoutFamily = samplingTasks.filterNot {x => x._1 == "family"}
println("starting error checking.")
@@ -239,7 +239,7 @@ object FamilyBasedVsSampleBased extends EnforceTreeHelper with ASTNavigation wit

def typecheckProducts(fm_scanner: FeatureModel, fm: FeatureModel, ast: TranslationUnit,
opt: FamilyBasedVsSampleBasedOptions, logMessage: String) {
val ff: FileFeatures = new TUnitFeatures(ast)
val ff: KnownFeatures = new TUnitFeatures(ast)
val (configGenLog, thisFilePath, typecheckingTasks) = initSampling(fm_scanner, fm, ast, ff, opt, logMessage)
analyzeTasks(typecheckingTasks, ast, ff, fm, opt, thisFilePath, startLog = configGenLog)
}
@@ -262,7 +262,7 @@ object FamilyBasedVsSampleBased extends EnforceTreeHelper with ASTNavigation wit
}
}

private def analyzeTasks(tasks: List[Task], tunit: TranslationUnit, ff: FileFeatures, fm: FeatureModel,
private def analyzeTasks(tasks: List[Task], tunit: TranslationUnit, ff: KnownFeatures, fm: FeatureModel,
opt: FamilyBasedVsSampleBasedOptions, fileID: String, startLog: String = "") {
val log: String = startLog
val nstoms = 1000000
@@ -7,7 +7,7 @@ import de.fosd.typechef.featureexpr.SingleFeatureExpr
import de.fosd.typechef.parser.c.TranslationUnit
import de.fosd.typechef.conditional.{Choice, Opt}

trait FileFeatures extends scala.Serializable {
trait KnownFeatures extends scala.Serializable {

/** List of all features found in the currently processed file (tunit) or config */
val features: List[SingleFeatureExpr]
@@ -17,11 +17,11 @@ trait FileFeatures extends scala.Serializable {
new HashMap[SingleFeatureExpr, Int]().++(features.zipWithIndex)
}

class ConfigFeatures(val features: List[SingleFeatureExpr]) extends scala.Serializable with FileFeatures {
class ConfigFeatures(val features: List[SingleFeatureExpr]) extends scala.Serializable with KnownFeatures {

}

class TUnitFeatures(@transient val tunit: TranslationUnit) extends scala.Serializable with FileFeatures {
class TUnitFeatures(@transient val tunit: TranslationUnit) extends scala.Serializable with KnownFeatures {

/** List of all features found in the currently processed file (tunit) */
val features: List[SingleFeatureExpr] = getAllFeatures
@@ -4,7 +4,7 @@ import de.fosd.typechef.featureexpr.{FeatureExprFactory, FeatureExpr, SingleFeat

// representation of a product configuration that can be dumped into a file
// and loaded at further runs
class SimpleConfiguration(val ff: FileFeatures, @transient val trueSet: List[SingleFeatureExpr],
class SimpleConfiguration(val ff: KnownFeatures, @transient val trueSet: List[SingleFeatureExpr],
@transient val falseSet: List[SingleFeatureExpr]) extends scala.Serializable {

val ret: scala.collection.mutable.BitSet = scala.collection.mutable.BitSet()

0 comments on commit 81e9508

Please sign in to comment.