Example #1
0
		/////////////////////////////////////////////////////////////////////////////

		public virtual object Evaluate( IMacro macro, IMacroArguments macroArgs )
		{
			// ******
			var oee = new ExpressionEvaluator( mp );
			return oee.Evaluate( macro, macroArgs.Expression );
		}
Example #2
0
		/////////////////////////////////////////////////////////////////////////////

		public static object _SkipFirstAndEvaluate( IMacroProcessor mp, object rootObj, MacroExpression cexp )
		{
			// ******
			//if( ExpressionType.Compound != exp.NodeType ) {
			//	//
			//	// only the one expression
			//	//
			//	return rootObj;
			//}

			// ******
			//CompoundExpression cexp = exp.Cast<CompoundExpression>();
			ExpressionList expList = cexp.Items;
			
			if( expList.Count < 2 ) {
				//
				// only the one (or zero) expressions in the list
				//
				return rootObj;
			}

			// ******
			Expression first = expList[ 0 ];
			expList.RemoveAt( 0 );

			// ******
			var evaluator = new ExpressionEvaluator( mp );
			object result = evaluator.Evaluate( rootObj, cexp );

			// ******
			expList.Insert( 0, first );

			// ******
			return result;
		}
Example #3
0
		/////////////////////////////////////////////////////////////////////////////

		public static object EvaluateRemainingExpressions( IMacroProcessor mp, object rootObj, MacroExpression exp, int skipCount )
		{
			// ******
			var exp2 = exp.Clone();
			exp2.Items.RemoveRange( 0, skipCount );

			// ******
			var evaluator = new ExpressionEvaluator( mp );
			return evaluator.Evaluate( rootObj, exp2 );
		}