Class Environment

java.lang.Object
org.openjdk.asmtools.jasm.Environment

public class Environment extends Object
An input stream for java programs. The stream treats either "\n", "\r" or "\r\n" as the end of a line, it always returns \n. It also parses UNICODE characters expressed as ￿. However, if it sees "\\", the second slash cannot begin a unicode sequence. It keeps track of the current position in the input stream. An position consists of: ((linenr << OFFSETBITS) | offset) this means that both the line number and the exact offset into the file are encoded in each position value.

  • Field Details

    • traceFlag

      static boolean traceFlag
    • debugInfoFlag

      boolean debugInfoFlag
    • inputFileName

      private String inputFileName
    • simpleInputFileName

      private String simpleInputFileName
    • out

      public PrintWriter out
    • nowarn

      private boolean nowarn
    • data

      private byte[] data
    • bytepos

      private int bytepos
    • linepos

      private int linepos
    • pos

      public int pos
    • nerrors

      public int nerrors
      The number of errors and warnings
    • nwarnings

      public int nwarnings
    • i18n

      public static final I18NResourceBundle i18n
    • errors

      List of outstanding error messages
  • Constructor Details

  • Method Details

    • getInputFileName

      public String getInputFileName()
    • getSimpleInputFileName

      public String getSimpleInputFileName()
    • lookForward

      int lookForward()
    • convertUnicode

      int convertUnicode()
    • read

      public int read()
    • lineNumber

      int lineNumber(int lcpos)
    • lineNumber

      int lineNumber()
    • lineOffset

      int lineOffset(int lcpos)
    • lineOffset

      int lineOffset()
    • errorString

      String errorString(String err, Object arg1, Object arg2, Object arg3)
      Error String
    • insertError

      void insertError(int where, String message)
      Insert an error message in the list of outstanding error messages. The list is sorted on input position.
    • flushErrors

      public void flushErrors()
      Flush outstanding errors
    • output

      public void output(String msg)
      Output a string. This can either be an error message or something for debugging. This should be used instead of print.
    • outputln

      public void outputln(String msg)
      Output a string. This can either be an error message or something for debugging. This should be used instead of println.
    • error

      public void error(int where, String err, Object arg1, Object arg2, Object arg3)
      Issue an error
    • error

      public final void error(int where, String err, Object arg1, Object arg2)
    • error

      public final void error(int where, String err, Object arg1)
    • error

      public final void error(int where, String err)
    • error

      public final void error(String err, Object arg1, Object arg2, Object arg3)
    • error

      public final void error(String err, Object arg1, Object arg2)
    • error

      public final void error(String err, Object arg1)
    • error

      public final void error(String err)
    • errorStr

      public final String errorStr(String err, Object arg1, Object arg2, Object arg3)
    • errorStr

      public final String errorStr(String err, Object arg1, Object arg2)
    • errorStr

      public final String errorStr(String err, Object arg1)
    • errorStr

      public final String errorStr(String err)
    • isTraceEnabled

      public boolean isTraceEnabled()
    • isDebugEnabled

      public boolean isDebugEnabled()
    • trace

      void trace(String message)
    • traceln

      void traceln(String message)