Method: RLTK::Parser::ParseStack#result

Defined in:
lib/rltk/parser.rb

#resultObject

Fetch the result stored in this ParseStack. If there is more than one object left on the output stack there is an error.

Returns:

  • (Object)

    The end result of this parse stack.



1434
1435
1436
1437
1438
1439
1440
# File 'lib/rltk/parser.rb', line 1434

def result
	if @output_stack.length == 1
		return @output_stack.last
	else
		raise InternalParserException, "The parsing stack should have 1 element on the output stack, not #{@output_stack.length}."
	end
end