Vcsn  2.2
Be Rational
vcsn::ast::context_printer Class Reference

#include <context-printer.hh>

Inheritance diagram for vcsn::ast::context_printer:
Collaboration diagram for vcsn::ast::context_printer:

Public Member Functions

 context_printer (std::ostringstream &os)
 
void header (const std::string &h)
 Record that we need an include for this header. More...
 
void header_algo (const std::string &algo)
 Record that we need an include for this algorithm. More...
 
void linkflags (const std::string &h)
 Record that we need these linker flags. More...
 
const std::string & linkflags () const
 Get the link flags. More...
 
std::ostream & print (std::ostream &o)
 Generate the code to compile on o. More...
 
virtual void visit (const automaton &t)
 
virtual void visit (const context &t)
 
virtual void visit (const expansionset &t)
 
virtual void visit (const expressionset &t)
 
virtual void visit (const genset &t)
 
virtual void visit (const letterset &t)
 
virtual void visit (const nullableset &t)
 
virtual void visit (const oneset &t)
 
virtual void visit (const other &t)
 
virtual void visit (const polynomialset &t)
 
virtual void visit (const tuple &t)
 
virtual void visit (const tupleset &t)
 
virtual void visit (const weightset &t)
 
virtual void visit (const wordset &t)
 

Private Attributes

std::ostringstream & os_
 
std::set< std::string > headers_
 Headers to include. More...
 
std::set< std::string > headers_late_
 
std::string linkflags_
 Flags to pass to the linker. More...
 

Detailed Description

Definition at line 12 of file context-printer.hh.

Constructor & Destructor Documentation

vcsn::ast::context_printer::context_printer ( std::ostringstream &  os)
inline

Definition at line 15 of file context-printer.hh.

Member Function Documentation

void vcsn::ast::context_printer::header ( const std::string &  h)

Record that we need an include for this header.

Definition at line 17 of file context-printer.cc.

References headers_.

void vcsn::ast::context_printer::header_algo ( const std::string &  algo)

Record that we need an include for this algorithm.

void vcsn::ast::context_printer::linkflags ( const std::string &  h)

Record that we need these linker flags.

Definition at line 22 of file context-printer.cc.

References linkflags_.

const std::string & vcsn::ast::context_printer::linkflags ( ) const

Get the link flags.

Definition at line 29 of file context-printer.cc.

References linkflags_.

std::ostream & vcsn::ast::context_printer::print ( std::ostream &  o)

Generate the code to compile on o.

Definition at line 34 of file context-printer.cc.

References headers_, headers_late_, and os_.

void vcsn::ast::context_printer::visit ( const automaton t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 55 of file context-printer.cc.

References vcsn::iendl(), and vcsn::incendl().

Here is the call graph for this function:

void vcsn::ast::context_printer::visit ( const context t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 96 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const expansionset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 177 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const expressionset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 169 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const genset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 151 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const letterset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 161 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const nullableset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 136 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const oneset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 144 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const other t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 201 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const polynomialset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 208 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const tuple t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 106 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const tupleset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 121 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const weightset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 185 of file context-printer.cc.

void vcsn::ast::context_printer::visit ( const wordset t)
virtual

Implements vcsn::ast::context_visitor.

Definition at line 193 of file context-printer.cc.

Member Data Documentation

std::set<std::string> vcsn::ast::context_printer::headers_
private

Headers to include.

Sadly enough functions about tupleset must be defined after the functions that define the behavior of the components. The genuine case is that of "print_set", which fails for the same reasons as the following does not compile:

template <typename T>
struct wrapper
{
T t;
};
template <typename T>
void print(const wrapper<T>& w)
{
print(w.t);
}
void print(int){}
int main()
{
wrapper<int> w;
print(w);
}

So we use a second set for "late" headers.

Definition at line 87 of file context-printer.hh.

Referenced by header(), and print().

std::set<std::string> vcsn::ast::context_printer::headers_late_
private

Definition at line 88 of file context-printer.hh.

Referenced by print().

std::string vcsn::ast::context_printer::linkflags_
private

Flags to pass to the linker.

Definition at line 91 of file context-printer.hh.

Referenced by linkflags().

std::ostringstream& vcsn::ast::context_printer::os_
private

Definition at line 55 of file context-printer.hh.

Referenced by print().


The documentation for this class was generated from the following files: