XMLGenerator Class Reference

NEDXML API: XMLGenerator Class Reference
NEDXML API
XMLGenerator Class Reference

Public Member Functions

 XMLGenerator ()
virtual ~XMLGenerator ()
virtual void setSourceLocationAttributes (bool srcloc)
virtual void setIndentSize (int indentsize)
virtual void generate (std::ostream &out, ASTNode *tree)
virtual std::string generate (ASTNode *tree)

Description

Serializes an AST in XML format.

Constructor & Destructor Documentation

◆ XMLGenerator()

XMLGenerator ( )
inline

Constructor

◆ ~XMLGenerator()

virtual ~XMLGenerator ( )
inlinevirtual

Destructor

Member Function Documentation

◆ setSourceLocationAttributes()

virtual void setSourceLocationAttributes ( bool srcloc)
virtual

Enable or disable generation of src-loc attributes in the output XML. src-loc attributes contain filename-line-column information that refers to the original document. For example, if the ASTNode tree was produced by parsing a NED file, src-loc attributes refer to locations in the NED file.

◆ setIndentSize()

virtual void setIndentSize ( int indentsize)
virtual

Set indent size in the output XML.

◆ generate() [1/2]

virtual void generate ( std::ostream & out,
ASTNode * tree )
virtual

Serialize the object tree as XML to the given output stream. The XML declaration will be:

<?xml version="1.0"?>

I.e. unspecified encoding, and no document type will be included.

◆ generate() [2/2]

virtual std::string generate ( ASTNode * tree)
virtual

Serialize the object tree into XML, and return the result as string.