What is the parser supposed to do with invalid input

When an invalid input is parsed, for eg

9http://

Since the grammar says that the method getScheme() must not return code null, what is ("9http://).parse().getScheme() supposed to return?

Moreover, with inputs that have userinfo but contains an illegal character, would getUserInfo() return null?