Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Constant.cc

    r7f5566b r9d7b3ea  
    1616#include <iostream>
    1717#include <list>
     18#include <string>
    1819
    1920#include "Constant.h"
     
    2829
    2930Constant::~Constant() { delete type; }
     31
     32Constant Constant::from( int i ) {
     33        return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ) );
     34}
     35
     36Constant Constant::from( unsigned long i ) {
     37        return Constant( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), std::to_string( i ) );
     38}
     39
     40Constant Constant::from( double d ) {
     41        return Constant( new BasicType( Type::Qualifiers(), BasicType::Double ), std::to_string( d ) );
     42}
    3043
    3144Constant *Constant::clone() const { assert( false ); return 0; }
Note: See TracChangeset for help on using the changeset viewer.