예제 #1
0
//---------------------------------------------------------------------------
//	@function:
//		CErrorContext::Record
//
//	@doc:
//		Grab error context and save it off and format error message
//
//---------------------------------------------------------------------------
void
CErrorContext::Record
	(
	CException &exc,
	VA_LIST vl
	)
{
	if (m_fSerializing)
		return;

#ifdef GPOS_DEBUG
	if (m_fPending)
	{
		// reset pending flag so we can throw from here
		m_fPending = false;
		
		GPOS_ASSERT(!"Pending error unhandled when raising new error");
 	}
#endif // GPOS_DEBUG
	
	m_fPending = true;
	m_exc = exc;
	
	// store stack, skipping current frame
	m_sd.BackTrace(1);

	ELocale eloc = ITask::PtskSelf()->Eloc();
	CMessage *pmsg = CMessageRepository::Pmr()->PmsgLookup(exc, eloc);
	pmsg->Format(&m_wss, vl);

	m_ulSev = pmsg->UlSev();

	if (GPOS_FTRACE(EtracePrintExceptionOnRaise))
	{
		std::wcerr << GPOS_WSZ_LIT("Exception: ") << m_wss.Wsz() << std::endl;
	}
}
예제 #2
0
//---------------------------------------------------------------------------
//	@function:
//		CMessageTest::EresUnittest_Basic
//
//	@doc:
//
//---------------------------------------------------------------------------
GPOS_RESULT
CMessageTest::EresUnittest_Basic
	(
	const void *pv,
	...
	)
{	
	const ULONG ulSize = 2048;
	
	IMemoryPool *pmp = (IMemoryPool*)pv;

	// take pre-defined assertion exc message
	CMessage *pmsg = CMessage::Pmsg(CException::ExmiAssert);
	
	GPOS_ASSERT(GPOS_MATCH_EX(pmsg->m_exc,
							  CException::ExmaSystem, 
							  CException::ExmiAssert));
		
	// target buffer for format test
	WCHAR *wsz = GPOS_NEW_ARRAY(pmp, WCHAR, ulSize);
	CWStringStatic wss(wsz, ulSize);

	VA_LIST vl;
	VA_START(vl, pv);
	
	// manufacture an OOM message (no additional parameters)
	pmsg->Format(&wss, vl);
	
	VA_END(vl);
	
	GPOS_TRACE(wsz);
	
	GPOS_DELETE_ARRAY(wsz);
	
	return GPOS_OK;
}
예제 #3
0
// generates the message list with signals and value descriptors
void CConverter::GenerateMessageList(fstream& fileInput)
{
    char acLine[defCON_MAX_LINE_LEN]; // I don't expect one line to be more than this
    // Flag to skip signal parsing of independent messages
    BOOL bSkipSignalParsing = FALSE;

    // parsing the input file
    while(fileInput.getline(acLine, defCON_MAX_LINE_LEN))
    {
        char* pcToken;
        char* pcNextToken;
        char* pcLine;
        // avoid leading <spaces> before tokenising, so passing the
        // starting point will be correct in each case, when calling
        // msg.Format, sig.Format etc.
        pcLine = acLine;

        while(*pcLine && *pcLine == ' ')
        {
            *pcLine++;
        }

        pcToken = strtok_s(pcLine, " :", &pcNextToken);

        if(pcToken)
        {
            //compare token to known types to interpret the line further

            // new line - skip
            if(strcmp(pcToken,"\n") == 0)
            {
                continue;
            }
            // message
            else if(strcmp(pcToken,"BO_") == 0)
            {
                CMessage msg;
                msg.Format(pcLine + strlen(pcToken)+1);

                if( msg.m_uiMsgID != 0xc0000000 ) // Vector independent message
                {
                    bSkipSignalParsing = FALSE;
                    // add the new message to the list
                    m_listMessages.AddTail(msg);
                }
                else
                {
                    bSkipSignalParsing = TRUE;
                }
            }
            // signal
            else if(strcmp(pcToken,"SG_") == 0)
            {
                if( bSkipSignalParsing == FALSE )
                {
                    CSignal sig;
                    sig.Format(pcLine + strlen(pcToken)+1);
                    POSITION pos = m_listMessages.GetTailPosition();
                    CMessage& msg = m_listMessages.GetAt(pos);
                    msg.m_listSignals.AddTail(sig);
                    // this signal should belong to the last message
                    msg.m_ucNumOfSignals++; // increment the signal count
                }
            }
            // value descriptor
            else if(strcmp(pcToken,"VAL_") == 0)
            {
                // <msgid><sp><signalName><sp><value1><sp><"desc1"><sp><value2><sp><"desc2"> ...;
                // get MsgId, find the message from the messagelist.
                // find the signal from the message, then add the value descritors
                // to the respective signals
                pcLine = pcLine + strlen(pcToken) + 1; // to get next token
                pcToken = strtok_s(pcLine, " ", &pcNextToken); // msgid
                unsigned int id = (unsigned int)atoi(pcToken);
                POSITION posMsg = m_listMessages.GetHeadPosition();

                while(posMsg != NULL)
                {
                    CMessage& rMsg = m_listMessages.GetNext(posMsg);

                    // find matching message from list
                    if(rMsg.m_uiMsgID == id)
                    {
                        pcLine = pcLine + strlen(pcToken) + 1; // to get next token
                        pcToken = strtok_s(pcLine, " ", &pcNextToken); // Signal name
                        POSITION posSig = rMsg.m_listSignals.GetHeadPosition();

                        // find matching signal
                        while(posSig != NULL)
                        {
                            //  char *pcToken1;
                            CSignal& rSig =  rMsg.m_listSignals.GetNext(posSig);

                            if(strcmp(rSig.m_acName.c_str(),pcToken) == 0)
                            {
                                rSig.AddValueDescriptors(pcLine + strlen(pcToken) + 1);
                                break; // if we got the signal we wanted
                            }
                        }

                        break; // we got the message we wanted
                    }
                }
            }
            // signal value qualifier
            else if(strcmp(pcToken,"SIG_VALTYPE_") == 0)
            {
                // <msgID> <signal name> : 1 -- float
                // <msgID> <signal name> : 2 -- double
                // get MsgId, find the message from the messagelist.
                // find the signal from the message, then update the
                // signal type appropriately of the respective signal
                pcToken = strtok_s(NULL, " :;", &pcNextToken); // msgid
                unsigned int id = (unsigned int)atoi(pcToken);
                POSITION posMsg = m_listMessages.GetHeadPosition();

                while(posMsg != NULL)
                {
                    CMessage& rMsg = m_listMessages.GetNext(posMsg);

                    // find matching message from list
                    if(rMsg.m_uiMsgID == id)
                    {
                        pcToken = strtok_s(NULL, " :;", &pcNextToken); // Signal name
                        POSITION posSig = rMsg.m_listSignals.GetHeadPosition();

                        // find matching signal
                        while(posSig != NULL)
                        {
                            CSignal& rSig =  rMsg.m_listSignals.GetNext(posSig);

                            if(strcmp(rSig.m_acName.c_str(),pcToken) == 0)
                            {
                                if(pcToken = strtok_s(NULL, " :;", &pcNextToken)) // qualifier (1 or 2)
                                {
                                    // update signal type based on qualifier
                                    switch(*pcToken)
                                    {
                                        case '1':
                                            rSig.m_ucType = CSignal::SIG_TYPE_FLOAT;
                                            break;

                                        case '2':
                                            rSig.m_ucType = CSignal::SIG_TYPE_DOUBLE;
                                            break;

                                        default:
                                            break;
                                    }
                                }

                                break; // we got the signal we wanted
                            }
                        }

                        break; // we got the message we wanted
                    }
                }
            }
            // anything else skip
            else
            {
                continue;
            }
        }
    }
}
예제 #4
0
/**
 * \brief Generates the message list
 *
 * This function will parse the input file and line by line
 * and generates  a list of message,signal,value table,comments,etc
 */
