Class SourceFile

java.lang.Object
org.openjdk.asmtools.jcoder.SourceFile
All Implemented Interfaces:
Constants, RuntimeConstants

public class SourceFile extends Object implements Constants
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 postion value.

  • Field Details

    • nerrors

      public int nerrors
      The number of errors and warnings
    • nwarnings

      public int nwarnings
    • i18n

      public static final I18NResourceBundle i18n
  • Constructor Details

  • Method Details

    • getInputFileName

      public String getInputFileName()
    • closeInp

      public void closeInp()
    • read

      public int read() throws IOException
      Throws:
      IOException
    • lineNumber

      public int lineNumber(int pos)
    • lineNumber

      public int lineNumber()
    • 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)
    • error

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

      public void trace(String message)
    • traceln

      public void traceln(String message)