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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag allows block comments.static final intFlag allows blocks bounded by curly brackets.static final intRecognize '.'(_,_) as a list term.static final intEmpty flags, no any flag defined.static final intFlag allows variable as structure functor.static final intWhite-space char is allowed in zero quotation mode.static final intFlag allows construction 0'{char} to get char code.static final intFlag allows zero-arity structures. -
Method Summary
Modifier and TypeMethodDescriptionfindOpForName(PrologParser source, String name) Find operators for their name.intgetFlags()get parser flags for the parser context.default intGet maximum allowed length value for internal parser text buffers.booleanhasOpStartsWith(PrologParser source, String namePrefix) Check that the context contains an operator starts with some string
-
Field Details
-
FLAG_NONE
static final int FLAG_NONEEmpty flags, no any flag defined.- See Also:
-
FLAG_BLOCK_COMMENTS
static final int FLAG_BLOCK_COMMENTSFlag allows block comments.- See Also:
-
FLAG_ZERO_QUOTATION_CHARCODE
static final int FLAG_ZERO_QUOTATION_CHARCODEFlag 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_FUNCTORFlag allows variable as structure functor. Example: Var(a,b,c).- See Also:
-
FLAG_ZERO_STRUCT
static final int FLAG_ZERO_STRUCTFlag allows zero-arity structures. Example: a().- See Also:
-
FLAG_CURLY_BRACKETS
static final int FLAG_CURLY_BRACKETSFlag allows blocks bounded by curly brackets. Example: {a,{b,!,c}}- See Also:
-
FLAG_DOT2_AS_LIST
static final int FLAG_DOT2_AS_LISTRecognize '.'(_,_) as a list term.- See Also:
-
FLAG_ZERO_QUOTATION_ALLOWS_WHITESPACE_CHAR
static final int FLAG_ZERO_QUOTATION_ALLOWS_WHITESPACE_CHARWhite-space char is allowed in zero quotation mode.- Since:
- 2.0.2
- See Also:
-
-
Method Details
-
hasOpStartsWith
Check that the context contains an operator starts with some string- Parameters:
source- source prolog parser making request, must not be nullnamePrefix- 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
Find operators for their name.- Parameters:
source- source prolog parser making request, must not be nullname- 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:
-