Parse the specified files returning a list of abstract syntax trees.

@throws java.io.IOException TODO
@return a list of abstract syntax trees
15953
public Iterable<? extends CompilationUnitTree> parse() throws IOException {
        try {
            prepareCompiler();
            List<JCCompilationUnit> units = compiler.parseFiles(fileObjects);
            for (JCCompilationUnit unit: units) {
                JavaFileObject file = unit.getSourceFile();
                if (notYetEntered.containsKey(file))
                    notYetEntered.put(file, unit);
            }
            return units;
        }
        finally {
            parsed = true;
            if (compiler != null && compiler.log != null)
                compiler.log.flush();
        }
    }
371090
protected InputStream readFiles() throws IOException {
    BufferedInputStream input = new BufferedInputStream(openFile(), BUFFER_SIZE);
    input.mark(100);
    try {
      return new XZInputStream(input);
    } catch (IOException e) {
      input.reset();
    }
    try {
      return new CompressorStreamFactory().createCompressorInputStream(input);
    } catch (CompressorException e) {
      input.reset();
    }
    try {
      return new ArchiveStreamFactory().createArchiveInputStream(input);
    } catch (ArchiveException e) {
      input.reset();
    }
    return input;
  }
1147249
private void parsePackageClasses(String name,
            List<JavaFileObject> files,
            ListBuffer<JCCompilationUnit> trees,
            List<String> excludedPackages)
            throws IOException {
        if (excludedPackages.contains(name)) {
            return;
        }

        docenv.notice("main.Loading_source_files_for_package", name);

        if (files == null) {
            Location location = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                    ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;
            ListBuffer<JavaFileObject> lb = new ListBuffer<JavaFileObject>();
            for (JavaFileObject fo: docenv.fileManager.list(
                    location, name, EnumSet.of(JavaFileObject.Kind.SOURCE), false)) {
                String binaryName = docenv.fileManager.inferBinaryName(location, fo);
                String simpleName = getSimpleName(binaryName);
                if (isValidClassName(simpleName)) {
                    lb.append(fo);
                }
            }
            files = lb.toList();
        }
        if (files.nonEmpty()) {
            for (JavaFileObject fo : files) {
                parse(fo, trees, false);
            }
        } else {
            messager.warning(Messager.NOPOS, "main.no_source_files_for_package",
                             name.replace(File.separatorChar, '.'));
        }
    }
507215
public static Package parse(File file) throws IOException
        {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(file, Package.class);
        }
1339249
private List<String> readFile(File file) throws Exception {
        List<String> content = new ArrayList<>(100);
        try (BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"))) {
            String line;
            while ((line = is.readLine()) != null) {
                content.add(line);
            }
            return content;
        }
    }
871971
@Deprecated
    public JCTree.JCCompilationUnit parse(String filename) {
        JavacFileManager fm = (JavacFileManager)fileManager;
        return parse(fm.getJavaFileObjectsFromStrings(List.of(filename)).iterator().next());
    }
883056
public Iterable<? extends Element> enter(Iterable<? extends CompilationUnitTree> trees)
    {
        if (trees == null && notYetEntered != null && notYetEntered.isEmpty())
            return List.nil();

        boolean wasInitialized = compiler != null;

        prepareCompiler(true);

        ListBuffer<JCCompilationUnit> roots = null;

        if (trees == null) {
            // If there are still files which were specified to be compiled
            // (i.e. in fileObjects) but which have not yet been entered,
            // then we make sure they have been parsed and add them to the
            // list to be entered.
            if (notYetEntered.size() > 0) {
                if (!parsed)
                    parseInternal(); // TODO would be nice to specify files needed to be parsed
                for (JavaFileObject file: args.getFileObjects()) {
                    JCCompilationUnit unit = notYetEntered.remove(file);
                    if (unit != null) {
                        if (roots == null)
                            roots = new ListBuffer<>();
                        roots.append(unit);
                    }
                }
                notYetEntered.clear();
            }
        }
        else {
            for (CompilationUnitTree cu : trees) {
                if (cu instanceof JCCompilationUnit) {
                    if (roots == null)
                        roots = new ListBuffer<>();
                    roots.append((JCCompilationUnit)cu);
                    notYetEntered.remove(cu.getSourceFile());
                }
                else
                    throw new IllegalArgumentException(cu.toString());
            }
        }

        if (roots == null) {
            if (trees == null && !wasInitialized) {
                compiler.initModules(List.nil());
            }
            return List.nil();
        }

        List<JCCompilationUnit> units = compiler.initModules(roots.toList());

        try {
            units = compiler.enterTrees(units);

            if (notYetEntered.isEmpty())
                compiler.processAnnotations(units);

            ListBuffer<Element> elements = new ListBuffer<>();
            for (JCCompilationUnit unit : units) {
                boolean isPkgInfo = unit.sourcefile.isNameCompatible("package-info",
                                                                     JavaFileObject.Kind.SOURCE);
                if (isPkgInfo) {
                    elements.append(unit.packge);
                } else {
                    for (JCTree node : unit.defs) {
                        if (node.hasTag(JCTree.Tag.CLASSDEF)) {
                            JCClassDecl cdef = (JCClassDecl) node;
                            if (cdef.sym != null) // maybe null if errors in anno processing
                                elements.append(cdef.sym);
                        } else if (node.hasTag(JCTree.Tag.MODULEDEF)) {
                            JCModuleDecl mdef = (JCModuleDecl) node;
                            if (mdef.sym != null)
                                elements.append(mdef.sym);
                        }
                    }
                }
            }
            return elements.toList();
        }
        finally {
            compiler.log.flush();
        }
    }
848131
public Set<FileAnnotation> parse(final InputStream file) throws IOException {
        try {
            Set<FileAnnotation> allAnnotations = Sets.newHashSet();
            for (AbstractWarningsParser parser : parsers) {
                allAnnotations.addAll(parser.parse(createReader(file)));
            }
            return applyExcludeFilter(allAnnotations);
        }
        finally {
            IOUtils.closeQuietly(file);
        }
    }
314487
@Override
   public boolean compileFiles(String[] files)
   {
      JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
      if (compiler == null) {
         throw new IllegalStateException(
                 "No compiler detected, make sure you are running on top of a JDK instead of a JRE.");
      }
      StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
      Iterable<? extends JavaFileObject> fileList = fileManager.getJavaFileObjectsFromStrings(Arrays
              .asList(files));

      return internalCompile(compiler, wrapJavaFileManager(fileManager), setupDiagnosticListener(),
              fileList);
   }
75294
@Override
    public Collection<DependencyInfo> parse(File dir) {
        BufferedReader br = null;
        FileReader fr = null;
        Collection<DependencyInfo> dependencyInfos = new LinkedList<>();
        if (dir.isDirectory()) {
            Collection<File> files = new LinkedList<>();
            getDescFiles(dir, files);
            if (!files.isEmpty()) {
                for (File file : files) {
                    try {
                        DependencyInfo dependencyInfo = null;
                        Package packageInfo = new Package();
                        fr = new FileReader(file);
                        br = new BufferedReader(fr);
                        String line = null;
                        // Create Arch Linux package - package-version-architecture.pkg.tar.xz
                        while ((line = br.readLine()) != null) {
                            switch (line) {
                                case PACKAGE:
                                    packageInfo.setPackageName(br.readLine());
                                    break;
                                case VERSION:
                                    packageInfo.setVersion(br.readLine());
                                    break;
                                case ARCHITECTURE:
                                    packageInfo.setArchitecture(br.readLine());
                                    break;
                                default:
                                    break;
                            }
                        }
                        dependencyInfos.add(createDependencyInfo(packageInfo));
                    } catch (FileNotFoundException e) {
                        logger.error("Error getting package data", e.getMessage());
                    } catch (IOException e) {
                        logger.error("Error getting package data", e.getMessage());
                    } finally {
                        closeStream(br, fr);
                    }
                }
            }
        }
        return dependencyInfos;
    }
1166847
public List<Object> parseArray() throws IOException {
		Type t = lexer.readNextToken();
		if (t != Type.START_ARRAY) {
			throw new IOException("Unexpected token: " + t);
		}
		
		return parseArrayInternal();
	}
