public static Node . Nodes parse ( ParserController pc , String path , JspReader reader , Node parent , boolean isTagFile , boolean directivesOnly , URL jarFileUrl , String pageEnc , String jspConfigPageEnc , boolean isDefaultPageEncoding , boolean hasBom ) throws JasperException { Parser parser = new Parser ( pc , reader , isTagFile , directivesOnly , jarFileUrl , hasBom ) ; Node . Root root = new Node . Root ( reader . mark ( ) , parent , false ) ; root . setPageEncoding ( pageEnc ) ; root . setJspConfigPageEncoding ( jspConfigPageEnc ) ; root . setIsDefaultPageEncoding ( isDefaultPageEncoding ) ; root . setHasBom ( hasBom ) ; if ( hasBom ) { // Consume (remove) BOM, so it won't appear in page output char bomChar = ( char ) reader . nextChar ( ) ; if ( bomChar != 0xFEFF ) { parser . err . jspError ( reader . mark ( ) , "jsp.error.invalidBom" , Integer . toHexString ( bomChar ) . toUpperCase ( ) ) ; } } if ( directivesOnly ) { parser . parseTagFileDirectives ( root ) ; return new Node . Nodes ( root ) ; } // For the Top level page, add inlcude-prelude and include-coda PageInfo pageInfo = pc . getCompiler ( ) . getPageInfo ( ) ; if ( parent == null ) { parser . addInclude ( root , pageInfo . getIncludePrelude ( ) ) ; } while ( reader . hasMoreInput ( ) ) { parser . parseElements ( root ) ; } if ( parent == null ) { parser . addInclude ( root , pageInfo . getIncludeCoda ( ) ) ; parser . pageInfo . setRootPath ( path ) ; } Node . Nodes page = new Node . Nodes ( root ) ; return page ; }
The main entry for Parser