Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision 2d019af1e5dc0df0ad2bbe9c215b4c34968890c0)
+++ src/SynTree/Constant.cc	(revision 7f5683e110e3e89dd201b8df0e56ae26b4a82bcd)
@@ -42,4 +42,13 @@
 }
 
+Constant Constant::from_string( const std::string & str ) {
+	Type * charType = new BasicType( noQualifiers, BasicType::Char );
+	// Adjust the length of the string for the terminator.
+	Expression * strSize = new ConstantExpr( Constant::from_ulong( str.size() + 1 ) );
+	Type * strType = new ArrayType( noQualifiers, charType, strSize, false, false );
+	const std::string strValue = "\"" + str + "\"";
+	return Constant( strType, strValue, std::nullopt );
+}
+
 Constant Constant::null( Type * ptrtype ) {
 	if ( nullptr == ptrtype ) {
Index: src/SynTree/Constant.h
===================================================================
--- src/SynTree/Constant.h	(revision 2d019af1e5dc0df0ad2bbe9c215b4c34968890c0)
+++ src/SynTree/Constant.h	(revision 7f5683e110e3e89dd201b8df0e56ae26b4a82bcd)
@@ -47,4 +47,6 @@
 	/// generates an integer constant of the given unsigned long int
 	static Constant from_ulong( unsigned long i );
+	/// generates a string constant from the given string (char type, unquoted string)
+	static Constant from_string( const std::string & string );
 
 	/// generates a null pointer value for the given type. void * if omitted.
