/*
 NAME
 	cexpfactory.m - source code for CExpFactory class
 VERSION
 	$Id$
 CHANGELOG
 	$Log$
 */

#include <coconut/cexpfactory.h>
#include <coconut/cexpconst.h>
#include <coconut/cint.h>

@implementation CExpFactory 

- init
{
	return [super init] ;
}

+ (id <PExp>) stringToExp: (id <PString>) str
{
	id <PExp>	result = nil ;
	int		intres ;

	/* check it is constant or not */
	if([CInt strToInt: [str ptr] to: &intres] == nil){
		result = [CExpConst newExpConstInt: intres format: dec_format] ;
	}
	return result ;
}

@end

