@Ser public interface ICOperator
This interface is used to define a C operator.
  • Field Details

  • Method Details

    • getType

      COperatorType getType()
    • checkType

      default boolean checkType(COperatorType... candidateTypes)
    • isRegular

      boolean isRegular()
    • isCustom

      boolean isCustom()
    • isCast

      boolean isCast()
    • getCastType

      ICType getCastType()
    • getOperandCount

      int getOperandCount()
    • isUnary

      boolean isUnary()
    • isBinary

      boolean isBinary()
    • isTertiary

      boolean isTertiary()
    • isValidForCombinedAssignment

      boolean isValidForCombinedAssignment()
      Determine if this operator is one of the 11 (+1) arithmetic operators that can be used to build a combined-operator assignment.
      Returns:
      true if one of: mul, div, add, sub, rem, shl, shr, ushr, and, xor, or
    • getPrecedenceDelta

      int getPrecedenceDelta(ICOperator other) throws Exception
      Check the precedence of this operator against another operator.
      Returns:
      delta: <0 if this operator has higher precedence than other, 0 if their precedence is the same, or >0 if this operator has lower precedence than other.
      Throws:
      Exception
    • getPrecedence

      int getPrecedence()
      Get the precedence of the operator. Currently not implemented for all operators, and the method will throw if it cannot find a precedence value.
      Returns:
      Throws:
      RuntimeException - if the precedence is not found
    • getAssociativity

      COperatorType.Associativity getAssociativity()
      Get the associativity (left, right) of the operator.
      Returns:
      Throws:
      RuntimeException - if the associativity is not found
    • getReverse

      ICOperator getReverse()
    • getMirror

      ICOperator getMirror()