de.fluxparticle.syntax.parser.FullParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of syntax Show documentation
Show all versions of syntax Show documentation
A simple on-the-fly parser generator
The newest version!
package de.fluxparticle.syntax.parser;
import de.fluxparticle.syntax.lexer.BaseLexer;
import de.fluxparticle.syntax.lexer.LexerElement;
import de.fluxparticle.syntax.lexer.LexerEnd;
import de.fluxparticle.syntax.lexer.ParserException;
import java.util.Set;
/**
* Created by sreinck on 16.07.16.
*/
public class FullParser extends Parser {
private final Parser parser;
public FullParser(Parser parser) {
this.parser = parser;
}
@Override
Set first() {
return parser.first();
}
@Override
public Object check(BaseLexer l) throws ParserException {
Object result = parser.check(l);
l.require(new LexerEnd());
return result;
}
}