Class AssemblyTerminal
java.lang.Object
ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol
ghidra.app.plugin.assembler.sleigh.symbol.AssemblyTerminal
- All Implemented Interfaces:
Comparable<AssemblySymbol>
- Direct Known Subclasses:
AssemblyEOI
,AssemblyNumericTerminal
,AssemblyStringMapTerminal
,AssemblyStringTerminal
The type of terminal for an assembly grammar
Unlike classical parsing, each terminal provides its own tokenizer. If multiple tokenizers yield a token, the parser branches, possibly creating multiple, ambiguous trees.
- See Also:
-
Field Summary
Fields inherited from class ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Collection
<String> getSuggestions
(String got, AssemblyNumericSymbols symbols) Provide a collection of strings that this terminal would have acceptedabstract Collection
<? extends AssemblyParseToken> match
(String buffer, int pos, AssemblyGrammar grammar, AssemblyNumericSymbols symbols) Attempt to match a token from the input buffer starting at a given positionMethods inherited from class ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol
compareTo, equals, getName, hashCode, takesOperandIndex, toString
-
Constructor Details
-
AssemblyTerminal
Construct a terminal having the give name- Parameters:
name
-
-
-
Method Details
-
match
public abstract Collection<? extends AssemblyParseToken> match(String buffer, int pos, AssemblyGrammar grammar, AssemblyNumericSymbols symbols) Attempt to match a token from the input buffer starting at a given position- Parameters:
buffer
- the input bufferpos
- the cursor position in the buffergrammar
- the grammar containing this terminalsymbols
- symbols from the program, suitable for use as numeric terminals- Returns:
- the matched token, or null
-
getSuggestions
Provide a collection of strings that this terminal would have accepted- Parameters:
got
- the remaining contents of the input buffersymbols
- the program symbols, if applicable- Returns:
- a, possibly empty, collection of suggestions
-