Class StatementRule

  • All Implemented Interfaces:
    GrammaticalRuleI, GrammarMatcher, java.io.Serializable

    public class StatementRule
    extends java.lang.Object
    implements GrammaticalRuleI
    Parse a single statement from a list of possibilities.
     <StatementRule> ::=
            | <expression1>
            | <JavaWhileRule2>
      | ....
     
    Returns the result of the first successful statement parsed.
    Author:
    Richard Morris
    See Also:
    Serialized Form
    • Constructor Detail

      • StatementRule

        public StatementRule()
    • Method Detail

      • addRule

        public boolean addRule​(GrammaticalRuleI rule)
        Adds a new rule.
        Parameters:
        rule - the rule to be added.
        Returns:
        true
      • getRules

        public java.util.List<GrammaticalRuleI> getRules()
        The list of rules
        Returns:
        the list of rules.
      • init

        public void init​(Jep jep)
        Description copied from interface: GrammarMatcher
        Delayed initialisation, this methods is called whenever components of the jep instance are changed.
        Specified by:
        init in interface GrammarMatcher
        Parameters:
        jep - the current jep instance.