Record Class Earley.Result
java.lang.Object
java.lang.Record
org.libxmq.imp.ixml.earley.Earley.Result
- Record Components:
doc- the document, null on an errorerror- the error message, null on successposition- the input position (in code points) of a syntax errorgrammar- the grammarchart- the Earley sets, null if the input is not valid UTF-8tree- the chosen tree, null if the input was rejectedsteps- the nodes in the order they were added to the tree, see TreeBuilder.stepsexpected- on a syntax error, what the parser could read at the position
- Enclosing class:
Earley
public static record Earley.Result(XmlDocument doc, String error, int position, Grammar grammar, Chart chart, Tree tree, List<TreeBuilder.Step> steps, List<EarleyParser.Expected> expected)
extends Record
The result of a parse: a document, or an error at a position. The grammar, the
chart and the tree are kept for EarleyTrace.
-
Constructor Summary
ConstructorsConstructorDescriptionResult(XmlDocument doc, String error, int position, Grammar grammar, Chart chart, Tree tree, List<TreeBuilder.Step> steps, List<EarleyParser.Expected> expected) Creates an instance of aResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchart()Returns the value of thechartrecord component.doc()Returns the value of thedocrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.expected()Returns the value of theexpectedrecord component.grammar()Returns the value of thegrammarrecord component.final inthashCode()Returns a hash code value for this object.intposition()Returns the value of thepositionrecord component.steps()Returns the value of thestepsrecord component.final StringtoString()Returns a string representation of this record class.tree()Returns the value of thetreerecord component.
-
Constructor Details
-
Result
public Result(XmlDocument doc, String error, int position, Grammar grammar, Chart chart, Tree tree, List<TreeBuilder.Step> steps, List<EarleyParser.Expected> expected) Creates an instance of aResultrecord class.- Parameters:
doc- the value for thedocrecord componenterror- the value for theerrorrecord componentposition- the value for thepositionrecord componentgrammar- the value for thegrammarrecord componentchart- the value for thechartrecord componenttree- the value for thetreerecord componentsteps- the value for thestepsrecord componentexpected- the value for theexpectedrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
doc
-
error
-
position
-
grammar
-
chart
-
tree
-
steps
-
expected
-