com.google.javascript.jscomp.deps
Class JsFunctionParser

java.lang.Object
  extended by com.google.javascript.jscomp.deps.JsFileLineParser
      extended by com.google.javascript.jscomp.deps.JsFunctionParser

public class JsFunctionParser
extends JsFileLineParser

A parser that can extract dependency information from a .js file.


Nested Class Summary
static class JsFunctionParser.SymbolInfo
           
 
Constructor Summary
JsFunctionParser(Collection<String> functions, ErrorManager errorManager)
          Constructor
 
Method Summary
 Collection<JsFunctionParser.SymbolInfo> parseFile(String filePath, String fileContents)
          Parses the given file and returns the dependency information that it contained.
protected  boolean parseLine(String line)
          Parses a line of javascript, extracting dependency information.
 
Methods inherited from class com.google.javascript.jscomp.deps.JsFileLineParser
didParseSucceed, setShortcutMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsFunctionParser

public JsFunctionParser(Collection<String> functions,
                        ErrorManager errorManager)
Constructor

Parameters:
functions - Functions to parse.
errorManager - Handles parse errors.
Method Detail

parseFile

public Collection<JsFunctionParser.SymbolInfo> parseFile(String filePath,
                                                         String fileContents)
Parses the given file and returns the dependency information that it contained.

Parameters:
filePath - Path to the file to parse.
fileContents - The contents to parse.
Returns:
A collection containing all symbols found in the file.

parseLine

protected boolean parseLine(String line)
                     throws com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
Parses a line of javascript, extracting dependency information.

Parameters:
line - The line to parse.
Returns:
true to keep going, false otherwise.
Throws:
com.google.javascript.jscomp.deps.JsFileLineParser.ParseException