All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.beezle.mork.compiler.ConflictResolver Maven / Gradle / Ivy

The newest version!
package net.sf.beezle.mork.compiler;

import net.sf.beezle.mork.parser.Parser;
import net.sf.beezle.mork.parser.ParserTable;
import net.sf.beezle.mork.scanner.Scanner;

import java.io.IOException;

public class ConflictResolver {
    public final Line[] lines;

    public ConflictResolver(Line[] lines) {
        this.lines = lines;
    }

    public int run(Scanner scanner, int mode, int eof) throws IOException {
        for (Line line : lines) {
            if (scanner.match(mode, eof, line.terminals)) {
                return line.action;
            }
        }
        return ParserTable.createValue(Parser.SPECIAL, Parser.SPECIAL_ERROR);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy