Package org.openjdk.asmtools.jcoder

## Class SourceFile

- java.lang.Object
- - org.openjdk.asmtools.jcoder.SourceFile

- All Implemented Interfaces:
    `Constants`, `RuntimeConstants`

      public class SourceFile
      extends java.lang.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 Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static I18NResourceBundle` | `i18n` |
    `int` | `nerrors` | The number of errors and warnings
    `int` | `nwarnings` |

    - ### Fields inherited from interface org.openjdk.asmtools.jasm.Constants

      `ATT_ALL, ATT_CODE, CS_BINARY, CS_COMPILED, CS_NOTFOUND, CS_PARSED, CS_SOURCE, CS_UNDECIDED, CS_UNDEFINED, EOF, F_DEBUG, F_DEPENDENCIES, F_DUMP, F_OPTIMIZE, F_VERBOSE, F_WARNINGS, MAXFILESIZE, MAXLINENUMBER, OFFSETBITS, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_DOUBLE, TC_ERROR, TC_FLOAT, TC_INT, TC_LONG, TC_METHOD, TC_NULL, TC_SHORT, TC_VOID, TM_ARRAY, TM_BOOLEAN, TM_BYTE, TM_CHAR, TM_CLASS, TM_DOUBLE, TM_ERROR, TM_FLOAT, TM_INT, TM_INT32, TM_INTEGER, TM_LONG, TM_METHOD, TM_NULL, TM_NUM32, TM_NUM64, TM_NUMBER, TM_REAL, TM_REFERENCE, TM_SHORT, TM_VOID`

    - ### Fields inherited from interface org.openjdk.asmtools.jasm.RuntimeConstants

      `ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_MANDATED, ACC_MODULE, ACC_NAMES, ACC_NATIVE, ACC_NONE, ACC_OPEN, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STATIC_PHASE, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_TRANSITIVE, ACC_VARARGS, ACC_VOLATILE, DEPRECATED_ATTRIBUTE, SPLIT_VERIFIER_CFV, SYNTHETIC_ATTRIBUTE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SourceFile​(Tool tool, java.io.DataInputStream dataInputStream, java.lang.String inputFileName, java.io.PrintWriter out)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `closeInp()` |
    `void` | `error​(int where, java.lang.String err)` |
    `void` | `error​(int where, java.lang.String err, java.lang.Object arg1)` |
    `void` | `error​(int where, java.lang.String err, java.lang.Object arg1, java.lang.Object arg2)` |
    `void` | `error​(int where, java.lang.String err, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)` | Issue an error
    `void` | `error​(java.lang.String err)` |
    `void` | `error​(java.lang.String err, java.lang.Object arg1)` |
    `void` | `flushErrors()` | Flush outstanding errors
    `java.lang.String` | `getInputFileName()` |
    `int` | `lineNumber()` |
    `int` | `lineNumber​(int pos)` |
    `void` | `output​(java.lang.String msg)` | Output a string.
    `void` | `outputln​(java.lang.String msg)` | Output a string.
    `int` | `read()` |
    `void` | `trace​(java.lang.String message)` |
    `void` | `traceln​(java.lang.String message)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### nerrors

          public int nerrors

      The number of errors and warnings

    - #### nwarnings

          public int nwarnings

    - #### i18n

          public static final I18NResourceBundle i18n

  - ### Constructor Detail

    - #### SourceFile

          public SourceFile​(Tool tool,
                            java.io.DataInputStream dataInputStream,
                            java.lang.String inputFileName,
                            java.io.PrintWriter out)

  - ### Method Detail

    - #### getInputFileName

          public java.lang.String getInputFileName()

    - #### closeInp

          public void closeInp()

    - #### read

          public int read()
                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### lineNumber

          public int lineNumber​(int pos)

    - #### lineNumber

          public int lineNumber()

    - #### flushErrors

          public void flushErrors()

      Flush outstanding errors

    - #### output

          public void output​(java.lang.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​(java.lang.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,
                            java.lang.String err,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3)

      Issue an error

    - #### error

          public final void error​(int where,
                                  java.lang.String err,
                                  java.lang.Object arg1,
                                  java.lang.Object arg2)

    - #### error

          public final void error​(int where,
                                  java.lang.String err,
                                  java.lang.Object arg1)

    - #### error

          public final void error​(int where,
                                  java.lang.String err)

    - #### error

          public final void error​(java.lang.String err)

    - #### error

          public final void error​(java.lang.String err,
                                  java.lang.Object arg1)

    - #### trace

          public void trace​(java.lang.String message)

    - #### traceln

          public void traceln​(java.lang.String message)