Ejemplo n.º 1
0
void
Control::Substitute(map<string,string>* __mapping){
switch(GetControlKind()){
   case ADaAn_FOR      :
            if(__mapping->find(GetCounter()) != __mapping->end())
               SetCounterName(__mapping->operator[](GetCounter()));
            GetForLowerBound()->Substitute(__mapping);
            GetForUpperBound()->Substitute(__mapping);
            return;
   case ADaAn_WHILE   :
            if(__mapping->find(GetCounter()) != __mapping->end())
               SetCounterName(__mapping->operator[](GetCounter()));
            GetCondition()->Substitute(__mapping);
            return;
   case ADaAn_IF      :
            GetCondition()->Substitute(__mapping);
            return;
   case ADaAn_IF_ELSE   :
            GetCondition()->Substitute(__mapping);
            return;
   }

cerr<<"Control::Rename, Fatal error(unhandled operator)";
throw(UNHANDLED_CASE);
exit(EXIT_FAILURE);
}
Ejemplo n.º 2
0
void
Control::Set(string __counter, Condition* __cond)
{
SetControlKind( ADaAn_WHILE );
SetCounterName( __counter );
SetCondition( __cond );
}
Ejemplo n.º 3
0
void
Control::Set(string __counter, Expression* __lb, Expression* __ub)
{
SetControlKind( ADaAn_FOR );
SetCounterName( __counter );
SetUpperBound( __ub );
SetLowerBound( __lb );
}
Ejemplo n.º 4
0
void
Control::Initialize(void)
{
SetControlKind( ADaAn_NONE );
SetCounterName( "" );
SetUpperBound( NULL );
SetLowerBound( NULL );
SetCondition( NULL );
SetEnclosedAssigns( -1 , -1);
SetElseEnclosedAssigns( -1 , -1);
}
Ejemplo n.º 5
0
void MERGE::SignalSource::ParseParameters()
{
    SourceParametersT params = GetSourceParameters();

    if (params.size() != Parameters::SOURCE_PARAM_N)
    {
        throw std::runtime_error("Invalid number of source parameters: " + m_SourceDescription);
    }
    else
    {
        SetFormat(params[Parameters::LOG_FORMAT]);
        SetSyncPoint(params[Parameters::SYNC_POINT]);
        SetTimeUnit(params[Parameters::TIME_UNIT]);
        SetPrefix(params[Parameters::PREFIX]);
        SetCounterName(params[Parameters::LINE_COUNTER]);
        SetFilename(params[Parameters::FILENAME]);
    }
}