bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
private void parseDirective(Node parent) throws JasperException {
	reader.skipSpaces();

	String directive = null;
	if (reader.matches("page")) {
	    directive = "&lt;%@ page";
	    if (isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.istagfile",
					    directive);
	    }
	    parsePageDirective(parent);
	} else if (reader.matches("include")) {
	    directive = "&lt;%@ include";
	    parseIncludeDirective(parent);
	} else if (reader.matches("taglib")) {
	    if (directivesOnly) {
	        // No need to get the tagLibInfo objects.  This alos suppresses
	        // parsing of any tag files used in this tag file.
	        return;
	    }
	    directive = "&lt;%@ taglib";
	    parseTaglibDirective(parent);
	} else if (reader.matches("tag")) {
	    directive = "&lt;%@ tag";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseTagDirective(parent);
	} else if (reader.matches("attribute")) {
	    directive = "&lt;%@ attribute";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseAttributeDirective(parent);
	} else if (reader.matches("variable")) {
	    directive = "&lt;%@ variable";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseVariableDirective(parent);
	} else {
	    err.jspError(reader.mark(), "jsp.error.invalid.directive",
                reader.parseToken(false));
	}

	reader.skipSpaces();
	if (!reader.matches("%>")) {
	    err.jspError(start, "jsp.error.unterminated", directive);
	}
    }
private void parseDirective(Node parent) throws JasperException {
	reader.skipSpaces();

	String directive = null;
	if (reader.matches("page")) {
	    directive = "&lt;%@ page";
	    if (isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.istagfile",
					    directive);
	    }
	    parsePageDirective(parent);
	} else if (reader.matches("include")) {
	    directive = "&lt;%@ include";
	    parseIncludeDirective(parent);
	} else if (reader.matches("taglib")) {
	    if (directivesOnly) {
	        // No need to get the tagLibInfo objects.  This alos suppresses
	        // parsing of any tag files used in this tag file.
	        return;
	    }
	    directive = "&lt;%@ taglib";
	    parseTaglibDirective(parent);
	} else if (reader.matches("tag")) {
	    directive = "&lt;%@ tag";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseTagDirective(parent);
	} else if (reader.matches("attribute")) {
	    directive = "&lt;%@ attribute";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseAttributeDirective(parent);
	} else if (reader.matches("variable")) {
	    directive = "&lt;%@ variable";
	    if (!isTagFile) {
		err.jspError(reader.mark(), "jsp.error.directive.isnottagfile",
					    directive);
	    }
	    parseVariableDirective(parent);
	} else {
	    err.jspError(reader.mark(), "jsp.error.invalid.directive",
                reader.parseToken(false));
	}

	reader.skipSpaces();
	if (!reader.matches("%>")) {
	    err.jspError(start, "jsp.error.unterminated", directive);
	}
    }
private void parseDirective ( Node parent ) throws JasperException { reader . skipSpaces ( ) ; String directive = null ; if ( reader . matches ( "page" ) ) { directive = "&lt;%@ page" ; if ( isTagFile ) { err . jspError ( reader . mark ( ) , "jsp.error.directive.istagfile" , directive ) ; } parsePageDirective ( parent ) ; } else if ( reader . matches ( "include" ) ) { directive = "&lt;%@ include" ; parseIncludeDirective ( parent ) ; } else if ( reader . matches ( "taglib" ) ) { if ( directivesOnly ) { // No need to get the tagLibInfo objects.  This alos suppresses // parsing of any tag files used in this tag file. return ; } directive = "&lt;%@ taglib" ; parseTaglibDirective ( parent ) ; } else if ( reader . matches ( "tag" ) ) { directive = "&lt;%@ tag" ; if ( ! isTagFile ) { err . jspError ( reader . mark ( ) , "jsp.error.directive.isnottagfile" , directive ) ; } parseTagDirective ( parent ) ; } else if ( reader . matches ( "attribute" ) ) { directive = "&lt;%@ attribute" ; if ( ! isTagFile ) { err . jspError ( reader . mark ( ) , "jsp.error.directive.isnottagfile" , directive ) ; } parseAttributeDirective ( parent ) ; } else if ( reader . matches ( "variable" ) ) { directive = "&lt;%@ variable" ; if ( ! isTagFile ) { err . jspError ( reader . mark ( ) , "jsp.error.directive.isnottagfile" , directive ) ; } parseVariableDirective ( parent ) ; } else { err . jspError ( reader . mark ( ) , "jsp.error.invalid.directive" , reader . parseToken ( false ) ) ; } reader . skipSpaces ( ) ; if ( ! reader . matches ( "%>" ) ) { err . jspError ( start , "jsp.error.unterminated" , directive ) ; } }
/*
Parses a directive with the following syntax:
Directive ::= S? (   'page' PageDirective
| 'include' IncludeDirective
| 'taglib' TagLibDirective)
S? '%>'

TagDirective ::= S? ('tag' PageDirective
| 'include' IncludeDirective
| 'taglib' TagLibDirective)
| 'attribute AttributeDirective
| 'variable VariableDirective
S? '%>'
/ * Parses a directive with the following syntax : Directive :: = S? ( page PageDirective | include IncludeDirective | taglib TagLibDirective ) S? % >