Ejemplo n.º 1
0
 void mix(
     const common::byte_buffer& lhs,
     const common::byte_buffer& rhs,
     common::byte_buffer& mixed_buf) const {
   Diff left, right, mixed;
   unpack_(lhs, left);
   unpack_(rhs, right);
   mix_impl(left, right, mixed);
   pack_(mixed, mixed_buf);
 }
Ejemplo n.º 2
0
 void push(const std::string& d) {
   if (model_) {
     Diff diff;
     unpack_(d, diff);
     push_impl(diff);
   } else {
     throw JUBATUS_EXCEPTION(common::config_not_set());
   }
 }
Ejemplo n.º 3
0
 void put_diff(const common::byte_buffer& d) {
   if (model_) {
     Diff diff;
     unpack_(d, diff);
     put_diff_impl(diff);
   } else {
     throw JUBATUS_EXCEPTION(common::config_not_set());
   }
 }
Ejemplo n.º 4
0
 std::string pull(const std::string& a) const {
   if (model_) {
     std::string buf;
     PullArg arg;
     unpack_(a, arg);
     pack_(pull_impl(arg), buf);
     return buf;
   } else {
     throw JUBATUS_EXCEPTION(common::config_not_set());
   }
 }
Ejemplo n.º 5
0
Archivo: np3.c Proyecto: CViles/zork
logical synmch_()
{
    /* Initialized data */

/*   THE FOLLOWING DATA STATEMENT WAS ORIGINALLY: */

/* 	DATA R50MIN/1RA/ */

    const integer r50min = 1600;

    /* System generated locals */
    integer i__1;
    logical ret_val;

    /* Local variables */
    integer j;
    integer newj;
    integer drive, limit, qprep, sprep, dforce;

    ret_val = FALSE_;
    j = pv_1.act;
/* 						!SET UP PTR TO SYNTAX. */
    drive = 0;
/* 						!NO DEFAULT. */
    dforce = 0;
/* 						!NO FORCED DEFAULT. */
    qprep = orphs_1.oflag & orphs_1.oprep;
L100:
    j += 2;
/* 						!FIND START OF SYNTAX. */
    if (vvoc[j - 1] <= 0 || vvoc[j - 1] >= r50min) {
	goto L100;
    }
    limit = j + vvoc[j - 1] + 1;
/* 						!COMPUTE LIMIT. */
    ++j;
/* 						!ADVANCE TO NEXT. */

L200:
    unpack_(j, &newj);
/* 						!UNPACK SYNTAX. */
    sprep = syntax_1.dobj & VPMASK;
    if (! syneql_(pv_1.p1, pv_1.o1, syntax_1.dobj, syntax_1.dfl1, 
	    syntax_1.dfl2)) {
	goto L1000;
    }
    sprep = syntax_1.iobj & VPMASK;
    if (syneql_(pv_1.p2, pv_1.o2, syntax_1.iobj, syntax_1.ifl1, 
	    syntax_1.ifl2)) {
	goto L6000;
    }

/* SYNTAX MATCH FAILS, TRY NEXT ONE. */

    if (pv_1.o2 != 0) {
	goto L3000;
    } else {
	goto L500;
    }
/* 						!IF O2=0, SET DFLT. */
L1000:
    if (pv_1.o1 != 0) {
	goto L3000;
    } else {
	goto L500;
    }
/* 						!IF O1=0, SET DFLT. */
L500:
    if (qprep == 0 || qprep == sprep) {
	dforce = j;
    }
/* 						!IF PREP MCH. */
    if ((syntax_1.vflag & SDRIV) != 0) {
	drive = j;
    }
L3000:
    j = newj;
    if (j < limit) {
	goto L200;
    }
/* 						!MORE TO DO? */
/* SYNMCH, PAGE 2 */

/* MATCH HAS FAILED.  IF DEFAULT SYNTAX EXISTS, TRY TO SNARF */
/* ORPHANS OR GWIMS, OR MAKE NEW ORPHANS. */

    if (drive == 0) {
	drive = dforce;
    }
/* 						!NO DRIVER? USE FORCE. */
    if (drive == 0) {
	goto L10000;
    }
/* 						!ANY DRIVER? */
    unpack_(drive, &dforce);
/* 						!UNPACK DFLT SYNTAX. */

/* TRY TO FILL DIRECT OBJECT SLOT IF THAT WAS THE PROBLEM. */

    if ((syntax_1.vflag & SDIR) == 0 || pv_1.o1 != 0) {
	goto L4000;
    }

/* FIRST TRY TO SNARF ORPHAN OBJECT. */

    pv_1.o1 = orphs_1.oflag & orphs_1.oslot;
    if (pv_1.o1 == 0) {
	goto L3500;
    }
/* 						!ANY ORPHAN? */
    if (syneql_(pv_1.p1, pv_1.o1, syntax_1.dobj, syntax_1.dfl1, 
	    syntax_1.dfl2)) {
	goto L4000;
    }

/* ORPHAN FAILS, TRY GWIM. */

L3500:
    pv_1.o1 = gwim_(syntax_1.dobj, syntax_1.dfw1, syntax_1.dfw2);
/* 						!GET GWIM. */
    if (pv_1.o1 > 0) {
	goto L4000;
    }
/* 						!TEST RESULT. */
    i__1 = syntax_1.dobj & VPMASK;
    orphan_(- 1, pv_1.act, 0, i__1, 0);
    rspeak_(623);
    return ret_val;

/* TRY TO FILL INDIRECT OBJECT SLOT IF THAT WAS THE PROBLEM. */

L4000:
    if ((syntax_1.vflag & SIND) == 0 || pv_1.o2 != 0) {
	goto L6000;
    }
    pv_1.o2 = gwim_(syntax_1.iobj, syntax_1.ifw1, syntax_1.ifw2);
/* 						!GWIM. */
    if (pv_1.o2 > 0) {
	goto L6000;
    }
    if (pv_1.o1 == 0) {
	pv_1.o1 = orphs_1.oflag & orphs_1.oslot;
    }
    i__1 = syntax_1.dobj & VPMASK;
    orphan_(- 1, pv_1.act, pv_1.o1, i__1, 0);
    rspeak_(624);
    return ret_val;

/* TOTAL CHOMP */

L10000:
    rspeak_(601);
/* 						!CANT DO ANYTHING. */
    return ret_val;
/* SYNMCH, PAGE 3 */

/* NOW TRY TO TAKE INDIVIDUAL OBJECTS AND */
/* IN GENERAL CLEAN UP THE PARSE VECTOR. */

L6000:
    if ((syntax_1.vflag & SFLIP) == 0) {
	goto L5000;
    }
    j = pv_1.o1;
/* 						!YES. */
    pv_1.o1 = pv_1.o2;
    pv_1.o2 = j;

L5000:
    prsvec_1.prsa = syntax_1.vflag & SVMASK;
    prsvec_1.prso = pv_1.o1;
/* 						!GET DIR OBJ. */
    prsvec_1.prsi = pv_1.o2;
/* 						!GET IND OBJ. */
    if (! takeit_(prsvec_1.prso, syntax_1.dobj)) {
	return ret_val;
    }
/* 						!TRY TAKE. */
    if (! takeit_(prsvec_1.prsi, syntax_1.iobj)) {
	return ret_val;
    }
/* 						!TRY TAKE. */
    ret_val = TRUE_;
    return ret_val;

} /* synmch_ */