Summary description for EngineConfiguration.
Inheritance: NodeBase
Beispiel #1
0
		/// <summary>
		/// Constructs an AspectEngine
		/// </summary>
		/// <param name="config">From where to gather the 
		/// configuration</param>
		public AspectEngine(EngineConfiguration config)
		{
			AssertUtil.ArgumentNotNull(config, "config");
			_config = config;
			_aspectMatcher = new DefaultAspectMatcher();
			_proxyFactory = new DefaultProxyFactory(this);
		}
Beispiel #2
0
		public virtual void Process(Context context, EngineConfiguration configuration)
		{
			if (Next != null)
			{
				Next.Process(context, configuration);
			}
		}
Beispiel #3
0
		public override AspectEngine Build()
		{
			if (!_node.Name.Equals("configuration"))
			{
				throw new BuilderException("Invalid root node. Expecting 'configuration'");
			}

			XmlNode contentNode = _node;

			if (contentNode.FirstChild.NodeType == XmlNodeType.Whitespace ||
				contentNode.FirstChild.NodeType == XmlNodeType.Text)
			{
				base.Reader = new StringReader(contentNode.InnerText);
				return base.Build();
			}
			else if (contentNode.FirstChild.NodeType == XmlNodeType.CDATA)
			{
				// CData node containing language configuration
				// Parse it 

				base.Reader = new StringReader(contentNode.FirstChild.Value);
				return base.Build();
			}

			Configuration = new EngineConfiguration();

			LoadImports();
			LoadGlobals();
			LoadAspects();

			ExecuteSteps();

			return new AspectEngine(Configuration);
		}
Beispiel #4
0
		public override void Process(Context context, EngineConfiguration conf)
		{
			Init(context);
			Visit(conf);

			if (!context.HasErrors)
			{
				base.Process(context, conf);
			}
		}
Beispiel #5
0
		public override void Process(Context context, EngineConfiguration conf)
		{
			base.Init(context);

			CheckImports(conf.Imports);
			CheckGlobals(conf);
			CheckAspects(conf.Aspects);

			if (!context.HasErrors)
			{
				base.Process(context, conf);
			}
		}
Beispiel #6
0
		private void CheckGlobals(EngineConfiguration conf)
		{
			CheckMixins(conf.Mixins.ToDictionary());
			CheckInterceptors(conf.Interceptors.ToDictionary());
		}
		protected SemanticAnalizerStep Analize(EngineConfiguration conf, IStep next)
		{
			SemanticAnalizerStep analizer = new SemanticAnalizerStep();
			analizer.Next = next;
			_context = new Context();
			_context.Error += new ErrorDelegate(OnError);
			analizer.Process(_context, conf);
			return analizer;
		}
		protected SemanticAnalizerStep Analize(EngineConfiguration conf)
		{
			return Analize(conf, null);
		}
Beispiel #9
0
		public virtual void Process(Context context, EngineConfiguration configuration)
		{
			_step.Process(context, configuration);
		}
Beispiel #10
0
		public CodeEngineBuilder()
		{
			Configuration = new EngineConfiguration();
		}