Input is validated by a formal grammar with lex and yacc