Class JavaWhileRule

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

    public class JavaWhileRule
    extends java.lang.Object
    implements GrammaticalRuleI
    Parse a Java-style while loop while(x<10) x=x+1;
     <JavaWhileRule> ::=
             <while> <open> <expression> <close> <statement>
     
    A successful parse will return a LoopNode.
    See Also:
    Serialized Form
    • Constructor Detail

      • JavaWhileRule

        public JavaWhileRule​(SymbolToken whileToken,
                             SymbolToken open,
                             GrammaticalRuleI expression,
                             SymbolToken close,
                             GrammaticalRuleI statement)
        Parameters:
        whileToken - token for the while symbol
        open - opening bracket
        expression - rule to parse an expression
        close - closing bracket
        statement - rule to parse an statement
    • Method Detail

      • 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.