|
||||||||||
| 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.CharSwitch
public class CharSwitch
A character switch terminal. This internal element is used to
improve parser performance in recognizing terminals.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class xtc.parser.Element |
|---|
Element.Tag |
| Field Summary | |
|---|---|
Element |
base
The optional default element. |
java.util.List<CharCase> |
cases
The list of character cases. |
| Constructor Summary | |
|---|---|
CharSwitch(CharClass klass,
Element element)
Create a new character switch element which includes a case for the specified character class and corresponding element. |
|
CharSwitch(java.util.List<CharCase> cases)
Create a new character switch element. |
|
CharSwitch(java.util.List<CharCase> cases,
Element base)
Create a new character switch element. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
CharCase |
hasCase(CharClass klass)
Determine whether this character switch has a character case for the specified character class. |
int |
hashCode()
|
boolean |
overlaps(CharClass klass)
Determine whether this character switch has a character case that overlaps the specified character class. |
Element.Tag |
tag()
Get this element's tag. |
| 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, write |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.List<CharCase> cases
character cases.
public Element base
| Constructor Detail |
|---|
public CharSwitch(java.util.List<CharCase> cases)
cases - The list of cases.
public CharSwitch(java.util.List<CharCase> cases,
Element base)
cases - The list of cases.base - The default element.
public CharSwitch(CharClass klass,
Element element)
klass - The character class.element - The corresponding element.| Method Detail |
|---|
public Element.Tag tag()
Element
tag in class Elementpublic CharCase hasCase(CharClass klass)
klass - The character class.
null if
this character switch does not have a case for the character
class.public boolean overlaps(CharClass klass)
klass - The character class.
true if this character switch has an overlapping
character case.CharClass.overlaps(CharClass)public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||