Package org.openjdk.asmtools.jcoder
Class SourceFile
java.lang.Object
org.openjdk.asmtools.jcoder.SourceFile
- All Implemented Interfaces:
Constants
,RuntimeConstants
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
FieldsModifier and TypeFieldDescriptionprivate int
(package private) boolean
(package private) ErrorMessage
List of outstanding error messagesstatic final I18NResourceBundle
(package private) InputStream
(package private) String
(package private) static final int
The increment for each line.int
The number of errors and warningsint
(package private) static final int
The increment for each character.(package private) PrintWriter
(package private) int
private int
(package private) Tool
(package private) boolean
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
ConstructorsConstructorDescriptionSourceFile
(Tool tool, DataInputStream dataInputStream, String inputFileName, PrintWriter out) -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeInp()
final void
final void
final void
void
Issue an errorfinal void
final void
(package private) String
errorString
(String err, Object arg1, Object arg2, Object arg3) Error Stringvoid
Flush outstanding errors(package private) void
insertError
(int where, String message) Insert an error message in the list of outstanding error messages.int
int
lineNumber
(int pos) void
Output a string.void
Output a string.int
read()
void
void
-
Field Details
-
tool
Tool tool -
traceFlag
boolean traceFlag -
debugInfoFlag
boolean debugInfoFlag -
OFFSETINC
static final int OFFSETINCThe increment for each character.- See Also:
-
LINEINC
static final int LINEINCThe increment for each line.- See Also:
-
inputFileName
String inputFileName -
in
InputStream in -
out
PrintWriter out -
pos
int pos -
chpos
private int chpos -
pushBack
private int pushBack -
nerrors
public int nerrorsThe number of errors and warnings -
nwarnings
public int nwarnings -
i18n
-
errors
ErrorMessage errorsList of outstanding error messages
-
-
Constructor Details
-
SourceFile
public SourceFile(Tool tool, DataInputStream dataInputStream, String inputFileName, PrintWriter out)
-
-
Method Details
-
getInputFileName
-
closeInp
public void closeInp() -
read
- Throws:
IOException
-
lineNumber
public int lineNumber(int pos) -
lineNumber
public int lineNumber() -
errorString
Error String -
insertError
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
Output a string. This can either be an error message or something for debugging. This should be used instead of print. -
outputln
Output a string. This can either be an error message or something for debugging. This should be used instead of println. -
error
Issue an error -
error
-
error
-
error
-
error
-
error
-
trace
-
traceln
-