edu.mit.csail.sdg.alloy4compiler.ast
Class Sig.Field

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4compiler.ast.Browsable
      extended by edu.mit.csail.sdg.alloy4compiler.ast.Expr
          extended by edu.mit.csail.sdg.alloy4compiler.ast.ExprHasName
              extended by edu.mit.csail.sdg.alloy4compiler.ast.Sig.Field
Enclosing class:
Sig

public static final class Sig.Field
extends ExprHasName

Mutable; represents a field.


Field Summary
 boolean defined
          True if this is a defined field.
 Pos isMeta
          Nonnull if this field is a meta field.
 Pos isPrivate
          Nonnull if the user wanted this field to be private.
 Sig sig
          The sig that this field belongs to; never null.
 
Fields inherited from class edu.mit.csail.sdg.alloy4compiler.ast.ExprHasName
label
 
Fields inherited from class edu.mit.csail.sdg.alloy4compiler.ast.Expr
ambiguous, closingBracket, errors, mult, pos, weight
 
Method Summary
 Decl decl()
          Return the declaration that this field came from.
 java.lang.String getHTML()
          Returns the description (as HTML) to show for this node.
 java.util.List<? extends Browsable> getSubnodes()
          Returns a list of subnodes for this node.
 Expr resolve(Type t, java.util.Collection<ErrorWarning> warns)
          Resolves this expression if ambiguous.
 java.lang.String toString()
          Returns a human-readable description of this field's name.
 void toString(java.lang.StringBuilder out, int indent)
          Print a textual description of it and all subnodes to a StringBuilder, with the given level of indentation.
 
Methods inherited from class edu.mit.csail.sdg.alloy4compiler.ast.ExprHasName
getDepth, isSame, span
 
Methods inherited from class edu.mit.csail.sdg.alloy4compiler.ast.Expr
and, any_arrow_lone, any_arrow_one, any_arrow_some, cardinality, cast2int, cast2sigint, closure, comprehensionOver, deNOP, div, domain, equal, equals, findAllFunctions, forAll, forLone, forNo, forOne, forSome, gt, gte, hashCode, hasVar, iff, iminus, implies, in, intersect, iplus, isSeq_arrow_lone, ite, join, lone_arrow_any, lone_arrow_lone, lone_arrow_one, lone_arrow_some, lone, loneOf, loneOf, lt, lte, minus, mul, mult, no, not, one_arrow_any, one_arrow_lone, one_arrow_one, one_arrow_some, one, oneOf, oneOf, or, override, plus, pos, product, range, reflexiveClosure, rem, resolve_as_formula, resolve_as_int, resolve_as_set, setOf, setOf, sha, shl, shr, some_arrow_any, some_arrow_lone, some_arrow_one, some_arrow_some, some, someOf, someOf, sumOver, transpose, type, typecheck_as_formula, typecheck_as_int, typecheck_as_set
 
Methods inherited from class edu.mit.csail.sdg.alloy4compiler.ast.Browsable
make, make, make, make, showAsTree
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

sig

public final Sig sig
The sig that this field belongs to; never null.


isPrivate

public final Pos isPrivate
Nonnull if the user wanted this field to be private.


isMeta

public final Pos isMeta
Nonnull if this field is a meta field.


defined

public final boolean defined
True if this is a defined field.

Method Detail

decl

public Decl decl()
Return the declaration that this field came from.


toString

public java.lang.String toString()
Returns a human-readable description of this field's name.

Overrides:
toString in class Expr

toString

public void toString(java.lang.StringBuilder out,
                     int indent)
Print a textual description of it and all subnodes to a StringBuilder, with the given level of indentation. (If indent<0, it will be printed in one line without line break)

Specified by:
toString in class Expr

resolve

public Expr resolve(Type t,
                    java.util.Collection<ErrorWarning> warns)
Resolves this expression if ambiguous. (And if t.size()>0, it represents the set of tuples whose presence/absence is relevent to the parent expression) (Note: it's possible for t to be EMPTY, or even ambiguous!)

On success: the return value will be well-typed and unambiguous

On failure: the return value's "errors" list will be nonempty

If we detect any type warnings, we will add the type warnings to the "warnings" collection.

Specified by:
resolve in class Expr
warns - - the list that will receive any warning we generate; can be null if we wish to ignore warnings

getHTML

public java.lang.String getHTML()
Returns the description (as HTML) to show for this node.

Specified by:
getHTML in class Browsable

getSubnodes

public java.util.List<? extends Browsable> getSubnodes()
Returns a list of subnodes for this node.

Specified by:
getSubnodes in class Browsable