Class ParserContextChain
java.lang.Object
com.igormaznitsa.prologparser.ParserContextChain
- All Implemented Interfaces:
ParserContext
Auxiliary class allows to make chain of prolog contexts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ParserContext[]private final intprivate final intFields inherited from interface ParserContext
FLAG_BLOCK_COMMENTS, FLAG_CURLY_BRACKETS, FLAG_DOT2_AS_LIST, FLAG_NONE, FLAG_VAR_AS_FUNCTOR, FLAG_ZERO_QUOTATION_ALLOWS_WHITESPACE_CHAR, FLAG_ZERO_QUOTATION_CHARCODE, FLAG_ZERO_STRUCT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindOpForName(PrologParser source, String name) Find operators for their name.intgetFlags()get parser flags for the parser context.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 stringstatic ParserContextof(ParserContext... contexts)
-
Field Details
-
contexts
-
tokenizerFlags
private final int tokenizerFlags -
minDetectedAllowedBufferSize
private final int minDetectedAllowedBufferSize
-
-
Constructor Details
-
ParserContextChain
-
-
Method Details
-
of
-
getMaxTokenizerBufferLength
public int getMaxTokenizerBufferLength()Description copied from interface:ParserContextGet maximum allowed length value for internal parser text buffers.- Specified by:
getMaxTokenizerBufferLengthin interfaceParserContext- Returns:
- maximum allowed text parser buffers length in chars
-
hasOpStartsWith
Description copied from interface:ParserContextCheck that the context contains an operator starts with some string- Specified by:
hasOpStartsWithin interfaceParserContext- 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
Description copied from interface:ParserContextFind operators for their name.- Specified by:
findOpForNamein interfaceParserContext- 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
-
getFlags
public int getFlags()Description copied from interface:ParserContextget parser flags for the parser context.- Specified by:
getFlagsin interfaceParserContext- Returns:
- flags as bit field
- See Also:
-