Пример #1
0
QColor ConfigManager::parseColour(QColor deflt){
    QColor c;
    switch(tok.getnext()){
    case T_IDENT:
    case T_STRING:
        c = QColor(tok.getstring());
        return c;
        break;
    case T_DEFAULT:
        return deflt;
    default:
        throw UnexpException(&tok,"colour name or \"#rgb\"");
    }
}
Пример #2
0
static void parseWaypoint(){
    tok.getnextcheck(T_OCURLY);
    
    wpResetDefinitions();
    
    for(;;){
        char buf[256];
        tok.getnextcheck(T_IDENT);
        strcpy(buf,tok.getstring());
        wpAddField(buf,tok.getnextfloat());
        int t = tok.getnext();
        if(t==T_CCURLY)
            break;
        else if(t!=T_COMMA)
            throw UnexpException(&tok,"comma or '}'");
    }
    
    
}