void CDBFConverter::GenerateMessageList(fstream& fileInput)
{
    char acLine[defCON_MAX_LINE_LEN]; // I don't expect one line to be more than this
    string local_copy;
    char* pcTok;
    int flag=0;
    int _flag_BS_= 0; //possible values 0,1,2// this flag is used to check if parsing is done in between NS_: and BS_:  #git issue 174

    // parsing the input file
    while(fileInput.getline(acLine, defCON_MAX_LINE_LEN))
    {
        char* pcToken=0, *pcLine=0;

        for (;;)
        {
            pcLine = acLine;
            pcLine += strlen(pcLine); // go to last position
            pcLine --;

            if (*pcLine == '\r')
            {
                fileInput.getline(pcLine, defCON_MAX_LINE_LEN);
            }
            else
            {
                break;
            }
        }

        // avoid leading <spaces> before tokenising, so passing the
        // starting point will be correct in each case, when calling
        // msg.Format, sig.Format etc.
        local_copy = acLine;
        pcLine = acLine;

        while(*pcLine && *pcLine == ' ')
        {
            *pcLine++;
        }

        pcToken = strtok_s(pcLine, " :", &pcTok);

        if(pcToken)
        {
            //compare token to known types to interpret the line further
            if(strstr(pcToken, "BS_") != NULL)  // git issue #174
            {
                if (_flag_BS_ == 1 )
                {
                    _flag_BS_ = 2;    // this means just NS_ and BS_ are done.
                }
            }
            if(strstr(pcToken, "NS_") != NULL)
            {
                if (_flag_BS_ == 0 )
                {
                    _flag_BS_ = 1;    // this means just NS_ is hit and BS_ is still due.
                }
            }

            // new line - skip
            else if(strcmp(pcToken, "\n") == 0)
            {
                continue;
            }
            // message
            else if(strcmp(pcToken, "BO_") == 0)
            {
                CMessage msg;
                msg.Format(pcLine + strlen(pcToken)+1);

                // add the new message to the list
                if((msg.m_acName != "VECTOR__INDEPENDENT_SIG_MSG") && !(msg.m_uiMsgID == 3221225472) )
                {
                    if( CAN == m_eBus )
                    {
                        if( msg.m_ucLength <= 8 )
                        {
                            CDBFConverter::valid_msg = true;
                            m_listMessages.push_back(msg);
                        }
                        else
                        {
                            CDBFConverter::valid_msg = false;
                            m_unsupList.push_back(msg);
                        }
                    }
                    else
                    {
                        CDBFConverter::valid_msg = true;
                        m_listMessages.push_back(msg);
                    }
                }
                else
                {
                    CDBFConverter::valid_msg = false;
                }
            }
            // signal
            else if(strcmp(pcToken, "SG_") == 0)
            {
                CSignal sig;
                sig.Format(pcLine + strlen(pcToken) + 1);

                //if signal associated with a msg add it to that perticular list
                //elses add it to msg independent list
                if(CDBFConverter::valid_msg == true)
                {
                    //insert signals in sorted order
                    int flag = 0;
                    CMessage& msg = m_listMessages.back();

                    /* if (msg.m_listSignals.empty())
                     {
                         msg.m_listSignals.push_front(sig);
                         flag = 1;
                         continue;
                     }

                     int count = 0;
                     list<CSignal>::iterator sig1 = msg.m_listSignals.end();

                     while(sig1!=msg.m_listSignals.begin())
                     {
                         --sig1;
                         count++;

                         if(((sig1->m_ucWhichByte * 8) + sig1->m_ucStartBit) > ((sig.m_ucWhichByte * 8) + sig.m_ucStartBit))
                         {
                             ++sig1;
                             msg.m_listSignals.insert(sig1, sig);
                             flag = 1;
                             break;
                         }
                     }

                     if (flag == 0)*/
                    {
                        msg.m_listSignals.push_back(sig);
                    }

                    // this signal should belong to the last message
                    msg.m_ucNumOfSignals++; // increment the signal count
                }
                else
                {
                    sig.m_ucWhichByte = 1;
                    sig.m_ucStartBit = 0;
                    m_listSignal.push_back(sig);
                }
            }
            // value descriptor
            else if(strcmp(pcToken, "VAL_") == 0)
            {
                // <msgid><sp><signalName><sp><value1><sp><"desc1"><sp><value2><sp><"desc2"> ...;
                // get MsgId, find the message from the messagelist.
                // find the signal from the message, then add the value descritors
                // to the respective signals
                pcLine = pcLine + strlen(pcToken) + 1; // to get next token
                pcToken = strtok_s(pcLine, " ", &pcTok); // msgid
                unsigned int id = (unsigned int) strtoul(pcToken, NULL, 10);

                if(id != 3221225472)
                {
                    list<CMessage>::iterator rMsg;

                    for(rMsg=m_listMessages.begin(); rMsg!=m_listMessages.end(); ++rMsg)
                    {
                        // find matching message from list
                        if(rMsg->m_uiMsgID == id)
                        {
                            pcLine = pcLine + strlen(pcToken) + 1; // to get next token
                            pcToken = strtok_s(pcLine, " ", &pcTok); // Signal name
                            list<CSignal>::iterator rSig;

                            // find matching signal
                            for(rSig=rMsg->m_listSignals.begin(); rSig!=rMsg->m_listSignals.end(); ++rSig)
                            {
                                if(rSig->m_acName == pcToken)
                                {
                                    rSig->AddValueDescriptors(pcLine + strlen(pcToken) + 1, fileInput);
                                    break; // if we got the signal we wanted
                                }
                            }

                            break; // we got the message we wanted
                        }
                    }
                }
                else
                {
                    pcLine = pcLine + strlen(pcToken) + 1; // to get next token
                    pcToken = strtok_s(pcLine, " ", &pcTok); // Signal name
                    list<CSignal>::iterator rSig;

                    // find matching signal
                    for(rSig=m_listSignal.begin(); rSig!=m_listSignal.end(); ++rSig)
                    {
                        if(rSig->m_acName == pcToken)
                        {
                            rSig->AddValueDescriptors(pcLine + strlen(pcToken) + 1, fileInput);
                            break; // if we got the signal we wanted
                        }
                    }
                }
            }
            // signal value qualifier
            else if(strcmp(pcToken, "SIG_VALTYPE_") == 0)
            {
                // <msgID> <signal name> : 1 -- float
                // <msgID> <signal name> : 2 -- double
                // get MsgId, find the message from the messagelist.
                // find the signal from the message, then update the
                // signal type appropriately of the respective signal
                pcToken = strtok_s(NULL, " :;", &pcTok); // msgid
                unsigned int id = (unsigned int)strtoul(pcToken, NULL, 10);

                if(id != 3221225472)
                {
                    list<CMessage>::iterator rMsg;

                    for(rMsg=m_listMessages.begin(); rMsg!=m_listMessages.end(); ++rMsg)
                    {
                        // find matching message from list
                        if(rMsg->m_uiMsgID == id)
                        {
                            pcToken = strtok_s(NULL, " :;", &pcTok); // Signal name
                            list<CSignal>::iterator rSig;

                            // find matching signal
                            for(rSig=rMsg->m_listSignals.begin(); rSig!=rMsg->m_listSignals.end(); ++rSig)
                            {
                                if(rSig->m_acName == pcToken)
                                {
                                    if(pcToken = strtok_s(NULL, " :;", &pcTok)) // qualifier (1 or 2)
                                    {
                                        // update signal type based on qualifier
                                        switch(*pcToken)
                                        {
                                            case '1':
                                                rSig->m_ucType = CSignal::SIG_TYPE_FLOAT;
                                                break;

                                            case '2':
                                                rSig->m_ucType = CSignal::SIG_TYPE_DOUBLE;
                                                break;

                                            default:
                                                break;
                                        }
                                    }

                                    break; // we got the signal we wanted
                                }
                            }

                            break; // we got the message we wanted
                        }
                    }
                }
                else
                {
                    pcToken = strtok_s(NULL, " :;", &pcTok); // Signal name
                    // find matching signal
                    list<CSignal>::iterator rSig;

                    for(rSig=m_listSignal.begin(); rSig!=m_listSignal.end(); ++rSig)
                    {
                        if(rSig->m_acName == pcToken)
                        {
                            if(pcToken = strtok_s(NULL, " :;", &pcTok)) // qualifier (1 or 2)
                            {
                                // update signal type based on qualifier
                                switch(*pcToken)
                                {
                                    case '1':
                                        rSig->m_ucType = CSignal::SIG_TYPE_FLOAT;
                                        break;

                                    case '2':
                                        rSig->m_ucType = CSignal::SIG_TYPE_DOUBLE;
                                        break;

                                    default:
                                        break;
                                }
                            }

                            break; // we got the signal we wanted
                        }
                    }
                }
            }
            //value table
            else if(strcmp(pcToken, "VAL_TABLE_") == 0)
            {
                CValueTable tab;
                pcToken = strtok_s(pcLine, " ", &pcTok);
                tab.Format(pcLine + strlen(pcToken) + 1, fileInput);
                m_vTab.push_back(tab);
            }
            //comments
            else if(strcmp(pcToken, "CM_") == 0)
            {
                string comment = pcTok; // for network node - venkat
                pcLine = pcLine + strlen(pcToken) + 1;
                pcToken = strtok_s(pcLine, " ", &pcTok);
                CComment cm;

                //comments related to node
                if(strcmp(pcToken, "BU_") == 0)
                {
                    pcToken = strtok_s(NULL, " ", &pcTok);
                    cm.m_elementName= pcToken;
                    pcToken = strtok_s(NULL, "", &pcTok);
                    comment = pcToken;

                    while(strstr(pcToken, "\";") == NULL)
                    {
                        fileInput.getline(acLine, defCON_MAX_LINE_LEN);
                        pcToken = acLine;
                        comment = comment + pcToken;
                    }

                    cm.m_comment= comment;
                    m_cmNode.push_back(cm);
                }
                //comments related to messages
                else if(strcmp(pcToken,"BO_") == 0)
                {
                    pcToken = strtok_s(NULL, " ", &pcTok);
                    cm.m_msgID = strtoul(pcToken, NULL, 10);

                    // set the id and frame format
                    // canoe puts MSbit = 1 for extended ID
                    if(cm.m_msgID < 0x80000000UL)
                    {
                        cm.m_msgType= 'S';
                    }
                    else
                    {
                        cm.m_msgType= 'X';
                        cm.m_msgID  &= 0x7FFFFFFF;
                    }

                    pcToken = strtok_s(NULL, "", &pcTok);
                    comment = pcToken;

                    while(strstr(pcToken, "\";") == NULL)
                    {
                        fileInput.getline(acLine, defCON_MAX_LINE_LEN);
                        pcToken = acLine;
                        comment = comment + pcToken;
                    }

                    cm.m_comment= comment;
                    m_cmMsg.push_back(cm);
                }
                //comments related to signals
                else if(strcmp(pcToken, "SG_") == 0)
                {
                    pcToken = strtok_s(NULL, " ", &pcTok);
                    cm.m_msgID = strtoul(pcToken, NULL, 10);

                    if(cm.m_msgID < 0x80000000UL)
                    {
                        cm.m_msgType = 'S';
                    }
                    else
                    {
                        cm.m_msgType = 'X';
                        cm.m_msgID &= 0x7FFFFFFF;
                    }

                    pcToken = strtok_s(NULL, " ", &pcTok);
                    cm.m_elementName = pcToken;
                    pcToken = strtok_s(NULL, "", &pcTok);
                    comment = pcToken;

                    while(strstr(pcToken, "\";") == NULL)
                    {
                        fileInput.getline(acLine, defCON_MAX_LINE_LEN);
                        pcToken = acLine;
                        comment = comment + pcToken;
                    }

                    cm.m_comment= comment;
                    m_cmSig.push_back(cm);
                }
                //comments related to network
                else
                {
                    //comment = pcToken;
                    int nRetVal = comment.find(";");
                    if( nRetVal < 0)
                    {
                        while(strstr(pcToken, "\";") == NULL)
                        {
                            fileInput.getline(acLine, defCON_MAX_LINE_LEN);
                            pcToken = acLine;
                            comment = comment + pcToken;
                        }
                    }

                    cm.m_comment= comment;
                    m_cmNet.push_back(cm);
                }
            }
            // node
            else if(strcmp(pcToken, "BU_") == 0)
            {
                create_Node_List(pcLine + strlen(pcToken)+1);
            }
            else if ( ( (strcmp(pcToken, "BA_DEF_")==0) || (strcmp(pcToken, "BA_DEF_REL_")==0)) && _flag_BS_ > 1)
            {
                CParameter pObj;
                pObj.Format(pcLine + strlen(pcToken) + 1); // to get next token
                m_listParameters.push_back(pObj);
            }
            //Param Initial Values
            else if(strcmp(pcToken, "BA_DEF_DEF_")==0 && _flag_BS_ > 1 )
            {
                char acTemp[defCON_TEMP_LEN],*pcTemp;
                pcTemp = acTemp;
                pcToken = strtok_s(NULL, "\"", &pcTok);
                pcToken = strtok_s(NULL, "\"", &pcTok);
                flag=0;

                while(*pcToken && *pcToken != '"')
                {
                    *pcTemp++ = *pcToken++;
                }

                *pcTemp = '\0';
                list<CParameter>::iterator rParam;

                for(rParam=m_listParameters.begin(); rParam!=m_listParameters.end(); ++rParam)
                {
                    // find matching Parameter from list
                    if(rParam->m_ParamName == acTemp)
                    {
                        pcTemp=acTemp;
                        pcToken = strtok_s(NULL, ";", &pcTok); // default val
                        rParam->ReadDefaultVal(pcToken);
                        flag=1;
                        break;
                    }
                }

                if(flag==0)
                {
                    string errString = "BA_DEF_DEF_ \"";
                    errString += acTemp;
                    errString += "\" ";
                    errString += pcToken;
                    errString += _(" : Match not Found in Param List\n");
                    defList.push_back(errString);
                }
            }
            //RX,Tx Parameter Definition
            else if(strcmp(pcToken,"BA_DEF_DEF_REL_")==0 && _flag_BS_ > 1)
            {
                char acTemp[defCON_TEMP_LEN],*pcTemp;
                pcTemp = acTemp;
                flag = 0;
                pcToken = strtok_s(NULL, "\"", &pcTok);

                while(*pcToken && (*pcToken != '"'))
                {
                    *pcTemp++ = *pcToken++; // copy SIG_NAME only, i.e. till first 'space'
                }

                *pcTemp = '\0';
                list<CParameter>::iterator rParam;

                for(rParam=m_listParameters.begin(); rParam!=m_listParameters.end(); ++rParam)
                {
                    // find matching Parameter from list
                    if(rParam->m_ParamName == acTemp)
                    {
                        pcTemp = acTemp;
                        pcToken = strtok_s(NULL, ";", &pcTok); // default val
                        rParam->ReadDefaultVal(pcToken);
                        flag=1;
                        break;
                    }
                }

                if(flag==0)
                {
                    string errString = "BA_DEF_DEF_REL \"";
                    errString += acTemp;
                    errString += "\" ";
                    errString += pcToken;
                    errString += _(" : Match not Found in Param List\n");
                    defList.push_back(errString);
                }
            }
            // Parameter Other values //
            else if(strcmp(pcToken, "BA_")==0)
            {
                char acTemp[defCON_TEMP_LEN],*pcTemp;
                pcTemp = acTemp;

                while(*pcLine && (*pcLine == ' '))
                {
                    *pcLine++;
                }

                //get Param name
                pcLine = pcLine + strlen(pcToken) + 1;
                pcToken = strtok_s(pcLine, "\"", &pcTok);

                while(*pcToken && (*pcToken != '"'))
                {
                    *pcTemp++ = *pcToken++;
                }

                *pcTemp = '\0';
                list<CParameter>::iterator rParam;

                for(rParam=m_listParameters.begin(); rParam!=m_listParameters.end(); ++rParam)
                {
                    // find matching Parameter from list
                    if(rParam->m_ParamName == acTemp)
                    {
                        rParam->FormatParamValue(pcLine + strlen(acTemp) + 3); // to get next token
                        pcTemp=acTemp;
                        if(rParam->m_ParamName == SIGNAL_LONG_NAME)
                        {
                            CParameterValues uParamVal = rParam->m_listParamValues[3].back();
                            vUpdateSignalNameFromParam(uParamVal);
                            int i = 0;
                        }
                        else if(rParam->m_ParamName == MESSAGE_LONG_NAME)
                        {
                            CParameterValues uParamVal = rParam->m_listParamValues[2].back();
                            vUpdateMessageNameFromParam(uParamVal);
                            int i = 0;
                        }

                        break;
                    }
                }
            }
            //maintain a list of lines not processed
            else
            {
                string str = local_copy;
                m_notProcessed.push_back(str);
                continue;
            }
        }
    }
}
예제 #5
0
/**
 * \brief     Generate Message List
 * \param[in] fileInput Input file
 *
 * This function will parse the input file and line by line
 * and generates a list of message,signal,value table,comments,etc
 */
