public dfa(int d_type, string d_name, int d_initial, int d_nstates, state[] d_state, string d_first) { this.d_type = d_type; this.d_name = d_name; this.d_initial = d_initial; this.d_nstates = d_nstates; this.d_state = new statePtr(d_state, 0); this.d_first = new bitset(d_first); }
public static int addbit(bitset ss, int ibit) { int ibyte = BIT2BYTE(ibit); char mask = BIT2MASK(ibit); if (0 != (ss[ibyte] & mask)) { return(0); } ss[ibyte] |= mask; return(1); }
public static void mergebitset(bitset ss1, bitset ss2, int nbits) { int i; ss1 = new bitset(ss1); ss2 = new bitset(ss2); for (i = NBYTES(nbits); --i >= 0;) { ss1[0] |= ss2[0]; ss1.inc(); ss2.inc(); } }
//20170403 //#include "pgenheaders.h" //#include "bitset.h" public static bitset newbitset(int nbits) { int nbytes = NBYTES(nbits); bitset ss = PyMem_NEW_char(nbytes); if (ss == null) { Py_FatalError("no mem for bitset"); } ss.inc(nbytes); while (--nbytes >= 0) { ss.dec(); ss[0] = (char)0; } return(ss); }
public static int samebitset(bitset ss1, bitset ss2, int nbits) { int i; ss1 = new bitset(ss1); ss2 = new bitset(ss2); for (i = NBYTES(nbits); --i >= 0;) { char ss1_c = ss1[0]; ss1.inc(); char ss2_c = ss2[0]; ss2.inc(); if (ss1_c != ss2_c) { return(0); } } return(1); }
public static bool testbit(bitset ss, int ibit) { return(false); }
public static void PyMem_DEL(ref bitset x) { }
public bitset(bitset ptr) { }
public static void delbitset(bitset ss) { PyMem_DEL(ref ss); }