Interface ISymbolTable<TConstant extends IConstant,​TOperator extends IOperator>

  • Type Parameters:
    TConstant - Type of the implementation for constant symbols.
    TOperator - Type of the implementation for operator symbols.

    public interface ISymbolTable<TConstant extends IConstant,​TOperator extends IOperator>
    A symbol table with a list of symbols that may occur in an infix expression.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getBinaryOperatorExample

        TOperator getBinaryOperatorExample()
        Returns:
        An example for a binary operator, used e.g. as an example in error messages.
      • getConstant

        TConstant getConstant​(String constantName)
        Parameters:
        constantName - Name of a constant symbol.
        Returns:
        The descriptor for the given constant.
      • getIdentifierTokenKind

        ETokenKind getIdentifierTokenKind​(String identifier)
        Discriminates the given identifier and decides whether it is a constant, a variable, or an operator.
        Parameters:
        identifier - An identifier contained in the infix expression.
        Returns:
        Whether the identifier is a ETokenKind.CONSTANT, an ETokenKind.OPERATOR, or a ETokenKind.VARIABLE. Must no return any other enum constant.
      • getOperator

        Iterable<TOperator> getOperator​(EOperatorType type)
        Parameters:
        type - Type to look for.
        Returns:
        All operators which support the given type.
      • getOperator

        TOperator getOperator​(String operatorName)
        Parameters:
        operatorName - Name of an operator symbol.
        Returns:
        The descriptor for the given operator.
      • getOperators

        Iterable<TOperator> getOperators()
        Returns:
        A list of all supported operators.
      • getUnaryPostfixOperatorExample

        TOperator getUnaryPostfixOperatorExample()
        Returns:
        An example for a postfix operator, used e.g. as an example in error messages.
      • getUnaryPrefixOperatorExample

        TOperator getUnaryPrefixOperatorExample()
        Returns:
        An example for a prefix operator, used e.g. as an example in error messages.
      • isEndsIdentifier

        boolean isEndsIdentifier​(int lastCodePoint,
                                 int currentCodePoint)
        Parameters:
        lastCodePoint - A code point in the expression.
        currentCodePoint - The following code point in the expression.
        Returns:
        true if the text up until the last code point is one identifier and the current code point starts a new identifier. For example, if the string a&&b should be interpreted as 3 tokens (variable a, operator &&, variable b), then the ampersand must mark the end of the variable name a.