Class AbstractDirectiveHandler

    • Field Detail

      • DIRECTIVE_PREFIX

        public static final java.lang.String DIRECTIVE_PREFIX
        The common preprocessor prefix for all directives
        See Also:
        Constant Field Values
      • PREFIX_FOR_KEEPING_LINES

        public static final java.lang.String PREFIX_FOR_KEEPING_LINES
        The prefix for lines to be kept by preprocessor
        See Also:
        Constant Field Values
      • PREFIX_FOR_KEEPING_LINES_PROCESSED_DIRECTIVES

        public static final java.lang.String PREFIX_FOR_KEEPING_LINES_PROCESSED_DIRECTIVES
        The prefix for lines to be kept by preprocessor, which contain processed directives
        See Also:
        Constant Field Values
      • ONE_LINE_COMMENT

        public static final java.lang.String ONE_LINE_COMMENT
        The prefix for one line comment
        See Also:
        Constant Field Values
      • DIRECTIVES

        public static final AbstractDirectiveHandler[] DIRECTIVES
        The array contains all directives of the preprocessor
      • GLOBAL_DIRECTIVES

        public static final AbstractDirectiveHandler[] GLOBAL_DIRECTIVES
        The array contains preprocessor directives active only during the global preprocessing phase
    • Constructor Detail

      • AbstractDirectiveHandler

        public AbstractDirectiveHandler()
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        Get the name of the directive without prefix
        Returns:
        the directive name, must not be null
      • getReference

        public abstract java.lang.String getReference()
        Get the directive reference, it will be printed for a help request
        Returns:
        the directive reference as a String, must not be null
      • getFullName

        public java.lang.String getFullName()
        Get the directive name with prefix
        Returns:
        the full directive name (it including prefix)
      • getArgumentType

        public DirectiveArgumentType getArgumentType()
        Get the argument type needed by the directive
        Returns:
        the argument type needed by the directive, it can't be null
      • execute

        public abstract AfterDirectiveProcessingBehaviour execute​(java.lang.String tailString,
                                                                  PreprocessorContext context)
        Execute directive
        Parameters:
        tailString - the tail of the string where the directive has been met, must not be null but can be empty
        context - the preprocessor context
        Returns:
        the needed preprocessor behavior, must not be null
      • executeOnlyWhenExecutionAllowed

        public boolean executeOnlyWhenExecutionAllowed()
        Shows that the directive can be executed only when the preprocessing n active state i.e. if it is in active block //#if..//#endif of //#while
        Returns:
        true if the directive can be executed only if it is in active block, else the directive will be called in any case
      • isGlobalPhaseAllowed

        public boolean isGlobalPhaseAllowed()
        Shows that the directive can be executed during a global preprocessing phase
        Returns:
        true if the directive allows the global directive phase, false if the directive must be ignored during that phase
      • isPreprocessingPhaseAllowed

        public boolean isPreprocessingPhaseAllowed()
        Shows that the directive can be executed during the second preprocessing phase
        Returns:
        true uf the directive can be executed during the second preprocessing phase else false if the directive must be ignored
      • isDeprecated

        public boolean isDeprecated()
        Check that the directive is deprecated one and can be removed in a next release
        Returns:
        true if the directive is deprecated, false otherwise