Class AssemblySymbol
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol
-
- All Implemented Interfaces:
java.lang.Comparable<AssemblySymbol>
- Direct Known Subclasses:
AssemblyNonTerminal
,AssemblyTerminal
public abstract class AssemblySymbol extends java.lang.Object implements java.lang.Comparable<AssemblySymbol>
A symbol in a context-free grammar Symbols can be either terminals or non-terminals. Non-terminals must have a defining production, i.e., it must appear as the left-hand side of some production in the grammar. Traditionally, when displayed, non-terminals should be immediately distinguishable from terminals. In classic CS literature, this usually means non-terminals are in CAPS, and terminals are in lower-case. Because the assembler doesn't control the names provided by SLEIGH, we surround non-terminals in [brackets].- See Also:
AbstractAssemblyGrammar
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
-
Constructor Summary
Constructors Constructor Description AssemblySymbol(java.lang.String name)
Construct a new symbol with the given name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(AssemblySymbol that)
boolean
equals(java.lang.Object that)
java.lang.String
getName()
Get the name of this symbolint
hashCode()
boolean
takesOperandIndex()
Check if this symbol consumes an operand index of its constructorabstract java.lang.String
toString()
-
-
-
Method Detail
-
toString
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getName
public java.lang.String getName()
Get the name of this symbol- Returns:
- the name
-
compareTo
public int compareTo(AssemblySymbol that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AssemblySymbol>
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
takesOperandIndex
public boolean takesOperandIndex()
Check if this symbol consumes an operand index of its constructor- Returns:
- true if the symbol represents an operand
-
-