ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

escjava.translate
Class NoWarn

java.lang.Object
  extended byescjava.translate.NoWarn

public class NoWarn
extends java.lang.Object

Handles turning off warnings.


Field Summary
private static int[] chkStatus
          * Global nowarns: * *
static int globalStatus
           
private static LexicalPragmaVec nowarns
          * Registering nowarns annotations and checking * that they are legal ones
private static int noWarnStreamId
          The line # and streamId to nowarn before (cf. setStartLine).
private static int startLine
           
static boolean useGlobalStatus
           
 
Constructor Summary
NoWarn()
           
 
Method Summary
(package private) static boolean beforeLine(int loc, int lineNo, int streamId)
          Is a given line # in a given stream (id) before (exclusive) the line that contains a given location?
static int getChkStatus(int tag)
           
static int getChkStatus(int tag, int locUse, int locPragmaDecl)
          Returns how the check tag should be interpreted.
static void init()
           
(package private) static boolean inRange(int startLoc, int endLoc, int lineNo, int streamId)
          Is a given line # in a given stream (id) between the lines that contain the two given locations (inclusive)?
(package private) static boolean onLine(int loc, int lineNo, int streamId)
          Is loc on a given line number in a given stream?
static void registerNowarns(LexicalPragmaVec v)
           
static void setAllChkStatus(int status)
           
static void setChkStatus(int tag, int status)
          Sets how the check tag should be interpreted.
static void setStartLine(int line, CompilationUnit cu)
          Set a nowarn to ignore all lines before a given line in a given CompilationUnit.
static int toNoWarnTag(java.lang.String name)
          Convert a nowarn category to its tag.
static void typecheckRegisteredNowarns()
          Type checks the registered nowarn pragmas, reporting errors to ErrorSet appropriately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chkStatus

private static final int[] chkStatus
* Global nowarns: * *


useGlobalStatus

public static boolean useGlobalStatus

globalStatus

public static int globalStatus

noWarnStreamId

private static int noWarnStreamId
The line # and streamId to nowarn before (cf. setStartLine).


startLine

private static int startLine

nowarns

private static LexicalPragmaVec nowarns
* Registering nowarns annotations and checking * that they are legal ones. * *

Constructor Detail

NoWarn

public NoWarn()
Method Detail

init

public static void init()

setAllChkStatus

public static void setAllChkStatus(int status)

setChkStatus

public static void setChkStatus(int tag,
                                int status)
Sets how the check tag should be interpreted. tag should be one of the CHK... constants defined in TagConstants, and status should be one of CHK_AS_ASSUME/CHK_AS_ASSERT/CHK_AS_SKIP.


getChkStatus

public static int getChkStatus(int tag)
Returns:
how the check tag should be interpreted. tag should be one of the CHK... constants defined in TagConstants. The result is be one of CHK_AS_ASSUME/CHK_AS_ASSERT/CHK_AS_SKIP.

toNoWarnTag

public static int toNoWarnTag(java.lang.String name)
Convert a nowarn category to its tag. Returns 0 if the String is not a valid nowarn category.


setStartLine

public static void setStartLine(int line,
                                CompilationUnit cu)
Set a nowarn to ignore all lines before a given line in a given CompilationUnit.

Future calls to this routine remove any previous nowarns established via this routine.

Parameters:
line - passing a line # of -1 acts as a no-op nowarn.

registerNowarns

public static void registerNowarns(LexicalPragmaVec v)

typecheckRegisteredNowarns

public static void typecheckRegisteredNowarns()
Type checks the registered nowarn pragmas, reporting errors to ErrorSet appropriately.


onLine

static boolean onLine(int loc,
                      int lineNo,
                      int streamId)
Is loc on a given line number in a given stream?

Parameters:
loc - may be Location.NULL, in which case false is returned.

beforeLine

static boolean beforeLine(int loc,
                          int lineNo,
                          int streamId)
Is a given line # in a given stream (id) before (exclusive) the line that contains a given location?

Parameters:
loc - if Location.NULL, then no is returned.

inRange

static boolean inRange(int startLoc,
                       int endLoc,
                       int lineNo,
                       int streamId)
Is a given line # in a given stream (id) between the lines that contain the two given locations (inclusive)?

Parameters:
startLoc -
endLoc -
lineNo -
streamId -

getChkStatus

public static int getChkStatus(int tag,
                               int locUse,
                               int locPragmaDecl)
Returns how the check tag should be interpreted. tag should be one of the CHK... constants defined in TagConstants. The result is one of CHK_AS_ASSUME/CHK_AS_ASSERT/CHK_AS_SKIP.


ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage