示例#1
0
int main(int argc, char* argv[]) {
  if(argc-1 < 1) {
    cerr << "need a forms file" << endl;
    exit(1);
  }

  cerr << "reading phoenix and converting to CNF..." << endl;
  ifstream forms(argv[1]);
  PCFG g(PCFG::readPhoenixGrammarAndForms(cin, forms));
  cout << PCFG::CNF(g);
}
示例#2
0
int main(int argc, char* argv[]) {
  DebugStream::threashold_ = DebugStream::D;

  if(argc-1 < 2) {
    cerr << usage(argv[0]) << endl;
    exit(1);
  }

  ifstream forms(argv[1]);
  ifstream grammar(argv[2]);
  PCFG g(PCFG::readPhoenixGrammarAndForms(grammar, forms));
  info << "Got Phoenix forms and grammar file: " << endl 
       << g.stats() << endl;
  cout << g;
}
示例#3
0
QObjectList *Project::formList( bool resolveFakeObjects ) const
{
    QObjectList *l = new QObjectList;
    for ( QPtrListIterator<FormFile> forms(formfiles);   forms.current(); ++forms ) {
	FormFile* f = forms.current();
	if ( f->formWindow() ) {
	    if ( resolveFakeObjects && f->formWindow()->isFake() )
		l->append( objectForFakeForm( f->formWindow() ) );
	    else
		l->append( f->formWindow()->child( 0, "QWidget" ) );
	} else if ( f->isFake() ) {
	    l->append( objectForFakeFormFile( f ) );
	}
    }
    return l;
}
示例#4
0
QStringList PinHeader::collectValues(const QString & family, const QString & prop, QString & value) {
	if (prop.compare("form", Qt::CaseInsensitive) == 0) {
		QStringList values;
		foreach (QString f, forms()) {
			values.append(f);
		}
示例#5
0
    if (!PyArg_ParseTuple(args, "OO:put", &pykey, &pyvalue)) {
        return NULL;
    }
    if (FDB_SetItem(self, pykey, pyvalue)) {
        return NULL;
    }
    Py_RETURN_NONE;
}


/* FDB.putkeep(key, value) */
PyDoc_STRVAR(FDB_putkeep_doc,
"putkeep(key, value)\n\
\n\
Store a record in the database, unlike the standard forms (fdb[key] = value or\n\
put), this method raises KeyError if key is already in the database.");

static PyObject *
FDB_putkeep(FDB *self, PyObject *args)
{
    long long key;
    void *value;
    int value_size;
    PyObject *pyvalue;

    if (!PyArg_ParseTuple(args, "LO:putkeep", &key, &pyvalue)) {
        return NULL;
    }
    if (bytes_to_void(pyvalue, &value, &value_size)) {
        return NULL;
    }