- java.lang.Object
-
- com.igormaznitsa.prologparser.terms.PrologTerm
-
- com.igormaznitsa.prologparser.tokenizer.Op
-
- All Implemented Interfaces:
Serializable,Comparable<PrologTerm>
public final class Op extends PrologTerm
Prolog operator definition.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
quotation, text
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Op[]add(Op[] args, Op... ops)booleanequals(Object obj)intgetArity()Arity of element.OpAssocgetAssoc()intgetPrecedence()Get precedence of the term.TermTypegetType()Get term type.inthashCode()booleanisCompatibleWith(PrologStruct struct)booleanisMultiName()static List<Op>join(List<Op>... args)static Opmake(int precedence, OpAssoc type, String... names)Make operator descriptor describing bunch of operators with same characteristics but differently named.static OpmakeSystem(int precedence, OpAssoc type, String... names)Stream<Op>streamOp()StringtoString()-
Methods inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
assertNonEmptyString, compareTo, findQuotation, flatComma, getFunctor, getLine, getPos, getQuotation, getText, isAnyBlock, isBlock, isCurlyBlock, setLine, setPos, stream
-
-
-
-
Field Detail
-
PRECEDENCE_MAX
public static final int PRECEDENCE_MAX
- See Also:
- Constant Field Values
-
PRECEDENCE_MIN
public static final int PRECEDENCE_MIN
- See Also:
- Constant Field Values
-
GNU_UNARY_PLUS
public static final Op GNU_UNARY_PLUS
-
ISO_BITWISE_NEGATION
public static final Op ISO_BITWISE_NEGATION
-
ISO_UNARY_MINUS
public static final Op ISO_UNARY_MINUS
-
ISO_UNIFICATION
public static final Op ISO_UNIFICATION
-
ISO_BITWISE_SHIFT
public static final Op ISO_BITWISE_SHIFT
-
ISO_ORDER_TERM
public static final Op ISO_ORDER_TERM
-
ISO_ORDER_ARITH
public static final Op ISO_ORDER_ARITH
-
ISO_ARITH_PLUS_MINUS
public static final Op ISO_ARITH_PLUS_MINUS
-
ISO_ARITH_MUL_DIV
public static final Op ISO_ARITH_MUL_DIV
-
ISO_ARITH_POWER
public static final Op ISO_ARITH_POWER
-
ISO_ARITH_DIVIDE
public static final Op ISO_ARITH_DIVIDE
-
ISO_NEGATE
public static final Op ISO_NEGATE
-
ISO_CLAUSES
public static final Op ISO_CLAUSES
-
ISO_DIRECTIVES
public static final Op ISO_DIRECTIVES
-
ISO_BITWISE_AND_OR
public static final Op ISO_BITWISE_AND_OR
-
MODIFIERS
public static final Op MODIFIERS
-
GNU_DIV_RDIV
public static final Op GNU_DIV_RDIV
-
ISO_OR
public static final Op ISO_OR
-
ISO_THEN
public static final Op ISO_THEN
-
GNU_STAR_THEN
public static final Op GNU_STAR_THEN
-
GNU_DOUBLE_DOT
public static final Op GNU_DOUBLE_DOT
-
GNU_SPECIFIC
public static final List<Op> GNU_SPECIFIC
Set of operators is specific for GNU Prolog use.
-
SWI_SPECIFIC
public static final List<Op> SWI_SPECIFIC
Set of operators is specific for SWI Prolog use.
-
SWI_CPL
public static final List<Op> SWI_CPL
Set of Constraint Logic Programming operators for SWI Prolog.
-
VIRTUAL_OPERATOR_BLOCK
public static final Op VIRTUAL_OPERATOR_BLOCK
-
VIRTUAL_OPERATOR_CURLY_BLOCK
public static final Op VIRTUAL_OPERATOR_CURLY_BLOCK
-
METAOPERATOR_COMMA
public static final Op METAOPERATOR_COMMA
-
METAOPERATOR_LEFT_BRACKET
public static final Op METAOPERATOR_LEFT_BRACKET
-
METAOPERATOR_LEFT_CURLY_BRACKET
public static final Op METAOPERATOR_LEFT_CURLY_BRACKET
-
METAOPERATOR_RIGHT_BRACKET
public static final Op METAOPERATOR_RIGHT_BRACKET
-
METAOPERATOR_RIGHT_CURLY_BRACKET
public static final Op METAOPERATOR_RIGHT_CURLY_BRACKET
-
METAOPERATOR_LEFT_SQUARE_BRACKET
public static final Op METAOPERATOR_LEFT_SQUARE_BRACKET
-
METAOPERATOR_RIGHT_SQUARE_BRACKET
public static final Op METAOPERATOR_RIGHT_SQUARE_BRACKET
-
METAOPERATOR_DOT
public static final Op METAOPERATOR_DOT
-
METAOPERATOR_VERTICAL_BAR
public static final Op METAOPERATOR_VERTICAL_BAR
-
-
Method Detail
-
make
public static Op make(int precedence, OpAssoc type, String... names)
Make operator descriptor describing bunch of operators with same characteristics but differently named.- Parameters:
precedence- the precedencetype- the type of operatorsnames- names of operators, must not be empty or contain null- Returns:
- generated operator descriptor
- See Also:
OpAssoc
-
join
@SafeVarargs public static List<Op> join(List<Op>... args)
-
isMultiName
public boolean isMultiName()
-
getArity
public int getArity()
Description copied from class:PrologTermArity of element.- Overrides:
getArityin classPrologTerm- Returns:
- arity of element, make sense for compound terms, for primitive terms is 1
-
getType
public TermType getType()
Description copied from class:PrologTermGet term type.- Specified by:
getTypein classPrologTerm- Returns:
- term type, must not be null
-
getAssoc
public OpAssoc getAssoc()
-
getPrecedence
public int getPrecedence()
Description copied from class:PrologTermGet precedence of the term.- Overrides:
getPrecedencein classPrologTerm- Returns:
- precedence, must not be negative
-
isCompatibleWith
public boolean isCompatibleWith(PrologStruct struct)
-
toString
public String toString()
- Overrides:
toStringin classPrologTerm
-
-