class GslGrammarIdentifier implements GrammarIdentifier {

    @Override
    public GrammarType identify(final GrammarDocument grammar) {
        /* make sure grammar is neither null nor empty */
        if (grammar == null) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("grammar is null or empty");
            }
            return null;
        }
        if (!grammar.isAscii()) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("can only handle ascii grammars");
            }
            return null;
        }
        final String document = grammar.getTextContent();
        if (document.startsWith(GSL_HEDAER)) {
            return GrammarType.GSL;
        }
        return null;
    }

}