Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision 540ddb7d0104114dad454c7e4ba18fbd5d9a1c69)
+++ src/SynTree/Constant.cc	(revision 9d7b3ea1ccb5d1eccef1e7382c27f22177146c1a)
@@ -16,4 +16,5 @@
 #include <iostream>
 #include <list>
+#include <string>
 
 #include "Constant.h"
@@ -28,4 +29,16 @@
 
 Constant::~Constant() { delete type; }
+
+Constant Constant::from( int i ) {
+	return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ) );
+}
+
+Constant Constant::from( unsigned long i ) {
+	return Constant( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), std::to_string( i ) );
+}
+
+Constant Constant::from( double d ) {
+	return Constant( new BasicType( Type::Qualifiers(), BasicType::Double ), std::to_string( d ) );
+}
 
 Constant *Constant::clone() const { assert( false ); return 0; }
Index: src/SynTree/Constant.h
===================================================================
--- src/SynTree/Constant.h	(revision 540ddb7d0104114dad454c7e4ba18fbd5d9a1c69)
+++ src/SynTree/Constant.h	(revision 9d7b3ea1ccb5d1eccef1e7382c27f22177146c1a)
@@ -32,4 +32,11 @@
 	void set_value( std::string newValue ) { value = newValue; }
 
+	/// generates an integer constant of the given int
+	static Constant from( int i );
+	/// generates an integer constant of the given unsigned long int
+	static Constant from( unsigned long i );
+	/// generates a floating point constant of the given double
+	static Constant from( double d );
+
 	virtual Constant *clone() const;
 	virtual void accept( Visitor &v ) { v.visit( this ); }
