foreach для LexicTable

This commit is contained in:
Victor 2014-08-22 12:02:59 +03:00
parent bc9bf984ff
commit 267e623dc3
3 changed files with 3 additions and 6 deletions

View File

@ -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);
}
// Ñîïîñòàâëÿåì òèïû ïåðåìåííûõ.

View File

@ -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();

View File

@ -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);
}
}