Class JavaCCTask

  • All Implemented Interfaces:
    kotlin.Comparable , org.gradle.api.Named , org.gradle.api.Task , org.gradle.api.internal.DynamicObjectAware , org.gradle.api.internal.TaskInternal , org.gradle.api.plugins.ExtensionAware , org.gradle.util.Configurable

    @CacheableTask() 
    public abstract class JavaCCTask
    extends DefaultTask
                        

    Task implementation for JavaCC code generation. The code will be generated by a worker executor.

    • Constructor Detail

      • JavaCCTask

        JavaCCTask(ObjectFactory objectFactory, WorkerExecutor workerExecutor)

        Creates a task with a worker.

    • Method Detail

      • getOutputDir

        @OutputDirectory() final File getOutputDir()

        Output dir for JavaCC code generation.

      • getInputFile

        @PathSensitive(value = PathSensitivity.RELATIVE)@InputFile() final File getInputFile()

        Input file for code generation.

      • getPackageName

        @Input() final String getPackageName()

        This is the package name property of the generated code.

      • getJdkVersion

        @Optional()@Input() final String getJdkVersion()

        JDK version property of the JavaCC code generator.

      • getLookahead

        @Optional()@Input() final Integer getLookahead()

        LOOKAHEAD: The number of tokens to look ahead before making a decision at a choice point during parsing. The smaller this number, the faster the parser. This number may be overridden for specific productions within the grammar as described later. This is the lookahead property of the parser configuration.

      • setLookahead

         final Unit setLookahead(Integer value)

        LOOKAHEAD: The number of tokens to look ahead before making a decision at a choice point during parsing. The smaller this number, the faster the parser. This number may be overridden for specific productions within the grammar as described later. This is the lookahead property of the parser configuration.

      • getChoiceAmbiguityCheck

        @Optional()@Input() final Integer getChoiceAmbiguityCheck()

        CHOICE_AMBIGUITY_CHECK: This is the number of tokens considered in checking choices of the form "A \| B \| ..." for ambiguity. This is the property for choiceAmbiguityCheck of the parser configuration.

      • setChoiceAmbiguityCheck

         final Unit setChoiceAmbiguityCheck(Integer value)

        CHOICE_AMBIGUITY_CHECK: This is the number of tokens considered in checking choices of the form "A \| B \| ..." for ambiguity. This is the property for choiceAmbiguityCheck of the parser configuration.

      • getOtherAmbiguityCheck

        @Optional()@Input() final Integer getOtherAmbiguityCheck()

        OTHER_AMBIGUITY_CHECK: This is the number of tokens considered in checking all other kinds of choices (i.e., of the forms "(A)*", "(A)+", and "(A)?") for ambiguity. This is the property otherAmbiguityCheck of the parser configuration.

      • setOtherAmbiguityCheck

         final Unit setOtherAmbiguityCheck(Integer value)

        OTHER_AMBIGUITY_CHECK: This is the number of tokens considered in checking all other kinds of choices (i.e., of the forms "(A)*", "(A)+", and "(A)?") for ambiguity. This is the property otherAmbiguityCheck of the parser configuration.

      • getStaticParam

        @Optional()@Input() final String getStaticParam()

        STATIC: If true, all methods and class variables are specified as static in the generated parser and token manager. This is the property staticParam of the parser configuration.

      • setStaticParam

         final Unit setStaticParam(String value)

        STATIC: If true, all methods and class variables are specified as static in the generated parser and token manager. This is the property staticParam of the parser configuration.

      • getSupportClassVisibilityPublic

        @Optional()@Input() final String getSupportClassVisibilityPublic()

        SUPPORT_CLASS_VISIBILITY_PUBLIC: The default action is to generate support classes (such as Token.java, ParseException.java etc) with Public visibility. This is the property supportClassVisibilityPublic of the parser configuration.

      • setSupportClassVisibilityPublic

         final Unit setSupportClassVisibilityPublic(String value)

        SUPPORT_CLASS_VISIBILITY_PUBLIC: The default action is to generate support classes (such as Token.java, ParseException.java etc) with Public visibility. This is the property supportClassVisibilityPublic of the parser configuration.

      • getDebugParser

        @Optional()@Input() final String getDebugParser()

        DEBUG_PARSER: This option is used to obtain debugging information from the generated parser. This is the property debugParser of the parser configuration.

      • setDebugParser

         final Unit setDebugParser(String value)

        DEBUG_PARSER: This option is used to obtain debugging information from the generated parser. This is the property debugParser of the parser configuration.

      • getDebugLookahead

        @Optional()@Input() final String getDebugLookahead()

        DEBUG_LOOKAHEAD: Setting this option to true causes the parser to generate all the tracing information it does when the option DEBUG_PARSER is true. This is the property debugLookahead of the parser configuration.

      • setDebugLookahead

         final Unit setDebugLookahead(String value)

        DEBUG_LOOKAHEAD: Setting this option to true causes the parser to generate all the tracing information it does when the option DEBUG_PARSER is true. This is the property debugLookahead of the parser configuration.

      • getDebugTokenManager

        @Optional()@Input() final String getDebugTokenManager()

        DEBUG_TOKEN_MANAGER: This option is used to obtain debugging information from the generated token manager. This is the property debugTokenManager of the parser configuration.

      • setDebugTokenManager

         final Unit setDebugTokenManager(String value)

        DEBUG_TOKEN_MANAGER: This option is used to obtain debugging information from the generated token manager. This is the property debugTokenManager of the parser configuration.

      • getErrorReporting

        @Optional()@Input() final String getErrorReporting()

        ERROR_REPORTING: Setting it to false causes errors due to parse errors to be reported in somewhat less detail. This is the property errorReporting of the parser configuration.

      • setErrorReporting

         final Unit setErrorReporting(String value)

        ERROR_REPORTING: Setting it to false causes errors due to parse errors to be reported in somewhat less detail. This is the property errorReporting of the parser configuration.

      • getJavaUnicodeEscape

        @Optional()@Input() final String getJavaUnicodeEscape()

        JAVA_UNICODE_ESCAPE: When set to true, the generated parser uses an input stream object that processes Java Unicode escapes (\u...) before sending characters to the token manager. This is the property javaUnicodeEscape of the parser configuration.

      • setJavaUnicodeEscape

         final Unit setJavaUnicodeEscape(String value)

        JAVA_UNICODE_ESCAPE: When set to true, the generated parser uses an input stream object that processes Java Unicode escapes (\u...) before sending characters to the token manager. This is the property javaUnicodeEscape of the parser configuration.

      • getUnicodeInput

        @Optional()@Input() final String getUnicodeInput()

        UNICODE_INPUT: When set to true, the generated parser uses an input stream object that reads Unicode files. This is the property unicodeInput of the parser configuration.

      • setUnicodeInput

         final Unit setUnicodeInput(String value)

        UNICODE_INPUT: When set to true, the generated parser uses an input stream object that reads Unicode files. This is the property unicodeInput of the parser configuration.

      • getIgnoreCase

        @Optional()@Input() final String getIgnoreCase()

        IGNORE_CASE: Setting this option to true causes the generate token manager to ignore case in the token specifications and the input files. This is the property ignoreCase of the parser configuration.

      • setIgnoreCase

         final Unit setIgnoreCase(String value)

        IGNORE_CASE: Setting this option to true causes the generate token manager to ignore case in the token specifications and the input files. This is the property ignoreCase of the parser configuration.

      • getCommonTokenAction

        @Optional()@Input() final String getCommonTokenAction()

        COMMON_TOKEN_ACTION: When set to true, every call to the token manager's method "getNextToken" will cause a call to a used defined method "CommonTokenAction" after the token has been scanned in by the token manager. This is the property commonTokenAction of the parser configuration.

      • setCommonTokenAction

         final Unit setCommonTokenAction(String value)

        COMMON_TOKEN_ACTION: When set to true, every call to the token manager's method "getNextToken" will cause a call to a used defined method "CommonTokenAction" after the token has been scanned in by the token manager. This is the property commonTokenAction of the parser configuration.

      • getUserTokenManager

        @Optional()@Input() final String getUserTokenManager()

        USER_TOKEN_MANAGER: The default action is to generate a token manager that works on the specified grammar tokens. This is the property userTokenManager of the parser configuration.

      • setUserTokenManager

         final Unit setUserTokenManager(String value)

        USER_TOKEN_MANAGER: The default action is to generate a token manager that works on the specified grammar tokens. This is the property userTokenManager of the parser configuration.

      • getUserCharStream

        @Optional()@Input() final String getUserCharStream()

        USER_CHAR_STREAM: The default action is to generate a character stream reader as specified by the options JAVA_UNICODE_ESCAPE and UNICODE_INPUT. This is the property userCharStream of the parser configuration.

      • setUserCharStream

         final Unit setUserCharStream(String value)

        USER_CHAR_STREAM: The default action is to generate a character stream reader as specified by the options JAVA_UNICODE_ESCAPE and UNICODE_INPUT. This is the property userCharStream of the parser configuration.

      • getBuildParser

        @Optional()@Input() final String getBuildParser()

        BUILD_PARSER: When set to false, the parser file is not generated. This is the property buildParser of the parser configuration.

      • setBuildParser

         final Unit setBuildParser(String value)

        BUILD_PARSER: When set to false, the parser file is not generated. This is the property buildParser of the parser configuration.

      • getBuildTokenManager

        @Optional()@Input() final String getBuildTokenManager()

        BUILD_TOKEN_MANAGER: When set to false the token manager file is not generated. This is the property buildTokenManager of the parser configuration.

      • setBuildTokenManager

         final Unit setBuildTokenManager(String value)

        BUILD_TOKEN_MANAGER: When set to false the token manager file is not generated. This is the property buildTokenManager of the parser configuration.

      • getTokenManagerUsesParser

        @Optional()@Input() final String getTokenManagerUsesParser()

        TOKEN_MANAGER_USES_PARSER: When set to true, the generated token manager will include a field called parser that references the instantiating parser instance. This is the property tokenManagerUsesParser of the parser configuration.

      • setTokenManagerUsesParser

         final Unit setTokenManagerUsesParser(String value)

        TOKEN_MANAGER_USES_PARSER: When set to true, the generated token manager will include a field called parser that references the instantiating parser instance. This is the property tokenManagerUsesParser of the parser configuration.

      • getSanityCheck

        @Optional()@Input() final String getSanityCheck()

        SANITY_CHECK: JavaCC performs many syntactic and semantic checks on the grammar file during parser generation. This is the property sanityCheck of the parser configuration.

      • setSanityCheck

         final Unit setSanityCheck(String value)

        SANITY_CHECK: JavaCC performs many syntactic and semantic checks on the grammar file during parser generation. This is the property sanityCheck of the parser configuration.

      • getForceLaCheck

        @Optional()@Input() final String getForceLaCheck()

        FORCE_LA_CHECK: This option setting controls lookahead ambiguity checking performed by JavaCC. This is the property forceLaCheck of the parser configuration.

      • setForceLaCheck

         final Unit setForceLaCheck(String value)

        FORCE_LA_CHECK: This option setting controls lookahead ambiguity checking performed by JavaCC. This is the property forceLaCheck of the parser configuration.

      • getCacheTokens

        @Optional()@Input() final String getCacheTokens()

        CACHE_TOKENS: Setting this option to true causes the generated parser to lookahead for extra tokens ahead of time. This is the property cacheTokens of the parser configuration.

      • setCacheTokens

         final Unit setCacheTokens(String value)

        CACHE_TOKENS: Setting this option to true causes the generated parser to lookahead for extra tokens ahead of time. This is the property cacheTokens of the parser configuration.

      • getKeepLineColumn

        @Optional()@Input() final String getKeepLineColumn()

        KEEP_LINE_COLUMN: If you set this option to false, the generated CharStream will not have any line/column tracking code. This is the property keepLineColumn of the parser configuration.

      • setKeepLineColumn

         final Unit setKeepLineColumn(String value)

        KEEP_LINE_COLUMN: If you set this option to false, the generated CharStream will not have any line/column tracking code. This is the property keepLineColumn of the parser configuration.

      • getTokenExtends

        @Optional()@Input() final String getTokenExtends()

        TOKEN_EXTENDS: This is a string option whose default value is "", meaning that the generated Token class will extend java.lang.Object. This is the property tokenExtends of the parser configuration.

      • setTokenExtends

         final Unit setTokenExtends(String value)

        TOKEN_EXTENDS: This is a string option whose default value is "", meaning that the generated Token class will extend java.lang.Object. This is the property tokenExtends of the parser configuration.

      • getTokenFactory

        @Optional()@Input() final String getTokenFactory()

        TOKEN_FACTORY: This is a string option whose default value is "", meaning that Tokens will be created by calling Token.newToken(). This is the property tokenFactory of the parser configuration.

      • setTokenFactory

         final Unit setTokenFactory(String value)

        TOKEN_FACTORY: This is a string option whose default value is "", meaning that Tokens will be created by calling Token.newToken(). This is the property tokenFactory of the parser configuration.

      • getJavaCCArgs

        @Optional()@Input() final List<String> getJavaCCArgs()

        Property with additional command line arguments passed to javaCC.

      • getJjTree

        @Optional() final JJTree getJjTree()

        JJTree configuration container.

      • getToolsclasspathfiles

        @Classpath() final ConfigurableFileCollection getToolsclasspathfiles()

        Classpath with javaCC libraries.

        NOTE: this must not be resolved from the project. A by lazy block is evaluated while Gradle snapshots the task inputs - that already happens in the execution phase, where accessing Task.project is deprecated in Gradle 9 and fails in Gradle 10. The plugin wires this at configuration time instead.

      • provideOutputDir

         final Unit provideOutputDir(Provider<Directory> outputDir)

        Set provider for outputdir.

      • provideInputFile

         final Unit provideInputFile(Provider<RegularFile> inputFile)

        Set provider for inputFile.

      • generate

         final Unit generate()

        Task aktion for code generation.