Class AssemblyParseResult
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.parse.AssemblyParseResult
-
- All Implemented Interfaces:
java.lang.Comparable<AssemblyParseResult>
- Direct Known Subclasses:
AssemblyParseAcceptResult
,AssemblyParseErrorResult
public abstract class AssemblyParseResult extends java.lang.Object implements java.lang.Comparable<AssemblyParseResult>
A result of parsing a sentence If the sentence was accepted, this yields a parse tree. If not, this describes the error and provides suggestions to correct the error.
-
-
Constructor Summary
Constructors Constructor Description AssemblyParseResult()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static AssemblyParseAcceptResult
accept(AssemblyParseBranch tree)
Construct a successful parse resultint
compareTo(AssemblyParseResult that)
static AssemblyParseErrorResult
error(java.lang.String got, java.util.Set<java.lang.String> suggestions)
Construct an error parse resultabstract boolean
isError()
Check if the parse result is successful or an error
-
-
-
Method Detail
-
accept
public static AssemblyParseAcceptResult accept(AssemblyParseBranch tree)
Construct a successful parse result- Parameters:
tree
- the tree output by the parser
-
error
public static AssemblyParseErrorResult error(java.lang.String got, java.util.Set<java.lang.String> suggestions)
Construct an error parse result- Parameters:
got
- the input buffer when the error occurredsuggestions
- a subset of strings that would have allowed parsing to proceed
-
isError
public abstract boolean isError()
Check if the parse result is successful or an error- Returns:
- true if the result describes an error
-
compareTo
public int compareTo(AssemblyParseResult that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AssemblyParseResult>
-
-