protected JCCompilationUnit parse ( JavaFileObject filename , CharSequence content ) { long msec = now ( ) ; JCCompilationUnit tree = make . TopLevel ( List . nil ( ) ) ; if ( content != null ) { if ( verbose ) { log . printVerbose ( "parsing.started" , filename ) ; } if ( ! taskListener . isEmpty ( ) ) { TaskEvent e = new TaskEvent ( TaskEvent . Kind . PARSE , filename ) ; taskListener . started ( e ) ; keepComments = true ; genEndPos = true ; } Parser parser = parserFactory . newParser ( content , keepComments ( ) , genEndPos , lineDebugInfo , filename . isNameCompatible ( "module-info" , Kind . SOURCE ) ) ; tree = parser . parseCompilationUnit ( ) ; if ( verbose ) { log . printVerbose ( "parsing.done" , Long . toString ( elapsed ( msec ) ) ) ; } } tree . sourcefile = filename ; if ( content != null && ! taskListener . isEmpty ( ) ) { TaskEvent e = new TaskEvent ( TaskEvent . Kind . PARSE , tree ) ; taskListener . finished ( e ) ; } return tree ; }
Parse contents of input stream .