Esempio n. 1
0
// IDENTIFIER VALUE
rapidjson::Value SuperastCPP::createIdentifierValue(const std::string& name) {
  rapidjson::Value idValue(rapidjson::kObjectType);
  idValue.AddMember("type", "identifier", allocator);
  idValue.AddMember("value", 
                    rapidjson::Value().SetString(name.c_str(),
                                                 name.size(),
                                                 allocator),
                    allocator);
  return idValue;
}
Esempio n. 2
0
PassRefPtr<CustomElementConstructor> CustomElementRegistry::findFor(Element* element) const
{
    ASSERT(element->document().registry() == this);

    // Most elements can be rejected this quick screening.
    if (!nameIncludesHyphen(element->tagName()) && !element->hasAttribute(HTMLNames::isAttr))
        return 0;

    QualifiedName idValue(nullAtom, element->getAttribute(HTMLNames::isAttr), HTMLNames::xhtmlNamespaceURI);
    return find(idValue, element->tagQName());
}
int
txXMLParser::StartElement(const XML_Char *aName, const XML_Char **aAtts)
{
    nsCOMPtr<nsIAtom> prefix, localName;
    PRInt32 nsID;
    XMLUtils::splitExpatName(aName, getter_AddRefs(prefix),
                             getter_AddRefs(localName), &nsID);
    Element* newElement = mDocument->createElementNS(prefix, localName, nsID);
    if (!newElement) {
        return XML_ERROR_NO_MEMORY;
    }

    const XML_Char** theAtts = aAtts;
    while (*theAtts) {
        XMLUtils::splitExpatName(*theAtts++, getter_AddRefs(prefix),
                                 getter_AddRefs(localName), &nsID);
        nsDependentString attValue(*theAtts++);
        nsresult rv = newElement->appendAttributeNS(prefix, localName, nsID,
                                                    attValue);
        if (NS_FAILED(rv)) {
            return XML_ERROR_NO_MEMORY;
        }
    }

    int idx;
    if ((idx = XML_GetIdAttributeIndex(mExpatParser)) > -1) {
        nsDependentString idName((const PRUnichar*)*(aAtts + idx));
        nsDependentString idValue((const PRUnichar*)*(aAtts + idx + 1));
        // make sure IDs are unique
        if (!idValue.IsEmpty()) {
            mDocument->setElementID(idValue, newElement);
        }
    }
    mCurrentNode->appendChild(newElement);
    mCurrentNode = newElement;

    return XML_ERROR_NONE;
}
Esempio n. 4
0
        break;
      };
      ++w;
    };
  };
  if(!done) errorc(__LINE__);
  return result;
};

bool AdmWithLevels::s_print_knowns_bar = true;

#ifndef INCLUDED_IDVALUE_H
#include "idValue.hpp"
#endif

const int AdmWithLevels::s_ID = idValue("AdmWithLevels::s_ID");

int AdmWithLevels::multiplicity() const {
  return d_v.size();
};

void AdmWithLevels::sortIntoKnownsAndUnknowns(const VariableSet & x,
    VariableSet & knowns,VariableSet & unknowns) const {
  knowns.clear();
  unknowns.clear();
  Variable v;
  bool b = x.firstVariable(v);
  while(b) {
    if(d_knowns.present(v)) {
       knowns.insert(v);
    } else {
Esempio n. 5
0
};

void Field::operator *=(int n) {
  IntDom N(n);
  operator *=(N);
};

void Field::operator /=(const Field & x) {
  Field f = (*this) / x;
  operator=(f);
};

void Field::operator /=(const IntDom & x) {
  Field f = (*this) / x;
  operator=(f);
};

void Field::operator /=(int n) {
  IntDom N(n);
  operator /=(N);
};

void SwitchFields(int) {
  GBStream << "A call was made to the C++ routine SwitchFields"
           << " but this implementation of fields does"
           << " not allow switching. Sorry. \n"; 
};

#include "idValue.hpp"
const int Field::s_ID = idValue("Field::s_ID");
Esempio n. 6
0
#endif

ISink * NCASink::clone() const {
  return new NCASink(d_ofs);
};

void NCASink::put(const char * s) {
  d_ofs << s;
};

bool NCASink::s_showPlusWithNumbers = true;
bool NCASink::s_CollapsePowers = false;


void NCASink::errorh(int n) { DBGH(n); };

void NCASink::errorc(int n) { DBGC(n); };

const int NCASink::s_ID = idValue("NCASink::s_ID");

#ifdef USE_VIRT_FIELD
#include "Choice.hpp"
#ifdef USE_UNIX
#include "SimpleTable.c"
#else
#include "SimpleTable.cpp"
#endif
template class SimpleTable<NCASink>;
SimpleTable<NCASink> NCASink::s_table;
#endif
Esempio n. 7
0
bool MmaSink::verror() const {
  return MLError(d_mlink)!=MLEOK;
};

void MmaSink::checkforerror() const {
  if(MLError(d_mlink)!=MLEOK) errorc(__LINE__);
};

#ifdef USE_VIRT_FIELD
#ifdef USE_UNIX
#include "SimpleTable.c"
#else
#include "SimpleTable.cpp"
#endif
#ifdef OLD_GCC
template class vector<pair<int,void(*)(MmaSink&,Holder &)> >;
template class vector<pair<int,void(*)(MmaSink&,const Holder &)> >;
#endif
template class SimpleTable<MmaSink>;
SimpleTable<MmaSink> MmaSink::s_table;
#endif

void MmaSink::errorh(int n) { DBGH(n); };

void MmaSink::errorc(int n) { DBGC(n); };

#include "idValue.hpp"

const int MmaSink::s_ID = idValue("MmaSink::s_ID");