Class JavaIfRule

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

    public class JavaIfRule
    extends java.lang.Object
    implements GrammaticalRuleI
    Parse a java style if statement: if(expr) statement [ else statement ]
     <JavaInRule> ::=
       || <if> <open> <expression> <close> <statement>
       || <if> <open> <expression> <close> <statement> <else> <statement> 
     
    Author:
    Richard Morris
    See Also:
    Serialized Form
    • Constructor Detail

      • JavaIfRule

        public JavaIfRule​(SymbolToken ifToken,
                          SymbolToken open,
                          GrammaticalRuleI expression,
                          SymbolToken close,
                          GrammaticalRuleI statement,
                          SymbolToken elseToken)
        Parameters:
        ifToken - token representing "if"
        open - opening bracket
        expression - rule for parsing expressions
        close - closing bracket
        statement - rule for parsing statements
        elseToken - token representing "else"
    • 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.