353188
public <T extends JCTree> List<T> translate(List<T> trees) {
        if (trees == null) return null;
        for (List<T> l = trees; l.nonEmpty(); l = l.tail)
            l.head = translate(l.head);
        return trees;
    }
768701
public void parse(InputStream is) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(
				(InputStream) is));
        String read;
        ArrayList<String> current = null;
        while (br != null) {
            do {
                read = br.readLine();
                // Skip comments & blanks
            } while ((read != null) && ((read = read.trim()).startsWith("#") ||
                read.length() == 0));
            if (read == null) {
            	br.close();
            	br = null;
            } else {
                int commentIndex = read.indexOf("#");
                if (commentIndex > -1) {
                    // Strip trailing comment
                    read = read.substring(0, commentIndex);
                }
                read = read.trim();
                if (read.matches("(?i)^User-agent:.*")) {
                    String ua = read.substring(11).trim().toLowerCase();
                    if (current == null || current.size() != 0) {
                        // only create new rules-list if necessary
                        // otherwise share with previous user-agent
                        current = new ArrayList<String>();
                    }
                    rules.put(ua, current);
                    LOGGER.fine("Found User-agent(" + ua + ") rules...");
                    continue;
                }
                if (read.matches("(?i)Disallow:.*")) {
                    if (current == null) {
                        // buggy robots.txt
                    	bSyntaxErrors = true;
                        continue;
                    }
                    String path = read.substring(9).trim();
                    current.add(path);
                    continue;
                }
                // unknown line; do nothing for now
                
                // TODO: check for "Allow" lines, and flag a syntax error if 
                //       we encounter any unknown lines?
            }
        }
    }
564599
public static List<String> readLines(File file) throws IOException {
        List<String> lines = new ArrayList<String>();
        InputStreamReader reader = null;
        BufferedReader bufferedReader = null;
        try {
            reader = new FileReader(file);
            bufferedReader = new BufferedReader(reader);
            String lineText = null;
            while ((lineText = bufferedReader.readLine()) != null) {
                lines.add(lineText);
            }
            return lines;
        } finally {
            if (bufferedReader != null) {
                bufferedReader.close();
            }
            if (reader != null) {
                reader.close();
            }
        }
    }
648102
protected static final Object parseList(Source src) throws IOException {
		final LinkedList<Object> list = new LinkedList<Object>();
		boolean foundEnd = false;
		try {
			if (src.ch == '[') {
				src.idx++;
			}
			skipWhitespaces(src);
			if (src.ch == ']') {
				src.idx++;
				return list;
			}
			char c;
			loop: while (src.idx < src.last) {
				list.add(parseNext(src));
				while (true) {
					c = src.chars[src.idx];
					if (c == ',') {
						src.idx++;
						continue loop;
					}
					if (c == ']') {
						foundEnd = true;
						src.idx++;
						break loop;
					}
					if (c <= 32) {
						src.idx++;
						continue;
					}
					break;
				}
				c = src.chars[src.idx];
				if (c == ',') {
					src.idx++;
					continue;
				}
				if (c == ']') {
					src.idx++;
					foundEnd = true;
					break;
				}
				throw new IOException(String.format(
						"Expecting a ',' or a ']', " + " but got ch character of  %s " + " on array idx of %s!",
						(int) c, list.size()));
			}
		} catch (IOException ioCause) {
			throw ioCause;
		} catch (Exception cause) {
			throw new IOException("Issue parsing JSON array!", cause);
		}
		if (!foundEnd) {
			throw new IOException("Did not find end of JSON Array!");
		}
		return list;
	}
332167
def parseLines(self):
        """"""
        inAst = parse(''.join(self.lines), self.inFilename)
        # Visit all the nodes in our tree and apply Doxygen tags to the source.
        self.visit(inAst)
598511
public HashMap readFile(List<File> files) {
        HashMap brMap;
        try {
            brMap = getBufferReader(files);
        } catch (IOException e) {
            LOG.error(Functions.getStackTrace(e));
            return new HashMap();
        }
        return read(brMap);
    }