|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Node
xtc.parser.Element
xtc.parser.Terminal
xtc.parser.CharTerminal
xtc.parser.CharClass
public class CharClass
A character class terminal.
Note thatequals(Object) only determines whether the
two character class terminals have the same structure (that is, are
both exclusive or non-exclusive and have the same list of character
ranges), but does not determine whether the two character class
terminals recognize the same characters.
| Nested Class Summary | |
|---|---|
static class |
CharClass.Parser
Parser for a character class specification. |
| Nested classes/interfaces inherited from class xtc.parser.Element |
|---|
Element.Tag |
| Field Summary | |
|---|---|
boolean |
exclusive
The flag for whether the character class is exclusive. |
java.util.List<CharRange> |
ranges
The list of character ranges. |
| Constructor Summary | |
|---|---|
CharClass(boolean exclusive,
java.util.List<CharRange> ranges)
Create a new character class. |
|
CharClass(char c)
Create a new, non-exclusive character class for the specified character. |
|
CharClass(java.util.List<CharRange> ranges)
Create a new, non-exclusive character class. |
|
CharClass(java.lang.String s)
Create a new, non-exclusive character class based on the supplied character class specification. |
|
| Method Summary | |
|---|---|
int |
count()
Determine the number of characters covered by this character class. |
boolean |
equals(java.lang.Object o)
|
int |
hashCode()
|
CharClass |
normalize()
Normalize this character class. |
boolean |
overlaps(CharClass klass)
Determine whether this character class overlaps the specified character class. |
Element.Tag |
tag()
Get this element's tag. |
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified appendable. |
| Methods inherited from class xtc.tree.Node |
|---|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, strip, toAnnotation, toList, toString, toToken |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean exclusive
public java.util.List<CharRange> ranges
| Constructor Detail |
|---|
public CharClass(java.util.List<CharRange> ranges)
ranges - The list of character ranges.
public CharClass(boolean exclusive,
java.util.List<CharRange> ranges)
exclusive - The exclusive flag.ranges - The list of character ranges.public CharClass(char c)
c - The character.public CharClass(java.lang.String s)
[' and
trailing ']' characters.
s - The character class specification.| Method Detail |
|---|
public Element.Tag tag()
Element
tag in class Elementpublic CharClass normalize()
public boolean overlaps(CharClass klass)
klass - The other character class.
true if the two character classes overlap.
java.lang.IllegalStateException - Signals that either this or the specified class is exclusive.public int count()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
public void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().
write in class Nodeout - The appendable.
java.io.IOException - Signals an I/O error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||