foreach для LexicTable
This commit is contained in:
parent
bc9bf984ff
commit
267e623dc3
@ -58,8 +58,7 @@ public final class LexicalAnalyzer {
|
||||
|
||||
private void analyzeVariables() {
|
||||
// Äîáàâëÿåì ïåðåìåííûå â òàáëèöó.
|
||||
for (int i = 0; i < lexicTable.getSize(); i++) {
|
||||
LexicLine line = lexicTable.getLexicAt(i);
|
||||
for (LexicLine line : lexicTable) {
|
||||
addVariableToTable(line);
|
||||
}
|
||||
// Ñîïîñòàâëÿåì òèïû ïåðåìåííûõ.
|
||||
|
@ -34,8 +34,7 @@ public final class ListingGenerator {
|
||||
final StringBuilder text = new StringBuilder();
|
||||
short offset = VarTable.getOffset();
|
||||
|
||||
for (int i = 0; i < lexicTable.getSize(); i++) {
|
||||
LexicLine line = lexicTable.getLexicAt(i);
|
||||
for (LexicLine line : lexicTable) {
|
||||
String[] parts = DirectiveConverter.split(lines[line.lineNumber - 1]);
|
||||
|
||||
String strLine = generateLine(line.lineNumber, line.line, parts).trim();
|
||||
|
@ -27,8 +27,7 @@ public final class SyntaxAnalyzer {
|
||||
}
|
||||
|
||||
public void analyze() throws ExceptionWithLineNumber {
|
||||
for (int i = 0; i < lexicTable.getSize(); i++) {
|
||||
LexicLine line = lexicTable.getLexicAt(i);
|
||||
for (LexicLine line : lexicTable) {
|
||||
analyzeLine(line.lineNumber, line.line);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user