scripting: fixup parsing of mixed program/function and statement scripts.

This patch allows to query the programgraphparser if it has seen any valid input at all.
Also the commonparser was slightly rewritten for parsing identifiers. Some lexeme_d
directives were ignored because they were stored in a rule_t instead of a lexeme_rule_t

Signed-off-by: Peter Soetens <peter@thesourceworks.com>