Esempio n. 1
0
/**
 * Write the case out to the stream.
 *
 * @param out -- The output stream to write the if to.
 */
void Case_::Write_(Printer& out) const
{
    out.Indent();
    out.IgnoreNextIndent();

    out << "(case " << this->condition.ToString() << "\n";
    {
        Printer::TabMarker tab = out.Tab();
    }
    out.Indent();
    out << ')';
}
Esempio n. 2
0
/**
 * Write the quoted element out to the stream.
 *
 * @param out -- The output stream to write the evaluate to.
 */
void Quoted_::Write_(Printer& out) const
{
    out.Indent();
    out << "'";
    out.IgnoreNextIndent();
    this->element.Write(out);
}
Esempio n. 3
0
/**
 * Write the if out to the stream.
 *
 * @param out -- The output stream to write the if to.
 */
void If_::Write_(Printer& out) const
{
    out.Indent();
    out << "(if\n" ;
    {
        Printer::TabMarker tab = out.Tab();

        this->condition.Write(out);
        out << '\n';
        this->true_result.Write(out);
        out << '\n';
        this->false_result.Write(out);
        out << '\n';
    }
    out.Indent();
    out << ')';
}
Esempio n. 4
0
/**
 * Write the set out to the stream.
 *
 * @param out -- The output stream to write the set to.
 */
void Set_::Write_(Printer& out) const
{
    out.Indent();
    out << "(set " << this->id << ' ';
    if (this->global)
    {
        out << "~>\n";
    }
    else
    {
        out << "->\n";
    }

    {
        Printer::TabMarker marker = out.Tab();
        this->element.Write(out);
        out << '\n';
    }
    out.Indent();
    out << ')';
}
Esempio n. 5
0
void Number_::Write_(Printer& out) const
{ 
    out.Indent();
    if (this->is_int)
    {
        out << std::setprecision(0) << this->int_value ;
    }
    else
    {
        out << this->double_value;
    }
}
Esempio n. 6
0
void String_::Write_(Printer& out) const
{
    out.Indent();
    out << '"';

    std::string outputString;
    this->holder->Retrieve(outputString);
   
    out << String_::ToEscapeCharacters(outputString);

    out << '"';
}
Esempio n. 7
0
/**
 * Write the set out to the stream.
 *
 * @param out -- The output stream to write the set to.
 */
void Function_::Write_(Printer& out) const
{
    out.Indent();
    out << "(function ( ";
    
    size_t const NUMBER_OF_ARGS = this->args.size();
    for(size_t i=0; i<NUMBER_OF_ARGS; ++i)
    {
        out.IgnoreNextIndent();
        out << this->args[i].ToString() << ' '; 
    }
    out << ")\n";

    {
        Printer::TabMarker tab = out.Tab(); 
        this->body.Write(out);
        out << '\n';
    } 

    out.Indent();
    out << ')';
}
Esempio n. 8
0
/**
 * Write the set out to the stream.
 *
 * @param out -- The output stream to write the set to.
 */
void Builtin_::Write_(Printer& out) const
{
    out.Indent();
    if (this->additional_parameter.Type() == Types::NIL)
    {
        out << "(builtin \"" << Name() << "\")";
    }
    else
    {
        out << "(builtin \"" 
            << Name()
            << "\" " 
            << this->additional_parameter.ToString()
            << ")";
    }
}
Esempio n. 9
0
/**
 * Write to the output stream a description of a true element.
 * @param out -- The stream to write to.
 */
void True_::Write_(Printer& out ) const
{
    out.Indent();
    out << TRUE_TEXT;
}
Esempio n. 10
0
/**
 * Write to the output stream a description of a false element.
 * @param out -- The stream to write to.
 *
 * - JR Lewis       2012.01.13
 *   - Initial version.
 */
void False_::Write_(Printer& out ) const
{
    out.Indent();
    out << FALSE_TEXT;
}