Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 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 ratexpset &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 13 of file context-printer.hh.

Constructor & Destructor Documentation

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

Definition at line 16 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 81 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.

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

References ALGO, and headers_late_.

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

Record that we need these linker flags.

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

References linkflags_.

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

Get the link flags.

Definition at line 93 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 98 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 119 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 161 of file context-printer.cc.

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

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

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

Implements vcsn::ast::context_visitor.

Definition at line 234 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 86 of file context-printer.hh.

Referenced by header(), and print().

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

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

Referenced by header_algo(), and print().

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

Flags to pass to the linker.

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

Referenced by linkflags().

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

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

Referenced by print().


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