/* for C capatibility */ staticfinal String NullString = null;
privatestaticclass FileTableRecord { int fileId;
String sourceName;
String sourcePath; // do not read - use accessor boolean isConverted = false;
/** *ReturnthesourcePath,computingitifnotset. *Ifset,convert'/'inthesourcePathtothe *localfileseparator.
*/
String getSourcePath(ReferenceTypeImpl refType) { if (!isConverted) { if (sourcePath == null) {
sourcePath = refType.baseSourceDir() + sourceName;
} else {
StringBuilder sb = new StringBuilder(); for (int i = 0; i < sourcePath.length(); ++i) { char ch = sourcePath.charAt(i); if (ch == '/') {
sb.append(File.separatorChar);
} else {
sb.append(ch);
}
}
sourcePath = sb.toString();
}
isConverted = true;
} return sourcePath;
}
}
privatestaticclass LineTableRecord { int jplsStart; int jplsEnd; int jplsLineInc; int njplsStart;
@SuppressWarnings("unused") int njplsEnd; int fileId;
}
privatestaticclass StratumTableRecord {
String id; int fileIndex; int lineIndex;
}
class Stratum { privatefinalint sti; /* stratum index */
private Stratum(int sti) { this.sti = sti;
}
String id() { return stratumTable[sti].id;
}
boolean isJava() { return sti == baseStratumIndex;
}
/** *ReturnallthesourceNamesforthisstratum. *LookfromourstartingfileIndexuptothestarting *fileIndexofnextstratum-candothissincethere *isalwaysaterminatorstratum. *DefaultsourceName(thefirstone)mustbefirst.
*/
List<String> sourceNames(ReferenceTypeImpl refType) { int i; int fileIndexStart = stratumTable[sti].fileIndex; /* one past end */ int fileIndexEnd = stratumTable[sti+1].fileIndex;
List<String> result = new ArrayList<>(fileIndexEnd - fileIndexStart); for (i = fileIndexStart; i < fileIndexEnd; ++i) {
result.add(fileTable[i].sourceName);
} return result;
}
/** *ReturnallthesourcePathsforthisstratum. *LookfromourstartingfileIndexuptothestarting *fileIndexofnextstratum-candothissincethere *isalwaysaterminatorstratum. *DefaultsourcePath(thefirstone)mustbefirst.
*/
List<String> sourcePaths(ReferenceTypeImpl refType) { int i; int fileIndexStart = stratumTable[sti].fileIndex; /* one past end */ int fileIndexEnd = stratumTable[sti+1].fileIndex;
List<String> result = new ArrayList<>(fileIndexEnd - fileIndexStart); for (i = fileIndexStart; i < fileIndexEnd; ++i) {
result.add(fileTable[i].getSourcePath(refType));
} return result;
}
LineStratum lineStratum(ReferenceTypeImpl refType, int jplsLine) { int lti = stiLineTableIndex(sti, jplsLine); if (lti < 0) { returnnull;
} else { returnnew LineStratum(sti, lti, refType,
jplsLine);
}
}
}
class LineStratum { privatefinalint sti; /* stratum index */ privatefinalint lti; /* line table index */ privatefinal ReferenceTypeImpl refType; privatefinalint jplsLine; private String sourceName = null; private String sourcePath = null;
void assureLineTableSize() { int len = lineTable == null? 0 : lineTable.length; if (lineIndex >= len) { int i; int newLen = len == 0? INIT_SIZE_LINE : len * 2;
LineTableRecord[] newTable = new LineTableRecord[newLen]; for (i = 0; i < len; ++i) {
newTable[i] = lineTable[i];
} for (; i < newLen; ++i) {
newTable[i] = new LineTableRecord();
}
lineTable = newTable;
}
}
void assureFileTableSize() { int len = fileTable == null? 0 : fileTable.length; if (fileIndex >= len) { int i; int newLen = len == 0? INIT_SIZE_FILE : len * 2;
FileTableRecord[] newTable = new FileTableRecord[newLen]; for (i = 0; i < len; ++i) {
newTable[i] = fileTable[i];
} for (; i < newLen; ++i) {
newTable[i] = new FileTableRecord();
}
fileTable = newTable;
}
}
void assureStratumTableSize() { int len = stratumTable == null? 0 : stratumTable.length; if (stratumIndex >= len) { int i; int newLen = len == 0? INIT_SIZE_STRATUM : len * 2;
StratumTableRecord[] newTable = new StratumTableRecord[newLen]; for (i = 0; i < len; ++i) {
newTable[i] = stratumTable[i];
} for (; i < newLen; ++i) {
newTable[i] = new StratumTableRecord();
}
stratumTable = newTable;
}
}
String readLine() {
StringBuilder sb = new StringBuilder(); char ch;
ignoreWhite(); while (((ch = sdeRead()) != '\n') && (ch != '\r')) {
sb.append(ch);
} // check for CR LF if ((ch == '\r') && (sdePeek() == '\n')) {
sdeRead();
}
ignoreWhite(); // leading white return sb.toString();
}
void fileLine() { int hasAbsolute = 0; /* acts as boolean */ int fileId;
String sourceName;
String sourcePath = null;
/* is there an absolute filename? */ if (sdePeek() == '+') {
sdeAdvance();
hasAbsolute = 1;
}
fileId = readNumber();
sourceName = readLine(); if (hasAbsolute == 1) {
sourcePath = readLine();
}
storeFile(fileId, sourceName, sourcePath);
}
void storeLine(int jplsStart, int jplsEnd, int jplsLineInc, int njplsStart, int njplsEnd, int fileId) {
assureLineTableSize();
lineTable[lineIndex].jplsStart = jplsStart;
lineTable[lineIndex].jplsEnd = jplsEnd;
lineTable[lineIndex].jplsLineInc = jplsLineInc;
lineTable[lineIndex].njplsStart = njplsStart;
lineTable[lineIndex].njplsEnd = njplsEnd;
lineTable[lineIndex].fileId = fileId;
++lineIndex;
}
/** *Parselinetranslationinfo.Syntaxis *<NJ-start-line>[#<file-id>][,<line-count>]: *<J-start-line>[,<line-increment>]CR
*/ void lineLine() { int lineCount = 1; int lineIncrement = 1; int njplsStart; int jplsStart;
njplsStart = readNumber();
/* is there a fileID? */ if (sdePeek() == '#') {
sdeAdvance();
currentFileId = readNumber();
}
/* is there a line count? */ if (sdePeek() == ',') {
sdeAdvance();
lineCount = readNumber();
}
if (sdeRead() != ':') {
syntax();
}
jplsStart = readNumber(); if (sdePeek() == ',') {
sdeAdvance();
lineIncrement = readNumber();
}
ignoreLine(); /* flush the rest */
privateint stiLineTableIndex(int sti, int jplsLine) { int i; int lineIndexStart; int lineIndexEnd;
lineIndexStart = stratumTable[sti].lineIndex; /* one past end */
lineIndexEnd = stratumTable[sti+1].lineIndex; for (i = lineIndexStart; i < lineIndexEnd; ++i) { if ((jplsLine >= lineTable[i].jplsStart) &&
(jplsLine <= lineTable[i].jplsEnd)) { return i;
}
} return -1;
}
privateint stiLineNumber(int sti, int lti, int jplsLine) { return lineTable[lti].njplsStart +
(((jplsLine - lineTable[lti].jplsStart) /
lineTable[lti].jplsLineInc));
}
privateint fileTableIndex(int sti, int fileId) { int i; int fileIndexStart = stratumTable[sti].fileIndex; /* one past end */ int fileIndexEnd = stratumTable[sti+1].fileIndex; for (i = fileIndexStart; i < fileIndexEnd; ++i) { if (fileTable[i].fileId == fileId) { return i;
}
} return -1;
}
privateint stiFileTableIndex(int sti, int lti) { return fileTableIndex(sti, lineTable[lti].fileId);
}
boolean isValid() { return isValid;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-09-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.