Пример #1
0
		private string Intrepret()
		{
			var parser = new Parser(_Table);						
			var columnsExp = new ColumnsExpression();
			columnsExp.AddExpression(new ColumnIfTypeExpression());
			columnsExp.AddExpression(new ColumnNameExpression());
			columnsExp.AddExpression(new ColumnTypeExpression());
			columnsExp.AddExpression(new ColumnLengthExpression());
			columnsExp.AddExpression(new ColumnDefaultExpression());
			columnsExp.AddExpression(new ColumnMapTypeExpression());
			columnsExp.AddExpression(new ColumnIfExpression());
			columnsExp.AddExpression(new ColumnIfNullableExpression());
			columnsExp.AddExpression(new ColumnNameMatchesExpression()); 
			parser.AddExpression(columnsExp);
			parser.AddExpression(new TableNameExpression());
            parser.AddExpression(new TableSchemaExpression());
			parser.AddExpression(new DatabaseNameExpression());
			if(_CustomValues != null)
			{
				foreach(DictionaryEntry entry in _CustomValues)
				{
					parser.AddExpression(new LiteralExpression(entry.Key.ToString(),entry.Value.ToString()));		
				}
			}
			parser.Interpret(_Context);
			return _Context.Output;
		}
Пример #2
0
		public void SetUp()
		{
			Server.ConnectionString = @"SERVER=SAM\NETSDK;DATABASE=;UID=sa;PWD=s4ms4m;";
			Server.ProviderType = DataProviderType.SqlClient;
			Context.StartDelimeter = "{";
			Context.EndingDelimiter = "}";
			_parser = new Parser(new Server().Databases[0].Tables[0]);
		}