Class DivisionExpression

All Implemented Interfaces:
Expression

public final class DivisionExpression extends ArithmeticExpression
One of the four binary operators. A division is a mathematical operation of dividing one operand (the dividend) by a second operand (the divisor).
BNF: arithmetic_expression ::= arithmetic_expression / arithmetic_term

Version:
2.4
Author:
Pascal Filion
  • Constructor Details

    • DivisionExpression

      public DivisionExpression(AbstractExpression parent)
      Creates a new DivisionExpression.
      Parameters:
      parent - The parent of this expression
  • Method Details

    • accept

      public void accept(ExpressionVisitor visitor)
      Description copied from interface: Expression
      Visits this Expression by the given visitor.
      Parameters:
      visitor - The ExpressionVisitor to visit this object
    • isParsingComplete

      protected boolean isParsingComplete(WordParser wordParser, String word, Expression expression)
      Description copied from class: AbstractExpression
      Determines whether the parsing is complete based on what is left in the given text. The text is never empty.
      Overrides:
      isParsingComplete in class ArithmeticExpression
      Parameters:
      wordParser - The text to parse based on the current position of the cursor
      word - The word that was retrieved from the given text, which is the first word in the text
      expression - The Expression that has already been parsed
      Returns:
      true if the text no longer can't be parsed by the current expression; false if more can be parsed