void CConverter::GenerateMessageList(fstream& fileInput)
{
    char acLine[defCON_MAX_LINE_LEN]; // I don't expect one line to be more than this
    bool valTab = false;
    list<CMessage>::iterator posMsg;
    list<CSignal>::iterator posSig;
    // parsing the input file

    while(fileInput.getline(acLine,defCON_MAX_LINE_LEN))
    {
        char* pcToken;
        char* pcNextToken;
        char* pcLine;
        // avoid leading <spaces> before tokenising, so passing the
        // starting point will be correct in each case, when calling
        // msg.Format, sig.Format etc.
        pcLine = acLine;

        while(*pcLine && *pcLine == ' ')
        {
            *pcLine++;
        }

        pcToken = strtok_s(pcLine, " ", &pcNextToken);

        if(pcToken)
        {
            //compare token to known types to interpret the line further

            // new line - skip
            if(strcmp(pcToken,"\n") == 0)
            {
                continue;
            }
            // message
            else if(strcmp(pcToken,"[START_MSG]") == 0)
            {
                bool found = false;
                CMessage msg;
                msg.Format(pcLine + strlen(pcToken)+1);

                // find the message
                for(posMsg=m_listMessages.begin(); posMsg!=m_listMessages.end(); ++posMsg)
                {
                    if((posMsg->m_uiMsgID == msg.m_uiMsgID) && (posMsg->m_cFrameFormat == msg.m_cFrameFormat))
                    {
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    m_listMessages.push_back(msg);
                    posMsg = m_listMessages.end();
                    --posMsg;
                }
            }
            else if(strcmp(pcToken,"[START_SIG_LIST]") == 0)
            {
                CMessage msg;
                msg.m_sName = "VECTOR__INDEPENDENT_SIG_MSG";
                msg.m_sTxNode = "Vector__XXX";
                msg.m_ucLength = 0;
                msg.m_uiMsgID = 3221225472;
                CConverter::ucMsg_DLC = 8;
                m_listMessages.push_front(msg);
                posMsg = m_listMessages.begin();
                fileInput.getline(acLine,defCON_MAX_LINE_LEN);
                pcToken = strtok_s(pcLine, " ", &pcNextToken);

                while(strcmp(acLine,"[END_SIG_LIST]") != 0)
                {
                    pcToken = strtok_s(pcLine, " ", &pcNextToken);

                    if(strcmp(pcToken,"[START_SIGNALS]") == 0)
                    {
                        CSignal sig;
                        sig.Format(pcLine + strlen(pcToken)+1);
                        sig.m_ucStartBit = 0;
                        posMsg->m_listSignals.push_front(sig);
                        posSig = posMsg->m_listSignals.begin();
                    }
                    else if(strcmp(pcToken,"[VALUE_DESCRIPTION]") == 0)
                    {
                        CValueDescriptor val;
                        val.Format(pcLine + strlen(pcToken)+1);
                        posSig->m_listValueDescriptor.push_front(val);
                    }

                    fileInput.getline(acLine,defCON_MAX_LINE_LEN);
                }
            }
            else if(strcmp(pcToken,"[START_SIGNALS]") == 0)
            {
                CSignal sig;
                sig.Format(pcLine + strlen(pcToken)+1);
                posMsg->m_listSignals.push_front(sig);
                posSig = posMsg->m_listSignals.begin();
            }
            else if(strcmp(pcToken,"[VALUE_DESCRIPTION]") == 0 && valTab == false)
            {
                CValueDescriptor val;
                val.Format(pcLine + strlen(pcToken)+1);
                posSig->m_listValueDescriptor.push_front(val);
            }
            else if(strcmp(pcToken,"[START_NOT_SUPPORTED]") == 0)
            {
            }
            //nodes
            else if(strcmp(pcToken,"[NODE]") == 0)
            {
                create_Node_List(pcLine + strlen(pcToken)+1);
            }
            else if(strcmp(pcToken,"[START_VALUE_TABLE]")==0)
            {
                while(fileInput.getline(acLine,defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_VALUE_TABLE]")!=0)
                {
                    pcLine = acLine;
                    pcToken=strtok_s(pcLine, " ", &pcNextToken);

                    if(strcmp(pcToken,"[START_TABLE]")==0)
                    {
                        CValueTable vTab;
                        vTab.Format_ValueTable(pcLine + strlen(pcToken)+1,fileInput);
                        m_vTab.push_back(vTab);
                    }
                }
            }
            else if(strcmp(pcToken,"[START_PARAM]")==0)
            {
                while(fileInput.getline(acLine,defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM]")!=0)
                {
                    pcLine = acLine;
                    CParameter rParam;

                    if(strcmp(pcLine,"[START_PARAM_NET]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_NET]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,0);
                            m_listParameterArray[0].push_back(rParam);
                        }
                    }
                    else if(strcmp(pcToken,"[START_PARAM_NODE]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_NODE]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,1);
                            m_listParameterArray[1].push_back(rParam);
                        }
                    }
                    else if(strcmp(pcToken,"[START_PARAM_MSG]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_MSG]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,2);
                            m_listParameterArray[2].push_back(rParam);
                        }
                    }
                    else if(strcmp(pcToken,"[START_PARAM_SIG]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_SIG]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,3);
                            m_listParameterArray[3].push_back(rParam);
                        }
                    }
                    else if(strcmp(pcToken,"[START_PARAM_NODE_RX_SIG]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_NODE_RX_SIG]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,4);
                            m_listParameterArray[4].push_back(rParam);
                        }
                    }
                    else if(strcmp(pcToken,"[START_PARAM_NODE_TX_MSG]")==0)
                    {
                        while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_NODE_TX_MSG]")!=0)
                        {
                            pcLine = acLine;
                            rParam.Format_ParamDef(pcLine,5);
                            m_listParameterArray[5].push_back(rParam);
                        }
                    }
                }
            }
            else if(strcmp(pcToken,"[START_PARAM_VAL]")==0)
            {
                while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_PARAM_VAL]")!=0)
                {
                    pcLine = acLine;
                    CParameter tParam;

                    if(strcmp(pcLine,"[START_PARAM_NET_VAL]")==0)
                    {
                        tParam.Format_NetParam_Value(fileInput,m_listParameterArray[0]);
                    }
                    else if(strcmp(pcLine,"[START_PARAM_NODE_VAL]")==0)
                    {
                        tParam.Format_NodeParam_Value(fileInput,m_listParameterArray[1]);
                    }
                    else if(strcmp(pcLine,"[START_PARAM_MSG_VAL]")==0)
                    {
                        tParam.Format_MesgParam_Value(fileInput,m_listParameterArray[2]);
                    }
                    else if(strcmp(pcLine,"[START_PARAM_SIG_VAL]")==0)
                    {
                        tParam.Format_SigParam_Value(fileInput,m_listParameterArray[3]);
                    }
                }
            }
            else if(strcmp(pcToken,"[START_DESC]")==0)
            {
                while(fileInput.getline(acLine, defCON_MAX_LINE_LEN) && strcmp(acLine, "[END_DESC]")!=0)
                {
                    pcLine = acLine;
                    CComment tCmt;

                    if(strcmp(pcLine,"[START_DESC_NET]")==0)
                    {
                        tCmt.Format_netComment(fileInput, m_listComments[0]);
                    }
                    else if(strcmp(pcLine,"[START_DESC_NODE]")==0)
                    {
                        tCmt.Format_nodeComment(fileInput, m_listComments[1]);
                    }
                    else if(strcmp(pcLine,"[START_DESC_MSG]")==0)
                    {
                        tCmt.Format_msgComment(fileInput, m_listComments[2]);
                    }
                    else if(strcmp(pcLine,"[START_DESC_SIG]")==0)
                    {
                        tCmt.Format_sigComment(fileInput, m_listComments[3]);
                    }
                }
            }
            else if(strcmp(pcToken,"[START_NOT_PROCESSED]") == 0)
            {
                fileInput.getline(acLine,defCON_MAX_LINE_LEN);

                while(strcmp(pcToken,"[END_NOT_PROCESSED]") != 0)
                {
                    string str = acLine;
                    m_notProcessed.push_back(str);
                    fileInput.getline(acLine, defCON_MAX_LINE_LEN);
                }

                continue;
            }
            //if any other tag continue
            else
            {
                continue;
            }
        }
    }

    return ;
}