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

    • tool

      Tool tool
    • traceFlag

      boolean traceFlag
    • debugInfoFlag

      boolean debugInfoFlag
    • OFFSETINC

      static final int OFFSETINC
      The increment for each character.
      See Also:
    • LINEINC

      static final int LINEINC
      The increment for each line.
      See Also:
    • inputFileName

      String inputFileName
    • in

    • out

    • pos

      int pos
    • chpos

      private int chpos
    • pushBack

      private int pushBack
    • nerrors

      public int nerrors
      The number of errors and warnings
    • nwarnings

      public int nwarnings
    • i18n

      public static final I18NResourceBundle i18n
    • errors

      ErrorMessage errors
      List of outstanding error messages
  • 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()
    • 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)
    • error

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

      public void trace(String message)
    • traceln

      public void traceln(String message)