api / org.gradle.api.plugins.antlr / AntlrTask

AntlrTask

@NonNullApi @CacheableTask open class AntlrTask : SourceTask

Generates parsers from Antlr grammars.

Constructors

<init>

AntlrTask()

Generates parsers from Antlr grammars.

Functions

execute

open fun execute(inputs: IncrementalTaskInputs): Unit

getAntlrClasspath

open fun getAntlrClasspath(): FileCollection

Returns the classpath containing the Ant ANTLR task implementation.

getArguments

open fun getArguments(): MutableList<String>

List of command-line arguments passed to the antlr process

getMaxHeapSize

open fun getMaxHeapSize(): String

The maximum heap size for the forked antlr process (ex: '1g').

getOutputDirectory

open fun getOutputDirectory(): File

Returns the directory to generate the parser source files into.

getSource

open fun getSource(): FileTree

Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

isTrace

open fun isTrace(): Boolean

Specifies that all rules call traceIn/traceOut.

isTraceLexer

open fun isTraceLexer(): Boolean

Specifies that all lexer rules call traceIn/traceOut.

isTraceParser

open fun isTraceParser(): Boolean

Specifies that all parser rules call traceIn/traceOut.

isTraceTreeWalker

open fun isTraceTreeWalker(): Boolean

Specifies that all tree walker rules call traceIn/traceOut.

setArguments

open fun setArguments(arguments: MutableList<String>): Unit

setMaxHeapSize

open fun setMaxHeapSize(maxHeapSize: String): Unit

setOutputDirectory

open fun setOutputDirectory(outputDirectory: File): Unit

Specifies the directory to generate the parser source files into.

setSource

open fun setSource(source: FileTree): Unit

Sets the source for this task. Delegates to #setSource(Object). If the source is of type SourceDirectorySet, then the relative path of each source grammar files is used to determine the relative output path of the generated source If the source is not of type SourceDirectorySet, then the generated source files end up flattened in the specified output directory.

open fun setSource(source: Any): Unit

Sets the source for this task. Delegates to SourceTask#setSource(Object). If the source is of type SourceDirectorySet, then the relative path of each source grammar files is used to determine the relative output path of the generated source If the source is not of type SourceDirectorySet, then the generated source files end up flattened in the specified output directory.

setTrace

open fun setTrace(trace: Boolean): Unit

setTraceLexer

open fun setTraceLexer(traceLexer: Boolean): Unit

setTraceParser

open fun setTraceParser(traceParser: Boolean): Unit

setTraceTreeWalker

open fun setTraceTreeWalker(traceTreeWalker: Boolean): Unit

Inherited Functions

exclude

open fun exclude(vararg excludes: String): SourceTask
open fun exclude(excludes: MutableIterable<String>): SourceTask
open fun exclude(excludeSpec: Spec<FileTreeElement>): SourceTask
open fun exclude(excludeSpec: Closure<Any>): SourceTask

{@inheritDoc}

getExcludes

open fun getExcludes(): MutableSet<String>

{@inheritDoc}

getIncludes

open fun getIncludes(): MutableSet<String>

{@inheritDoc}

include

open fun include(vararg includes: String): SourceTask
open fun include(includes: MutableIterable<String>): SourceTask
open fun include(includeSpec: Spec<FileTreeElement>): SourceTask
open fun include(includeSpec: Closure<Any>): SourceTask

{@inheritDoc}

setExcludes

open fun setExcludes(excludes: MutableIterable<String>): SourceTask

{@inheritDoc}

setIncludes

open fun setIncludes(includes: MutableIterable<String>): SourceTask

{@inheritDoc}

source

open fun source(vararg sources: Any): SourceTask

Adds some source to this task. The given source objects will be evaluated as per org.gradle.api.Project#files(Object...).