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-terminalsT
- the type of 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 class
AssemblySentential.TruncatedWhiteSpaceParseToken
The 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 class
AssemblySentential.WhiteSpaceParseToken
The token consumed by a whitespace terminal
-
Field Summary
Fields Modifier and Type Field Description static AssemblyStringTerminal
WHITE_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 boolean
addWS()
Add "optional" whitespace, if not already preceded by whitespaceint
compareTo(AssemblySentential<NT> that)
protected java.util.List<AssemblySymbol>
decorated()
void
finish()
Trim leading and trailing whitespace, and make the string immutableint
hashCode()
AssemblySentential<NT>
subList(int fromIndex, int toIndex)
java.lang.String
toString()
-
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:
decorated
in classorg.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classorg.apache.commons.collections4.collection.AbstractCollectionDecorator<AssemblySymbol>
-
compareTo
public int compareTo(AssemblySentential<NT> that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<NT extends AssemblyNonTerminal>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<NT extends AssemblyNonTerminal>
- Specified by:
hashCode
in interfacejava.util.List<NT extends AssemblyNonTerminal>
- Overrides:
hashCode
in 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:
subList
in interfacejava.util.List<NT extends AssemblyNonTerminal>
- Overrides:
subList
in classorg.apache.commons.collections4.list.AbstractListDecorator<AssemblySymbol>
-
-