Class Op
- java.lang.Object
-
- com.igormaznitsa.prologparser.terms.PrologTerm
-
- com.igormaznitsa.prologparser.tokenizer.Op
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<PrologTerm>
public final class Op extends PrologTerm
Prolog operator definition.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<Op>GNUSet of operators for GNU Prolog.static OpGNU_DIV_RDIVstatic OpGNU_DOUBLE_DOTstatic java.util.List<Op>GNU_FDSet of Finite Domain operators for GNU Prolog.static java.util.List<Op>GNU_SPECIFICSet of operators is specific for GNU Prolog use.static OpGNU_STAR_THENstatic OpGNU_UNARY_PLUSstatic java.util.List<Op>ISOSet of operators for ISO Prolog standard.static OpISO_ARITH_DIVIDEstatic OpISO_ARITH_MUL_DIVstatic OpISO_ARITH_PLUS_MINUSstatic OpISO_ARITH_POWERstatic OpISO_BITWISE_AND_ORstatic OpISO_BITWISE_NEGATIONstatic OpISO_BITWISE_SHIFTstatic OpISO_CLAUSESstatic OpISO_DIRECTIVESstatic OpISO_NEGATEstatic OpISO_ORstatic OpISO_ORDER_ARITHstatic OpISO_ORDER_TERMstatic OpISO_THENstatic OpISO_UNARY_MINUSstatic OpISO_UNIFICATIONstatic OpMETAOPERATOR_COMMAstatic OpMETAOPERATOR_DOTstatic OpMETAOPERATOR_LEFT_BRACKETstatic OpMETAOPERATOR_LEFT_CURLY_BRACKETstatic OpMETAOPERATOR_LEFT_SQUARE_BRACKETstatic OpMETAOPERATOR_RIGHT_BRACKETstatic OpMETAOPERATOR_RIGHT_CURLY_BRACKETstatic OpMETAOPERATOR_RIGHT_SQUARE_BRACKETstatic OpMETAOPERATOR_VERTICAL_BARstatic OpMODIFIERSprivate java.lang.String[]multiNamesprivate OpAssocopAssocprivate intprecedencestatic intPRECEDENCE_MAXstatic intPRECEDENCE_MINprivate intpreparedHashprivate static longserialVersionUIDstatic java.util.List<Op>SICTUS_SPECIFICstatic java.util.List<Op>SWISet of operators for SWI Prolog.static java.util.List<Op>SWI_CPLSet of Constraint Logic Programming operators for SWI Prolog.static java.util.List<Op>SWI_SPECIFICSet of operators is specific for SWI Prolog use.static OpVIRTUAL_OPERATOR_BLOCKstatic OpVIRTUAL_OPERATOR_CURLY_BLOCK-
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)private static java.lang.StringassertOpValidOpName(java.lang.String name)private static java.lang.String[]assertOpValidOpName(java.lang.String[] names)booleanequals(java.lang.Object obj)intgetArity()Arity of element.OpAssocgetAssoc()intgetPrecedence()Get precedence of the term.TermTypegetType()Get term type.inthashCode()booleanisCompatibleWith(PrologStruct struct)booleanisMultiName()static java.util.List<Op>join(java.util.List<Op>... args)static Opmake(int precedence, OpAssoc type, java.lang.String... names)Make operator descriptor describing bunch of operators with same characteristics but differently named.static OpmakeSystem(int precedence, OpAssoc type, java.lang.String... names)private java.lang.ObjectreadResolve()java.util.stream.Stream<Op>streamOp()java.lang.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
-
SICTUS_SPECIFIC
public static final java.util.List<Op> SICTUS_SPECIFIC
-
ISO
public static final java.util.List<Op> ISO
Set of operators for ISO Prolog standard.
-
GNU_SPECIFIC
public static final java.util.List<Op> GNU_SPECIFIC
Set of operators is specific for GNU Prolog use.
-
SWI_SPECIFIC
public static final java.util.List<Op> SWI_SPECIFIC
Set of operators is specific for SWI Prolog use.
-
SWI
public static final java.util.List<Op> SWI
Set of operators for SWI Prolog.
-
GNU_FD
public static final java.util.List<Op> GNU_FD
Set of Finite Domain operators for GNU Prolog.
-
GNU
public static final java.util.List<Op> GNU
Set of operators for GNU Prolog.
-
SWI_CPL
public static final java.util.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
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
opAssoc
private final OpAssoc opAssoc
-
precedence
private final int precedence
-
preparedHash
private final int preparedHash
-
multiNames
private final java.lang.String[] multiNames
-
-
Constructor Detail
-
Op
private Op(int precedence, OpAssoc type, java.lang.String name, java.lang.String[] multiNames)
-
-
Method Detail
-
assertOpValidOpName
private static java.lang.String[] assertOpValidOpName(java.lang.String[] names)
-
assertOpValidOpName
private static java.lang.String assertOpValidOpName(java.lang.String name)
-
make
public static Op make(int precedence, OpAssoc type, java.lang.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
-
isMultiName
public boolean isMultiName()
-
streamOp
public java.util.stream.Stream<Op> streamOp()
-
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)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classPrologTerm
-
readResolve
private java.lang.Object readResolve()
-
-