edu.mit.csail.sdg.alloy4compiler.ast
Class CommandScope

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4compiler.ast.CommandScope

public class CommandScope
extends java.lang.Object

Immutable; reresents a scope in a "run" or "check" command.

Invariant: sig != null

Invariant: endingScope >= startingScope >= 0

Invariant: increment > 0


Field Summary
 int endingScope
          The ending scope; if this sig is not a growing sig, then this.startingScope==this.endingScope.
 int increment
          The scope increment; if this sig is not a growing sig, then this.increment is ignored.
 boolean isExact
          True iff the scope is an exact scope.
 Pos pos
          The position in the original source file where this scope was declared; can be Pos.UNKNOWN if unknown.
 Sig sig
          The sig whose scope is being given by this CommandScope object.
 int startingScope
          The starting scope.
 
Constructor Summary
CommandScope(Pos pos, Sig sig, boolean isExact, int startingScope, int endingScope, int increment)
          Construct a new CommandScope object.
CommandScope(Sig sig, boolean isExact, int scope)
          Construct a new CommandScope object.
 
Method Summary
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pos

public final Pos pos
The position in the original source file where this scope was declared; can be Pos.UNKNOWN if unknown.


sig

public final Sig sig
The sig whose scope is being given by this CommandScope object.


isExact

public final boolean isExact
True iff the scope is an exact scope.


startingScope

public final int startingScope
The starting scope.


endingScope

public final int endingScope
The ending scope; if this sig is not a growing sig, then this.startingScope==this.endingScope.


increment

public final int increment
The scope increment; if this sig is not a growing sig, then this.increment is ignored.

Constructor Detail

CommandScope

public CommandScope(Sig sig,
                    boolean isExact,
                    int scope)
             throws ErrorSyntax
Construct a new CommandScope object.

Parameters:
sig - - the sig for this scope
isExact - - true iff the scope is intended to be exact
scope - - the scope
Throws:
ErrorSyntax - if scope is less than zero

CommandScope

public CommandScope(Pos pos,
                    Sig sig,
                    boolean isExact,
                    int startingScope,
                    int endingScope,
                    int increment)
             throws ErrorSyntax
Construct a new CommandScope object.

Parameters:
pos - - the position where this scope is given
sig - - the sig for this scope
isExact - - true iff the scope is intended to be exact
startingScope - - the starting scope
endingScope - - the ending scope (if this sig is not intended to be growable, then startingScope should equal endingScope)
increment - - the scope increment (if this sig is not intended to be growable, then this field is ignored)
Throws:
ErrorSyntax - if startingScope is less than zero
ErrorSyntax - if endingScope is less than startingScope
ErrorSyntax - if increment is less than one
Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object