public class ParserRunner extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ParserRunner.ParseResult
Holds results of parsing.
|
| Modifier and Type | Method and Description |
|---|---|
static Config |
createConfig(boolean isIdeMode,
Config.LanguageMode languageMode,
boolean acceptConstKeyword) |
static Config |
createConfig(boolean isIdeMode,
Config.LanguageMode languageMode,
boolean acceptConstKeyword,
Set<String> extraAnnotationNames) |
static Config |
createConfig(boolean isIdeMode,
Config.LanguageMode languageMode,
boolean acceptConstKeyword,
Set<String> extraAnnotationNames,
boolean useNewParser) |
static Set<String> |
getReservedVars() |
static ParserRunner.ParseResult |
parse(StaticSourceFile sourceFile,
String sourceString,
Config config,
com.google.javascript.rhino.head.ErrorReporter errorReporter,
Logger logger)
Parses the JavaScript text given by a reader.
|
static ParserRunner.ParseResult |
parseEs5(StaticSourceFile sourceFile,
String sourceString,
Config config,
com.google.javascript.rhino.head.ErrorReporter errorReporter,
Logger logger)
Parses the JavaScript text given by a reader using Rhino.
|
static ParserRunner.ParseResult |
parseEs6(StaticSourceFile sourceFile,
String sourceString,
Config config,
com.google.javascript.rhino.head.ErrorReporter errorReporter,
Logger logger)
Parses the JavaScript text using the ES6 parser.
|
public static Config createConfig(boolean isIdeMode, Config.LanguageMode languageMode, boolean acceptConstKeyword)
public static Config createConfig(boolean isIdeMode, Config.LanguageMode languageMode, boolean acceptConstKeyword, Set<String> extraAnnotationNames)
public static Config createConfig(boolean isIdeMode, Config.LanguageMode languageMode, boolean acceptConstKeyword, Set<String> extraAnnotationNames, boolean useNewParser)
public static ParserRunner.ParseResult parse(StaticSourceFile sourceFile, String sourceString, Config config, com.google.javascript.rhino.head.ErrorReporter errorReporter, Logger logger) throws IOException
sourceString - Source code from the file.errorReporter - An error.logger - A logger.IOExceptionpublic static ParserRunner.ParseResult parseEs5(StaticSourceFile sourceFile, String sourceString, Config config, com.google.javascript.rhino.head.ErrorReporter errorReporter, Logger logger)
sourceString - Source code from the file.errorReporter - An error.logger - A logger.public static ParserRunner.ParseResult parseEs6(StaticSourceFile sourceFile, String sourceString, Config config, com.google.javascript.rhino.head.ErrorReporter errorReporter, Logger logger)
sourceString - Source code from the file.errorReporter - An error.logger - A logger.Copyright © 2009-2014 Google. All Rights Reserved.