@Override public VariableSet initializeforwardLV(VariableSet activeIn) throws LanguageException {
  for (  Statement s : _statements) {
    s.initializeforwardLV(activeIn);
    VariableSet read=s.variablesRead();
    VariableSet updated=s.variablesUpdated();
    if (s instanceof WhileStatement || s instanceof IfStatement || s instanceof ForStatement) {
      raiseValidateError("control statement (while / for / if) cannot be in generic statement block",false);
    }
    if (read != null) {
      for (      String var : read.getVariableNames()) {
        if (!_updated.containsVariable(var)) {
          _gen.addVariable(var,read.getVariable(var));
        }
      }
    }
    _read.addVariables(read);
    _updated.addVariables(updated);
    if (updated != null) {
      for (      String var : updated.getVariableNames()) {
        _kill.addVariable(var,_updated.getVariable(var));
      }
    }
  }
  _liveOut=new VariableSet();
  _liveOut.addVariables(activeIn);
  _liveOut.addVariables(_updated);
  return _liveOut;
}

@ Override public VariableSet initializeforwardLV ( VariableSet activeIn ) throws LanguageException { for ( Statement s : _statements ) { s . initializeforwardLV ( activeIn ) ; VariableSet read = s . variablesRead ( ) ; VariableSet updated = s . variablesUpdated ( ) ; if ( s instanceof WhileStatement || s instanceof IfStatement || s instanceof ForStatement ) { raiseValidateError ( "control statement (while / for / if) cannot be in generic statement block" , false ) ; } if ( read != null ) { for ( String var : read . getVariableNames ( ) ) { if ( ! _updated . containsVariable ( var ) ) { _gen . addVariable ( var , read . getVariable ( var ) ) ; } } } _read . addVariables ( read ) ; _updated . addVariables ( updated ) ; if ( updated != null ) { for ( String var : updated . getVariableNames ( ) ) { _kill . addVariable ( var , _updated . getVariable ( var ) ) ; } } } _liveOut = new VariableSet ( ) ; _liveOut . addVariables ( activeIn ) ; _liveOut . addVariables ( _updated ) ; return _liveOut ; }
for each statement : gen rule : for each variable read in current statement but not updated in any prior statement , add to gen handles case where variable both read and updated in same statement ( i = i + 1 , i needs to be added to gen ) kill rule : for each variable updated in current statement but not read in this or any prior statement , add to kill .
