Exemplo n.º 1
0
void Analyzer::calculate(StateNode* state) {
	actNode = state;
	act = state->getState();
	pn = actNode->getNextPlayer();
	init();
	considerValue();
	setStateNode();
}
Exemplo n.º 2
0
/** Parse GCC dump */
void TestParser::parseGCCUnit( DumpUnitInfo *unit)
{
    total_lines_num = 0;
    DumpPos beg = unit->pos();
    DumpPos end = unit->end();
     if ( !file.isOpen() && !file.open( QIODevice::ReadOnly))
    {
        return;
    }
    file.reset();
    /** Read file line by line */
    QTextStream in( &file);
    QString line;
    unit_beg = 0;
    unit_id = 0;
    do
    {
        line = in.readLine();
        if ( total_lines_num >= beg)
        {
            break;  
        }
        total_lines_num++;
    } while ( !line.isNull());
    cur_line_num = 0;

    /** Init state */
    setStateInit();
#ifdef _DEBUG
        out( "Started parsing");
#endif
    do
    {
        curr_line = in.readLine();
        cur_line_num++;
        if ( !nextLineGCC( curr_line))
        {
            line.append( curr_line);
        } else
        {
            if ( !line.isNull())
            {
                if ( nodeStopGCC( line))
                {
                    endNode();
                    setStateDefault();
                }
                if ( nodeStartGCC( line))
                {
                    setStateNode();
                    startNode();
                }             
                parseLineGCC( line);
            }
            line = curr_line;
        }
        if ( total_lines_num >= end)
            break;
        total_lines_num++;
    } while ( !curr_line.isNull());
    if ( isStateNode())
    {
        endNode();
    }
#ifdef _DEBUG
        out( "Finished parsing");
#endif
}