func (ps *parseStack) AssembleEmitterOptions(begin int, end int) {
	elems := ps.collectElements(begin, end)
	if len(elems) == 0 {
		elems = nil
	}
	ps.PushComponent(begin, end, elems)
}
AssembleEmitterOptions takes the elements from the stack that
correspond to the input[begin:end] string and pushes a slice
with all of them back to the stack.

Any
Any
Any
=>
[]{Any, Any, Any}
package parser
import (
	"fmt"
	"gopkg.in/sensorbee/sensorbee.v0/data"
)
type parseStack struct {
	top  *stackElement
	size int
}
type stackElement struct {
	value *ParsedComponent
	next  *stackElement
}
type ParsedComponent struct {
	begin int
	end int
	comp interface{}
}
func (ps *parseStack) Len() int {
	return ps.size
}
func (ps *parseStack) Push(value *ParsedComponent) {
	ps.top = &stackElement{value, ps.top}
	ps.size++
}
func (ps *parseStack) Pop() (value *ParsedComponent) {
	if ps.size > 0 {
		value, ps.top = ps.top.value, ps.top.next
		ps.size--
		return
	}
	return nil
}
func (ps *parseStack) Peek() (value *ParsedComponent) {
	if ps.size > 0 {
		return ps.top.value
	}
	return nil
}
func (ps *parseStack) AssembleSelect() {
	_having, _grouping, _filter, _from, _projections, _emitter := ps.pop6()
	having := _having.comp.(HavingAST)
	grouping := _grouping.comp.(GroupingAST)
	filter := _filter.comp.(FilterAST)
	from := _from.comp.(WindowedFromAST)
	projections := _projections.comp.(ProjectionsAST)
	emitter := _emitter.comp.(EmitterAST)
	s := SelectStmt{emitter, projections, from, filter, grouping, having}
	se := ParsedComponent{_emitter.begin, _having.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleSelectUnion(begin int, end int) {
	elems := ps.collectElements(begin, end)
	selects := make([]SelectStmt, len(elems))
	for i := range elems {
		selects[i] = elems[i].(SelectStmt)
	}
	ps.PushComponent(begin, end, SelectUnionStmt{selects})
}
func (ps *parseStack) AssembleCreateStreamAsSelect() {
	_select, _name := ps.pop2()
	s := _select.comp.(SelectStmt)
	name := _name.comp.(StreamIdentifier)
	css := CreateStreamAsSelectStmt{name, s}
	se := ParsedComponent{_name.begin, _select.end, css}
	ps.Push(&se)
}
func (ps *parseStack) AssembleCreateStreamAsSelectUnion() {
	_selectUnion, _name := ps.pop2()
	selectUnion := _selectUnion.comp.(SelectUnionStmt)
	name := _name.comp.(StreamIdentifier)
	css := CreateStreamAsSelectUnionStmt{name, selectUnion}
	se := ParsedComponent{_name.begin, _selectUnion.end, css}
	ps.Push(&se)
}
func (ps *parseStack) AssembleCreateSource() {
	_specs, _sourceType, _name, _paused := ps.pop4()
	specs := _specs.comp.(SourceSinkSpecsAST)
	sourceType := _sourceType.comp.(SourceSinkType)
	name := _name.comp.(StreamIdentifier)
	paused := _paused.comp.(BinaryKeyword)
	s := CreateSourceStmt{paused, name, sourceType, specs}
	se := ParsedComponent{_paused.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleCreateSink() {
	_specs, _sinkType, _name := ps.pop3()
	specs := _specs.comp.(SourceSinkSpecsAST)
	sinkType := _sinkType.comp.(SourceSinkType)
	name := _name.comp.(StreamIdentifier)
	s := CreateSinkStmt{name, sinkType, specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleCreateState() {
	_specs, _sinkType, _name := ps.pop3()
	specs := _specs.comp.(SourceSinkSpecsAST)
	sinkType := _sinkType.comp.(SourceSinkType)
	name := _name.comp.(StreamIdentifier)
	s := CreateStateStmt{name, sinkType, specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleUpdateState() {
	_specs, _name := ps.pop2()
	specs := _specs.comp.(SourceSinkSpecsAST)
	name := _name.comp.(StreamIdentifier)
	s := UpdateStateStmt{name, specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleUpdateSource() {
	_specs, _name := ps.pop2()
	specs := _specs.comp.(SourceSinkSpecsAST)
	name := _name.comp.(StreamIdentifier)
	s := UpdateSourceStmt{name, specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleUpdateSink() {
	_specs, _name := ps.pop2()
	specs := _specs.comp.(SourceSinkSpecsAST)
	name := _name.comp.(StreamIdentifier)
	s := UpdateSinkStmt{name, specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleInsertIntoFrom() {
	_input, _sink := ps.pop2()
	input := _input.comp.(StreamIdentifier)
	sink := _sink.comp.(StreamIdentifier)
	s := InsertIntoFromStmt{sink, input}
	se := ParsedComponent{_sink.begin, _input.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssemblePauseSource() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, PauseSourceStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleResumeSource() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, ResumeSourceStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleRewindSource() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, RewindSourceStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleDropSource() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, DropSourceStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleDropStream() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, DropStreamStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleDropSink() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, DropSinkStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleDropState() {
	_name := ps.Pop()
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _name.end, DropStateStmt{name}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleLoadState() {
	_specs, _tag, _sinkType, _name := ps.pop4()
	specs := _specs.comp.(SourceSinkSpecsAST)
	tag := _tag.comp.(Identifier)
	sinkType := _sinkType.comp.(SourceSinkType)
	name := _name.comp.(StreamIdentifier)
	s := LoadStateStmt{name, sinkType, string(tag), specs}
	se := ParsedComponent{_name.begin, _specs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleLoadStateOrCreate() {
	_createSpecs, _loadStateStmt := ps.pop2()
	loadStateStmt := _loadStateStmt.comp.(LoadStateStmt)
	createSpecs := _createSpecs.comp.(SourceSinkSpecsAST)
	specs := loadStateStmt.SourceSinkSpecsAST
	tag := loadStateStmt.Tag
	sinkType := loadStateStmt.Type
	name := loadStateStmt.Name
	s := LoadStateOrCreateStmt{name, sinkType, tag, specs, createSpecs}
	se := ParsedComponent{_loadStateStmt.begin, _createSpecs.end, s}
	ps.Push(&se)
}
func (ps *parseStack) AssembleSaveState() {
	_tag, _name := ps.pop2()
	tag := _tag.comp.(Identifier)
	name := _name.comp.(StreamIdentifier)
	se := ParsedComponent{_name.begin, _tag.end, SaveStateStmt{name, string(tag)}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleEval(begin, end int) {
	var exprBegin int
	var expr Expression
	var inputRow *MapAST
	if begin == end {
		_expr := ps.Pop()
		exprBegin = _expr.begin
		expr = _expr.comp.(Expression)
	} else {
		_input, _expr := ps.pop2()
		exprBegin = _expr.begin
		expr = _expr.comp.(Expression)
		input := _input.comp.(MapAST)
		inputRow = &input
	}
	se := ParsedComponent{exprBegin, end, EvalStmt{expr, inputRow}}
	ps.Push(&se)
}
func (ps *parseStack) AssembleEmitter() {
	_options, _emitter := ps.pop2()
	emitter := _emitter.comp.(Emitter)
	options := _options.comp.([]interface{})
	ps.PushComponent(_emitter.begin, _options.end, EmitterAST{emitter, options})
}