 			return new (ctor.bind.apply ctor, [null].concat args)()
 
 # Optionally move type builders into the global scope
-module.exports.globalize = ->
+globalize = module.exports.globalize = ->
 	global[type] = builders[type] for type of Types
+
+validate = module.exports.validate = (tree) ->
+	args = []
+	for prop in Properties[tree.type]
+		if !tree[prop]?
+			args.push null
+			continue
+		if Array.isArray tree[prop]
+			args.push tree[prop].map (el) -> validate el
+		else if typeof tree[prop] == 'object' and tree[prop].type?
+			args.push validate tree[prop]
+		else
+			args.push tree[prop]
+	builders[tree.type[0].toLowerCase() + tree.type[1...]].apply(null, args)
+

		@argument = arg
		isNullOr @argument, Expression



Types =
	arrayExpression: ArrayExpression

	withStatement: WithStatement
	yieldExpression: YieldExpression

builders = module.exports = {}

# To avoid having to call builders with new, wrap constructors
for key, value of Types
