Interface Rule

    • Method Detail

      • is

        @Deprecated
        Rule is​(Object... e)
        Deprecated.
        in 1.19, use GrammarRuleBuilder.is(Object) instead.
        Allows to provide definition of a grammar rule.

        Note: this method can be called only once for a rule. If it is called more than once, an IllegalStateException will be thrown.

        Parameters:
        e - expression of grammar that defines this rule
        Returns:
        this (for method chaining)
        Throws:
        IllegalStateException - if definition has been already done
        IllegalArgumentException - if any of given arguments is not a parsing expression
      • override

        @Deprecated
        Rule override​(Object... e)
        Deprecated.
        Allows to override definition of a grammar rule.

        This method has the same effect as #is(Object), except that it can be called more than once to redefine a rule from scratch.

        Parameters:
        e - expression of grammar that defines this rule
        Returns:
        this (for method chaining)
        Throws:
        IllegalArgumentException - if any of given arguments is not a parsing expression
      • skip

        @Deprecated
        void skip()
        Deprecated.
        in 1.19, use GrammarRuleBuilder.skip() instead.
        Indicates that grammar rule should not lead to creation of AST node - its children should be attached directly to its parent.
      • mock

        @Deprecated
        void mock()
        Deprecated.
        in 1.18, use override(Object...) instead.
        Utility method used for unit testing in order to dynamically replace the definition of the rule to match as soon as a token whose value equals the name of the rule is encountered.