edu.mit.csail.sdg.alloy4compiler.ast
Enum ExprUnary.Op

java.lang.Object
  extended by java.lang.Enum<ExprUnary.Op>
      extended by edu.mit.csail.sdg.alloy4compiler.ast.ExprUnary.Op
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ExprUnary.Op>
Enclosing class:
ExprUnary

public static enum ExprUnary.Op
extends java.lang.Enum<ExprUnary.Op>

This class contains all possible unary operators.


Enum Constant Summary
CARDINALITY
          cardinality of x (truncated to the current integer bitwidth)
CAST2INT
          IntAtom-to-integer
CAST2SIGINT
          integer-to-IntAtom
CLOSURE
          closure
EXACTLYOF
          :exactly x (where x is a set or relation)
LONE
          lone x (where x is a set or relation)
LONEOF
          :lone x (where x is a unary set)
NO
          no x (where x is a set or relation)
NOOP
          No-Operation
NOT
          not f (where f is a formula)
ONE
          one x (where x is a set or relation)
ONEOF
          :one x (where x is a unary set)
RCLOSURE
          reflexive closure
SETOF
          :set x (where x is a set or relation)
SOME
          some x (where x is a set or relation)
SOMEOF
          :some x (where x is a unary set)
TRANSPOSE
          transpose
 
Method Summary
 Expr make(Pos pos, Expr sub)
          Construct an ExprUnary node.
 Expr make(Pos pos, Expr sub, Err extraError, long extraWeight)
          Construct an ExprUnary node.
 java.lang.String toHTML()
          Returns the human readable label already encoded for HTML
 java.lang.String toString()
          Returns the human readable label for this operator
static ExprUnary.Op valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ExprUnary.Op[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SOMEOF

public static final ExprUnary.Op SOMEOF
:some x (where x is a unary set)


LONEOF

public static final ExprUnary.Op LONEOF
:lone x (where x is a unary set)


ONEOF

public static final ExprUnary.Op ONEOF
:one x (where x is a unary set)


SETOF

public static final ExprUnary.Op SETOF
:set x (where x is a set or relation)


EXACTLYOF

public static final ExprUnary.Op EXACTLYOF
:exactly x (where x is a set or relation)


NOT

public static final ExprUnary.Op NOT
not f (where f is a formula)


NO

public static final ExprUnary.Op NO
no x (where x is a set or relation)


SOME

public static final ExprUnary.Op SOME
some x (where x is a set or relation)


LONE

public static final ExprUnary.Op LONE
lone x (where x is a set or relation)


ONE

public static final ExprUnary.Op ONE
one x (where x is a set or relation)


TRANSPOSE

public static final ExprUnary.Op TRANSPOSE
transpose


RCLOSURE

public static final ExprUnary.Op RCLOSURE
reflexive closure


CLOSURE

public static final ExprUnary.Op CLOSURE
closure


CARDINALITY

public static final ExprUnary.Op CARDINALITY
cardinality of x (truncated to the current integer bitwidth)


CAST2INT

public static final ExprUnary.Op CAST2INT
IntAtom-to-integer


CAST2SIGINT

public static final ExprUnary.Op CAST2SIGINT
integer-to-IntAtom


NOOP

public static final ExprUnary.Op NOOP
No-Operation

Method Detail

values

public static ExprUnary.Op[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ExprUnary.Op c : ExprUnary.Op.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ExprUnary.Op valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

make

public final Expr make(Pos pos,
                       Expr sub)
Construct an ExprUnary node.

Parameters:
pos - - the original position of the "unary operator" in the file (can be null if unknown)
sub - - the subexpression

Alloy4 disallows multiplicity like this: "variable : one (X lone-> Y)",
that is, a some/lone/one in front of an arrow multiplicity declaration.
Alloy4 does allow "variable : set (X lone-> Y)", where we ignore the word "set".
(This desugaring is done by the ExprUnary.Op.make() method, so ExprUnary's constructor never sees it)


make

public final Expr make(Pos pos,
                       Expr sub,
                       Err extraError,
                       long extraWeight)
Construct an ExprUnary node.

Parameters:
pos - - the original position of the "unary operator" in the file (can be null if unknown)
sub - - the subexpression
extraError - - if nonnull, it will be appended as an extra error
extraWeight - - it's the amount of extra weight

Alloy4 disallows multiplicity like this: "variable : one (X lone-> Y)",
that is, a some/lone/one in front of an arrow multiplicity declaration.
Alloy4 does allow "variable : set (X lone-> Y)", where we ignore the word "set".
(This desugaring is done by the ExprUnary.Op.make() method, so ExprUnary's constructor never sees it)


toString

public final java.lang.String toString()
Returns the human readable label for this operator

Overrides:
toString in class java.lang.Enum<ExprUnary.Op>

toHTML

public final java.lang.String toHTML()
Returns the human readable label already encoded for HTML