org.unlaxer.sample.calc.CalculateResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of calculator Show documentation
Show all versions of calculator Show documentation
a simple parser combinator inspired by RelaxNG
package org.unlaxer.sample.calc;
import java.math.BigDecimal;
import java.util.Optional;
import org.unlaxer.Parsed;
import org.unlaxer.Token;
import org.unlaxer.context.ParseContext;
public class CalculateResult{
public final boolean success;
public final Optional token;
public final Optional answer;
public final ParseContext parseContext;
public final Errors errors;
public CalculateResult(ParseContext parseContext , Parsed parsed, Optional answer , Errors errors) {
super();
this.parseContext = parseContext;
this.token = parsed.getTokenOptional();
this.success = parsed.isSucceeded();
this.answer = answer;
this.errors = errors;
}
public CalculateResult(ParseContext parseContext , Parsed parsed, Optional answer) {
this(parseContext, parsed, answer, new Errors());
}
}