Class AssemblySentential<NT extends AssemblyNonTerminal>
- java.lang.Object
-
- org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
-
- org.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
- ghidra.app.plugin.assembler.sleigh.grammars.AssemblySentential<NT>
-
- Type Parameters:
NT- the type of non-terminals
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AssemblySentential<NT>>,java.lang.Iterable<AssemblySymbol>,java.util.Collection<AssemblySymbol>,java.util.List<AssemblySymbol>
public class AssemblySentential<NT extends AssemblyNonTerminal> extends org.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol> implements java.lang.Comparable<AssemblySentential<NT>>
A "string" of symbols To avoid overloading the word "String", we call this a "sentential". Technically, to be a "sentential" in the classic sense, it must be a possible element in the derivation of a sentence in the grammar starting with the start symbol. We ignore that if only for the sake of naming.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAssemblySentential.TruncatedWhiteSpaceParseTokenThe token consumed by a whitespace terminal when it anticipates the end of input "Expected" tokens given by a parse machine when this is the last token it has consumed are not valid suggestions.static classAssemblySentential.WhiteSpaceParseTokenThe token consumed by a whitespace terminal
-
Field Summary
Fields Modifier and Type Field Description static AssemblyStringTerminalWHITE_SPACE
-
Constructor Summary
Constructors Constructor Description AssemblySentential()Construct a blank string This is suitable as a blank start, to add new symbols, or to use directly as the RHS, effectively creating an "epsilon" production.AssemblySentential(AssemblySymbol... syms)Construct a string from any number of symbolsAssemblySentential(java.util.List<? extends AssemblySymbol> symbols)Construct a string from the given list of symbols
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddWS()Add "optional" whitespace, if not already preceded by whitespaceintcompareTo(AssemblySentential<NT> that)protected java.util.List<AssemblySymbol>decorated()voidfinish()Trim leading and trailing whitespace, and make the string immutableinthashCode()AssemblySentential<NT>subList(int fromIndex, int toIndex)java.lang.StringtoString()-
Methods inherited from class org.apache.commons.collections4.list.AbstractListDecorator
add, addAll, equals, get, indexOf, lastIndexOf, listIterator, listIterator, remove, set
-
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, setCollection, size, toArray, toArray
-
-
-
-
Field Detail
-
WHITE_SPACE
public static final AssemblyStringTerminal WHITE_SPACE
-
-
Constructor Detail
-
AssemblySentential
public AssemblySentential(java.util.List<? extends AssemblySymbol> symbols)
Construct a string from the given list of symbols- Parameters:
symbols-
-
AssemblySentential
public AssemblySentential()
Construct a blank string This is suitable as a blank start, to add new symbols, or to use directly as the RHS, effectively creating an "epsilon" production.
-
AssemblySentential
public AssemblySentential(AssemblySymbol... syms)
Construct a string from any number of symbols- Parameters:
syms-
-
-
Method Detail
-
decorated
protected java.util.List<AssemblySymbol> decorated()
- Overrides:
decoratedin classorg.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.apache.commons.collections4.collection.AbstractCollectionDecorator<AssemblySymbol>
-
compareTo
public int compareTo(AssemblySentential<NT> that)
- Specified by:
compareToin interfacejava.lang.Comparable<NT extends AssemblyNonTerminal>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection<NT extends AssemblyNonTerminal>- Specified by:
hashCodein interfacejava.util.List<NT extends AssemblyNonTerminal>- Overrides:
hashCodein classorg.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
addWS
public boolean addWS()
Add "optional" whitespace, if not already preceded by whitespace- Returns:
- true if whitespace was added
-
finish
public void finish()
Trim leading and trailing whitespace, and make the string immutable
-
subList
public AssemblySentential<NT> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<NT extends AssemblyNonTerminal>- Overrides:
subListin classorg.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
-