コード例 #1
0
void zu::xml_writer::do_assignment_node(zu::assignment_node * const node, int lvl) {
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  node->lvalue()->accept(this, lvl + 2);
  openTag("rvalue", lvl + 2);
  node->rvalue()->accept(this, lvl + 4);
  closeTag("rvalue", lvl + 2);
  closeTag(node, lvl);
}
コード例 #2
0
void zu::xml_writer::do_mem_alloc_node(zu::mem_alloc_node * const node, int lvl){
  // FIXME
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  openTag("total_elements", lvl + 2);
  node->total_elements()->accept(this, lvl + 4);
  closeTag("total_elements", lvl + 2);
  closeTag(node, lvl);
}
コード例 #3
0
void zu::xml_writer::do_if_node(zu::if_node * const node, int lvl) {
  openTag(node, lvl);
  openTag("condition", lvl + 2);
  node->condition()->accept(this, lvl + 4);
  closeTag("condition", lvl + 2);
  openTag("then", lvl + 2);
  node->block()->accept(this, lvl + 4);
  closeTag("then", lvl + 2);
  closeTag(node, lvl);
}
コード例 #4
0
void cpt::semantics::XMLwriter::processIfNode(cpt::node::IfNode * const node, int lvl) {
  openTag(node, lvl);
  openTag("condition", lvl + 2);
  node->condition()->accept(this, lvl + 4);
  closeTag("condition", lvl + 2);
  openTag("then", lvl + 2);
  node->block()->accept(this, lvl + 4);
  closeTag("then", lvl + 2);
  closeTag(node, lvl);
}
コード例 #5
0
void cpt::semantics::XMLwriter::processDoWhileNode(cpt::node::DoWhileNode * const node, int lvl) {
  openTag(node, lvl);
  openTag("instruction", lvl + 2);
  node->instruction()->accept(this, lvl + 4);
  closeTag("instruction", lvl + 2);
  openTag("condition", lvl + 2);
  node->condition()->accept(this, lvl + 4);
  closeTag("condition", lvl + 2);
  closeTag(node, lvl);
}
コード例 #6
0
void zu::xml_writer::do_mem_index_node(zu::mem_index_node * const node, int lvl){
  // FIXME
    openTag(node, lvl);
    openTag("base address", lvl + 2);
    node->base_addr()->accept(this, lvl + 4);
    closeTag("base address", lvl + 2);
    openTag("offset", lvl + 2);
    node->offset()->accept(this, lvl + 4);
    closeTag("offset", lvl + 2);
    closeTag(node, lvl);
}
コード例 #7
0
void zu::xml_writer::do_function_invocation_node(zu::function_invocation_node * const node, int lvl) {
  // FIXME
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  openTag("identifier", lvl + 2);
  node->identifier()->accept(this, lvl + 4);
  closeTag("identifier", lvl + 2);
  openTag("arguments", lvl + 2);
  if(node->args() != nullptr)
    node->args()->accept(this, lvl + 4);
  closeTag("arguments", lvl + 2);
  closeTag(node, lvl);
}
コード例 #8
0
void zu::xml_writer::do_block_node(zu::block_node * const node, int lvl){
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  openTag("declarations", lvl + 2);
  if(node->declarations() != nullptr)
      node->declarations()->accept(this, lvl + 4);
  closeTag("declarations", lvl + 2);
  openTag("instructions", lvl + 2);
  if(node->instructions() != nullptr)
      node->instructions()->accept(this, lvl + 4);
  closeTag("instructions", lvl + 2);
  closeTag(node, lvl);
}
コード例 #9
0
void zu::xml_writer::do_if_else_node(zu::if_else_node * const node, int lvl) {
  openTag(node, lvl);
  openTag("condition", lvl + 2);
  node->condition()->accept(this, lvl + 4);
  closeTag("condition", lvl + 2);
  openTag("then", lvl + 2);
  node->thenblock()->accept(this, lvl + 4);
  closeTag("then", lvl + 2);
  openTag("else", lvl + 2);
  if(node->elseblock() != nullptr)
      node->elseblock()->accept(this, lvl + 4);
  closeTag("else", lvl + 2);
  closeTag(node, lvl);
}
コード例 #10
0
//---------------------------------------------------------------------------
void cpt::semantics::XMLwriter::processBlock(cpt::node::Block * const node, int lvl) {
	openTag(node, lvl);
	if(node->declarations() != NULL) {
		openTag("declarations", lvl+2);
		node->declarations()->accept(this, lvl+4);
		closeTag("declarations", lvl+2);
	}
	if(node->instructions() != NULL) {
		openTag("instructions", lvl+2);
		node->instructions()->accept(this, lvl+4);
		closeTag("instructions", lvl+2);
	}
	closeTag(node, lvl);
}
コード例 #11
0
void zu::xml_writer::do_println_node(zu::println_node * const node, int lvl) {
  // FIXME
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  node->argument()->accept(this, lvl + 2);
  closeTag(node, lvl);
}
コード例 #12
0
void zu::xml_writer::do_var_declaration_node(zu::var_declaration_node * const node, int lvl){
  // FIXME 
  openTag(node, lvl);
  openTag("visibility", lvl + 2);
  os() << std::string(lvl + 4, ' ') << node->visibility() <<  std::endl;
  closeTag("visibility", lvl + 2);
  openTag("external", lvl + 2);
  os() << std::string(lvl + 4, ' ') << node->ext() <<  std::endl;
  closeTag("external", lvl + 2);
  openTag("type type=" + convert_types(node->type()), lvl + 2);
  closeTag("type", lvl + 2);
  openTag("identifier", lvl + 2);
  node->identifier()->accept(this, lvl + 4);
  closeTag("identifier", lvl + 2);
  closeTag(node, lvl);
}
コード例 #13
0
//---------------------------------------------------------------------------
void cpt::semantics::XMLwriter::processForDownToNode(cpt::node::ForDownToNode * const node, int lvl) {
	openTag(node, lvl);
	openTag("LeftValue", lvl+2);
	node->leftvalue()->accept(this, lvl+4);
	closeTag("LeftValue", lvl+2);
	openTag("Start", lvl+2);
	node->start()->accept(this, lvl+4);
	closeTag("Start", lvl+2);
	openTag("End", lvl+2);
	node->end()->accept(this, lvl+4);
	closeTag("End", lvl+2);
	openTag("Step", lvl+2);
	node->step()->accept(this, lvl+4);
	closeTag("Step", lvl+2);
	node->block()->accept(this, lvl+4);
	closeTag(node, lvl);
}
コード例 #14
0
void zu::xml_writer::do_function_declaration_node(zu::function_declaration_node * const node, int lvl) {
  // FIXME
  openTag(node, lvl);
  openTag("identifier", lvl + 2);
  node->identifier()->accept(this, lvl + 4);
  closeTag("identifier", lvl + 2);
  openTag("visibility", lvl + 2);
  os() << std::string(lvl + 4, ' ') << node->visibility() <<  std::endl;
  closeTag("visibility", lvl + 2);
  openTag("external", lvl + 2);
  os() << std::string(lvl + 4, ' ') << node->ext() <<  std::endl;
  closeTag("external", lvl + 2);
  if(node->return_type() != nullptr){
    openTag("return_type type=" + convert_types(node->return_type()), lvl + 2);
    closeTag("return_type", lvl + 2);
  }
  openTag("arguments", lvl + 2);
  if(node->args() != nullptr)
      node->args()->accept(this, lvl + 4);
  closeTag("arguments", lvl + 2);
  openTag("literal", lvl + 2);
  if(node->literal() != nullptr)
      node->literal()->accept(this, lvl + 4);
  closeTag("literal", lvl + 2);
  closeTag(node, lvl);
}
コード例 #15
0
//---------------------------------------------------------------------------
void cpt::semantics::XMLwriter::processFunctionDeclaration(cpt::node::FunctionDeclaration * const node, int lvl) {
	os() << std::string(lvl, ' ') << "<" << node->name() \
	     << " identifier='" << node->identifier() << "'" \
	     << " type='" << type2str(node->type()) << "'" \
	     << " is_public='" << node->is_public() << "'";
	os() << ">" << std::endl;
	if(node->arguments() != NULL) {
		openTag("Arguments", lvl+2);
		node->arguments()->accept(this, lvl+4);
		closeTag("Arguments", lvl+2);
	}
	if(node->literal() != NULL) {
		openTag("Literal", lvl+2);
		node->literal()->accept(this, lvl+4);
		closeTag("Literal", lvl+2);
	}
	closeTag(node, lvl);
}
コード例 #16
0
inline void zu::xml_writer::processBinaryExpression(cdk::binary_expression_node * const node, int lvl) {
  CHECK_TYPES(_compiler, _symtab, node);
  openTag(node, lvl);
  if(node->left() != nullptr)
      node->left()->accept(this, lvl + 2);
  if(node->right() != nullptr)
      node->right()->accept(this, lvl + 2);
  closeTag(node, lvl);
}
コード例 #17
0
bool
PlainXMLFormatter::writeHeader(std::ostream& into, const SumoXMLTag& rootElement) {
    if (myXMLStack.empty()) {
        OptionsCont::getOptions().writeXMLHeader(into);
        openTag(into, rootElement);
        return true;
    }
    return false;
}
コード例 #18
0
void cpt::semantics::XMLwriter::processFunctionCall(cpt::node::expression::FunctionCall * const node, int lvl) {
	os() << std::string(lvl, ' ') << "<" << node->name() \
	     << " identifier='" << node->identifier() << "'" \
	     << ">" << std::endl;
	openTag("arguments", lvl+2);
	node->arguments()->accept(this, lvl+4);
	closeTag("arguments", lvl+2);
	closeTag(node, lvl);
}
コード例 #19
0
void zu::xml_writer::do_for_node(zu::for_node * const node, int lvl) {
  // FIXME
  openTag(node, lvl);
  openTag("initialization", lvl + 2);
  if(node->init() != nullptr)
    node->init()->accept(this, lvl + 4);
  closeTag("initialization", lvl + 2);
  openTag("condition", lvl + 2);
  if(node->cond() != nullptr)
    node->cond()->accept(this, lvl + 4);
  else
    (new cdk::integer_node(lvl, 1))->accept(this, lvl + 4);
  closeTag("condition", lvl + 2);
  openTag("increment", lvl + 2);
  if(node->incr() != nullptr)
    node->incr()->accept(this, lvl + 4);
  closeTag("increment", lvl + 2);
  openTag("block", lvl + 2);
  node->block()->accept(this, lvl + 4);
  closeTag("block", lvl + 2);
  closeTag(node, lvl);
}
コード例 #20
0
//---------------------------------------------------------------------------
void cpt::semantics::XMLwriter::processVariableDeclaration(cpt::node::VariableDeclaration * const node, int lvl) {
	os() << std::string(lvl, ' ') << "<" << node->name() \
	     << " identifier='" << node->identifier() << "'" \
	     << " type='" << type2str(node->type()) << "'" \
	     << " is_public='" << node->is_public() << "'" \
	     << " is_const='" << node->is_const() << "'" \
	     << ">" << std::endl;
	if(node->initial_value() != NULL) {
		openTag("initial_value", lvl+2);
		node->initial_value()->accept(this, lvl+4);
		closeTag("initial_value", lvl+2);
	}
	closeTag(node, lvl);
}
コード例 #21
0
ファイル: xmlLogger.cpp プロジェクト: teragonaudio/PulseDelay
void xmlLogger::log(char *type)
{
#if USE_PC_LOGGER
  /** Algorithm: */
  /** Check to see if logging is enabled. */
  if(m_logging_enabled)
  {
    /** Open a new tag, write the current time to it, and close it. */
    openTag(type);
    writeTagAttr("time", getTime());
    closeTag();
  }
#endif
}
コード例 #22
0
std::string SoftUpdatePrefsXMLSerializer::serialize()
{
	std::string result = "";

	result += openTag( "softUpdate" );

	result += serializeTag( "versionToIgnore", _prefs.getVersionToIgnore(), false );
	result += serializeTag( "dateLastIgnored", _prefs.getDateLastIgnored(), false );
	result += serializeTag( "autoCheck",	   _prefs.autoCheck(),			false );

	result += closeTag();

	return result;
}
コード例 #23
0
ファイル: xmlLogger.cpp プロジェクト: teragonaudio/PulseDelay
void xmlLogger::logData(char *type, void *data, int length)
{
#if USE_PC_LOGGER
  /** Algorithm: */
  /** Check to see if logging is enabled. */
  if(m_logging_enabled)
  {
    /** Open a new tag and then log the data stream to it.  The tag will be automatically
    * closed afterwards. */
    openTag(type);
    writeTagAttr("time", getTime());
    writeTagData(data, length);
  }
#endif
}
コード例 #24
0
ファイル: xmlLogger.cpp プロジェクト: teragonaudio/PulseDelay
void xmlLogger::log(char *type, char *key, long value)
{
#if USE_PC_LOGGER
  /** Algorithm: */
  /** Check to see if logging is enabled. */
  if(m_logging_enabled)
  {
    /** Open a new tag, and write the key and value pair to it. */
    openTag(type);
    writeTagAttr(key, value);
    /** Write the current time in ms to the tag and then close it. */
    writeTagAttr("time", getTime());
    closeTag();
  }
#endif
}
コード例 #25
0
ファイル: xmlLogger.cpp プロジェクト: teragonaudio/PulseDelay
void xmlLogger::startSession()
{
#if USE_PC_LOGGER
  /** Algorithm: */
  /** Open up a new tag to enclose the session. */
  openTag("session");
  
  /** Get the current system date and time and log it in the session tag. */
  struct tm *t = (struct tm*)malloc(sizeof(struct tm));
  time_t now = time(NULL);
  t = localtime(&now);
  char str[32];
  snprintf(str, 32, "%02d:%02d:%02d %02d/%02d/%04d", t->tm_hour, t->tm_min, t->tm_sec,
           t->tm_mday + 1, t->tm_mon + 1, t->tm_year + 1900);
  writeTagAttr("date", str);
#endif
}
コード例 #26
0
bool
PlainXMLFormatter::writeXMLHeader(std::ostream& into, const std::string& rootElement,
                                  const std::string& attrs, const std::string& comment) {
    if (myXMLStack.empty()) {
        OptionsCont::getOptions().writeXMLHeader(into);
        if (comment != "") {
            into << comment << "\n";
        }
        openTag(into, rootElement);
        if (attrs != "") {
            into << " " << attrs;
        }
        into << ">\n";
        myHavePendingOpener = false;
        return true;
    }
    return false;
}
コード例 #27
0
ファイル: BinaryFormatter.cpp プロジェクト: fieryzig/sumo
bool
BinaryFormatter::writeXMLHeader(std::ostream& into,
                                const std::string& rootElement,
                                const std::map<SumoXMLAttr, std::string>& attrs) {
    if (myXMLStack.empty()) {
        writeStaticHeader(into);
        writeStringList(into, std::vector<std::string>());
        writeStringList(into, std::vector<std::string>());
        if (SUMOXMLDefinitions::Tags.hasString(rootElement)) {
            openTag(into, rootElement);
            for (std::map<SumoXMLAttr, std::string>::const_iterator it = attrs.begin(); it != attrs.end(); ++it) {
                writeAttr(into, it->first, it->second);
            }
            return true;
        }
    }
    return false;
}
コード例 #28
0
ファイル: xmlLogger.cpp プロジェクト: teragonaudio/PulseDelay
void xmlLogger::log(char *type, int f1, int f2, int f3, int f4)
{
#if USE_PC_LOGGER
  /** Algorithm: */
  /** Check to see if logging is enabled. */
  if(m_logging_enabled)
  {
    /** Open a new tag, then log each of the floating point arguments to it. */
    openTag(type);
    /** Write all three arguments to the tag. */
    writeTagAttr("arg1", f1);
    writeTagAttr("arg2", f2);
    writeTagAttr("arg3", f3);
    writeTagAttr("arg4", f4);
    /** Add the time and then close the tag. */
    writeTagAttr("time", getTime());
    closeTag();
  }
#endif
}
コード例 #29
0
ファイル: sgml.cpp プロジェクト: 315234/lyx-retina
void sgml::openTag(Buffer const & buf, odocstream & os,
	OutputParams const & runparams, Paragraph const & par)
{
	Layout const & style = par.layout();
	string const & name = style.latexname();
	string param = style.latexparam();
	Counters & counters = buf.params().documentClass().counters();

	string id = par.getID(buf, runparams);

	string attribute;
	if (!id.empty()) {
		if (param.find('#') != string::npos) {
			string::size_type pos = param.find("id=<");
			string::size_type end = param.find(">");
			if( pos != string::npos && end != string::npos)
				param.erase(pos, end-pos + 1);
		}
		attribute = id + ' ' + param;
	} else {
		if (param.find('#') != string::npos) {
			// FIXME UNICODE
			if (!style.counter.empty())
				// This uses InternalUpdate at the moment becuase sgml output
				// does not do anything with tracked counters, and it would need
				// to track layouts if it did want to use them.
				counters.step(style.counter, InternalUpdate);
			else
				counters.step(from_ascii(name), InternalUpdate);
			int i = counters.value(from_ascii(name));
			attribute = subst(param, "#", convert<string>(i));
		} else {
			attribute = param;
		}
	}
	openTag(os, name, attribute);
}
コード例 #30
0
bool
BinaryFormatter::writeXMLHeader(std::ostream& into,
                                const std::string& rootElement,
                                const std::string& /* attrs */,
                                const std::string& /* comment */) {
    if (myXMLStack.empty()) {
        FileHelpers::writeByte(into, BF_BYTE);
        FileHelpers::writeByte(into, 1);
        FileHelpers::writeByte(into, BF_STRING);
        FileHelpers::writeString(into, VERSION_STRING);
        writeStringList(into, SUMOXMLDefinitions::Tags.getStrings());
        writeStringList(into, SUMOXMLDefinitions::Attrs.getStrings());
        writeStringList(into, SUMOXMLDefinitions::NodeTypes.getStrings());
        writeStringList(into, SUMOXMLDefinitions::EdgeFunctions.getStrings());
        writeStringList(into, std::vector<std::string>());
        writeStringList(into, std::vector<std::string>());

        if (SUMOXMLDefinitions::Tags.hasString(rootElement)) {
            openTag(into, rootElement);
            return true;
        }
    }
    return false;
}