org.cesta.trans.java
Class ShadowVariables

java.lang.Object
  extended by org.cesta.trans.AbstractTransformation
      extended by org.cesta.trans.java.AbstractRewriteTransformation
          extended by org.cesta.trans.java.ShadowVariables
All Implemented Interfaces:
Transformation

public class ShadowVariables
extends AbstractRewriteTransformation

This transformation adds protection against memory fault induction. Each variable will have its shadow copy (inversion of original value), which will be automatically checked during read and updated during write.

Parameters:

NameTypeDefaultDescription
replaceLocal Boolean false Replace not only global, but also local variables in methods.
replaceTypes String (regexp) "byte|short|boolean" Types, that should be transformed.
useMethodId Boolean false If set, local variables use local method id instead of global one. Id will be unique only in method, not globally. Can be used for methods, that are not calling any other transformed method.
includeVariables String (regexp) ".*" Name of variables, that should be included in transformation.
excludeVariables String (regexp) "" Name of variables, that should be excluded from transformation.

Basic parameters are inherited from AbstractRewriteTransformation.

Author:
Tobias Smolka

Field Summary
 
Fields inherited from class org.cesta.trans.java.AbstractRewriteTransformation
tokens, tree
 
Fields inherited from class org.cesta.trans.AbstractTransformation
logger
 
Constructor Summary
ShadowVariables()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getDefaultParams()
          Returns default parameters
 void transform(MappedFile filePair)
          Transforms single file
 
Methods inherited from class org.cesta.trans.java.AbstractRewriteTransformation
execute, prepareTreeNodeStream, registerTemplateGroupLoader
 
Methods inherited from class org.cesta.trans.AbstractTransformation
addMappedFile, clearParams, getMappedFiles, getParam, getParam, getParamB, getParamB, getParams, getParamS, getParamS, setMappedFiles, setParam, setParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowVariables

public ShadowVariables()
Method Detail

transform

public void transform(MappedFile filePair)
               throws TransformationException
Transforms single file

Specified by:
transform in class AbstractRewriteTransformation
Parameters:
filePair - File pair (input/output) to transform
Throws:
TransformationException - In case transformation failed

getDefaultParams

public java.util.Map<java.lang.String,java.lang.Object> getDefaultParams()
Returns default parameters

Overrides:
getDefaultParams in class AbstractRewriteTransformation
Returns:
map of parameters