|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crimson.parser.ContentModel
A representation of a "children" content model. These are basically a regular expression; other content models are simpler. There is an SGML compatibility restriction on DTDs that such content models be deterministic, which in this sense just means that backtracking isn't needed to validate against it.
At the moment, for expediency, nondeterministic models are neither tested for nor are they handled reasonably. This could be done after each element's content model is fully parsed.
The most efficient way to do this would be to compile each content model pattern into a deterministic finite automaton (no stack) and just walk the DFA's graph ... but for now, these aren't compiled.
Field Summary | |
private SimpleHashtable |
cache
|
Object |
content
The content. |
ContentModel |
next
The next content model (in a ',' or '|' connective expression). |
char |
type
Type. |
Constructor Summary | |
ContentModel(char type,
ContentModel content)
Create a content model of a particular type. |
|
ContentModel(String element)
Create a content model for an element. |
Method Summary | |
boolean |
empty()
Return true if the content model could match an empty input stream. |
boolean |
first(String token)
Return true if the token could potentially be the first token in the input stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public char type
public Object content
public ContentModel next
private SimpleHashtable cache
Constructor Detail |
public ContentModel(String element)
public ContentModel(char type, ContentModel content)
Method Detail |
public boolean empty()
public boolean first(String token)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |