Class AssemblyParseResult

java.lang.Object
ghidra.app.plugin.assembler.sleigh.parse.AssemblyParseResult
All Implemented Interfaces:
Comparable<AssemblyParseResult>
Direct Known Subclasses:
AssemblyParseAcceptResult, AssemblyParseErrorResult

public abstract class AssemblyParseResult extends Object implements 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 Details

    • AssemblyParseResult

      public AssemblyParseResult()
  • Method Details

    • 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(String got, Set<String> suggestions)
      Construct an error parse result
      Parameters:
      got - the input buffer when the error occurred
      suggestions - 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 interface Comparable<AssemblyParseResult>