 		public function compileToObject(expression:String):ICompiledObject
 		{
 			return finalize(compileTokens(getTokens(expression), true));
+		}
+		
+		/**
+		 * Attempts to compile an expression as a constant, then returns the constant value.
+		 * @param constantExpression
+		 * @return The value of the expression.
+		 * @throws Error if the expression cannot be evaluated as a constant.
+		 */
+		public function parseConstant(constantExpression:String):*
+		{
+			var compiled:ICompiledObject = finalize(compileTokens(getTokens(constantExpression), false), true);
+			if (compiled is CompiledConstant)
+			{
+				return (compiled as CompiledConstant).value;
+			}
+			else
+			{
+				throw new Error("Expression does not evaluate to a constant");
+			}
 		}
 		
 		/**

			{
				for (i = 0; i < params.length; i++)
				{
					params[i] = _finalize(params[i], varLookup);
					if (params[i] == null) // variable declaration eliminated?
						params.splice(i--, 1);
				}

			if (isFunctionHeader(call))
				compileFunctionDefinition(call, null); // this will throw an appropriate error
				
			call.compiledMethod = _finalize(call.compiledMethod, forceInlineObjectConstants, varLookup);
			if (!call.compiledMethod)
				throw new Error("Misplaced variable declaration");
			var params:Array = call.compiledParams;
