Class DefaultParserContext
java.lang.Object
com.igormaznitsa.prologparser.DefaultParserContext
- All Implemented Interfaces:
ParserContext
Default implementation of parser context.
It is not thread safe one!
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Op[]protected final Map<String, OpContainer> protected 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 TypeMethodDescriptionfinal DefaultParserContextprotected voidfillPrefixes(String name) findOpForName(PrologParser source, String operatorName) Find operators for their name.intgetFlags()get parser flags for the parser context.booleanhasOpStartsWith(PrologParser source, String operatorNameStartSubstring) Check that the context contains an operator starts with some stringstatic ParserContextof(int parserContextFlags) static ParserContextstatic ParserContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ParserContext
getMaxTokenizerBufferLength
-
Field Details
-
EMPTY
-
opPrefixes
-
opContainers
-
parserContextFlags
protected final int parserContextFlags
-
-
Constructor Details
-
DefaultParserContext
public DefaultParserContext(int parserContextFlags)
-
-
Method Details
-
of
-
of
-
of
-
findAllOperators
-
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:
-
fillPrefixes
-
addOps
-
addOps
-
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 nulloperatorNameStartSubstring- 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 nulloperatorName- name of operators, must not be null- Returns:
- operator container if such one is found, null otherwise
-