ASTParser

interface ASTParser<R : Node>

Functions

Link copied to clipboard
open fun parse(code: String, considerRange: Boolean = true, measureLexingTime: Boolean = false): ParsingResult<R>
abstract fun parse(file: File, charset: Charset = Charsets.UTF_8, considerRange: Boolean = true, measureLexingTime: Boolean = false): ParsingResult<R>
abstract fun parse(code: String, considerRange: Boolean = true, measureLexingTime: Boolean = false, source: Source? = null): ParsingResult<R>

open fun parse(inputStream: InputStream, charset: Charset = Charsets.UTF_8, considerRange: Boolean = true, measureLexingTime: Boolean = false, source: Source? = null): ParsingResult<R>

Parses source code, returning a result that includes an AST and a collection of parse issues (errors, warnings). The parsing is done in accordance to the StarLasu methodology i.e. a first-stage parser builds a parse tree which is then mapped onto a higher-level tree called the AST.