Interface ParserContext

All Known Implementing Classes:
DefaultParserContext, ParserContextChain

public interface ParserContext
Context which provides flags and operator storage for a prolog parser.
See Also:
  • Field Details

    • FLAG_NONE

      static final int FLAG_NONE
      Empty flags, no any flag defined.
      See Also:
    • FLAG_BLOCK_COMMENTS

      static final int FLAG_BLOCK_COMMENTS
      Flag allows block comments.
      See Also:
    • FLAG_ZERO_QUOTATION_CHARCODE

      static final int FLAG_ZERO_QUOTATION_CHARCODE
      Flag allows construction 0'{char} to get char code. Example: 0'a, 0'\r
      See Also:
    • FLAG_VAR_AS_FUNCTOR

      static final int FLAG_VAR_AS_FUNCTOR
      Flag allows variable as structure functor. Example: Var(a,b,c).
      See Also:
    • FLAG_ZERO_STRUCT

      static final int FLAG_ZERO_STRUCT
      Flag allows zero-arity structures. Example: a().
      See Also:
    • FLAG_CURLY_BRACKETS

      static final int FLAG_CURLY_BRACKETS
      Flag allows blocks bounded by curly brackets. Example: {a,{b,!,c}}
      See Also:
    • FLAG_DOT2_AS_LIST

      static final int FLAG_DOT2_AS_LIST
      Recognize '.'(_,_) as a list term.
      See Also:
    • FLAG_ZERO_QUOTATION_ALLOWS_WHITESPACE_CHAR

      static final int FLAG_ZERO_QUOTATION_ALLOWS_WHITESPACE_CHAR
      White-space char is allowed in zero quotation mode.
      Since:
      2.0.2
      See Also:
  • Method Details

    • hasOpStartsWith

      boolean hasOpStartsWith(PrologParser source, String namePrefix)
      Check that the context contains an operator starts with some string
      Parameters:
      source - source prolog parser making request, must not be null
      namePrefix - string to be used to look for operator starts with it, must not be null
      Returns:
      true if there is such operator, false otherwise
    • findOpForName

      OpContainer findOpForName(PrologParser source, String name)
      Find operators for their name.
      Parameters:
      source - source prolog parser making request, must not be null
      name - name of operators, must not be null
      Returns:
      operator container if such one is found, null otherwise
    • getMaxTokenizerBufferLength

      default int getMaxTokenizerBufferLength()
      Get maximum allowed length value for internal parser text buffers.
      Returns:
      maximum allowed text parser buffers length in chars
    • getFlags

      int getFlags()
      get parser flags for the parser context.
      Returns:
      flags as bit field
      See Also: