package net.minecraft.util.parsing.packrat; import java.util.Optional; import javax.annotation.Nullable; public interface ParseState { Scope scope(); ErrorCollector errorCollector(); default Optional parseTopRule(NamedRule p_397823_) { T t = this.parse(p_397823_); if (t != null) { this.errorCollector().finish(this.mark()); } if (!this.scope().hasOnlySingleFrame()) { throw new IllegalStateException("Malformed scope: " + this.scope()); } else { return Optional.ofNullable(t); } } @Nullable T parse(NamedRule p_392647_); S input(); int mark(); void restore(int p_331216_); Control acquireControl(); void releaseControl(); ParseState silent(); }