def stream(self):
		"""The workhorse of cinje: transform input lines and emit output lines.
		
		After constructing an instance with a set of input lines iterate this property to generate the template.
		"""
		
		if 'init' not in self.flag:
			root = True
			self.prepare()
		else:
			root = False
		
		# Track which lines were generated in response to which lines of source code.
		# The end result is that there is one entry here for every line emitted, each integer representing the source
		# line number that triggered it.  If any lines are returned with missing line numbers, they're inferred from
		# the last entry already in the list.
		# Fun fact: this list is backwards; we optimize by using a deque and appending to the left edge. this updates
		# the head of a linked list; the whole thing needs to be reversed to make sense.
		mapping = self.mapping
		
		for line in self.input:
			handler = self.classify(line)
			
			if line.kind == 'code' and line.stripped == 'end':  # Exit the current child scope.
				return
			
			assert handler, "Unable to identify handler for line; this should be impossible!"
			
			self.input.push(line)  # Put it back so it can be consumed by the handler.
			
			for line in handler(self):  # This re-indents the code to match, if missing explicit scope.
				if root: mapping.appendleft(line.number or mapping[0])  # Track source line number.
				
				if line.scope is None:
					line = line.clone(scope=self.scope)
				
				yield line