For example, when the current expression is
<!-- javadoc escape -->
<choice>
<concur>
<element> ..(A).. </element>
<group>
<element> ..(B).. </element>
...
</group>
</concur>
<group>
<element> ..(C).. </element>
....
</group>
</choice>
then the combined child expression is
<choice>
<concur>
..(A')..
..(B')..
</concur>
..(C')..
</choice>
and elements of concern and its attribute-pruned content models are
<element> ..(A).. </element> -> ..(A')..
<element> ..(B).. </element> -> ..(B')..
<element> ..(C).. </element> -> ..(C')..
(A'),(B'), and (C') are attribute-pruned content models of (A),(B), and (C)
respectively.
Note that combined child pattern contains only <choice> and <concur> as
its grue (of course, except ..(A').. , ..(B').. , and ..(C').. ).
This function object also calculates "continuation", which is the residual
expression after eating elements of concern.
For example, say the expression is "(A|(B,C))?,D".
When EoC is B, then the continuation will be C,D.
When EoC is A, then the continuation will be D.
When EoC is D, then the continuation will be epsilon.
When there are multiple EoC, (say A and B), then
the continuation will be meaningless (because it depends on which EoC will
be accepted), and thus won't be used.
However, the implementator must be aware that it is possible for a
binary operator to have EoC on both branch and EoC is still unique.
The following expression is an example.
(A|B)*,C?,(A|B)*
when A is EoC, SequenceExp of (A|B)* and C?,(A|B)* has EoC on both branch.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Expression | |
| private Expression | |
| private boolean | foundConcur
a flag that indicates that we have 'concur' element to combine elements of concern. |
| private int | |
| protected final ExpressionPool | |
| private ElementExp[] | result
matched elements. |
| private StartTagInfo |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final CombinedChildContentExpCreator. | |
| public CombinedChildContentExpCreator. | get(Expression
if this flag is false, Attribute feeding & pruning are skipped and
AttributeExps are fully remained in the resulting expression. combinedPattern, StartTagInfo info, boolean if this flag is false, tag name check is skipped. checkTagName)computes a combined child content pattern and its continuation, with error recovery. |
| public CombinedChildContentExpCreator. | get(Expression combinedPattern, StartTagInfo info)
computes a combined child content pattern and (,if possible,) its continuation. |
| public final ElementExp[] | |
| public final boolean | Returns: true if the combined child content expression is not the union of all elements of concern. false if otherwise.checks if the result of 'get' method is not the union of all elements of concern. |
| public final int | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| checkTagName | back to summary |
|---|---|
| private boolean checkTagName | |
| content | back to summary |
|---|---|
| private Expression content | |
| continuation | back to summary |
|---|---|
| private Expression continuation | |
| foundConcur | back to summary |
|---|---|
| private boolean foundConcur a flag that indicates that we have 'concur' element to combine elements of concern. If 'concur' is used, we have to keep track of combined child content expression to detect errors. If 'concur' is not used, then keeping track of all primitive child content expressions are enough to detect errors. | |
| numElements | back to summary |
|---|---|
| private int numElements | |
| pool | back to summary |
|---|---|
| protected final ExpressionPool pool | |
| result | back to summary |
|---|---|
| private ElementExp[] result matched elements. the buffer is usually bigger than | |
| tagInfo | back to summary |
|---|---|
| private StartTagInfo tagInfo | |
| CombinedChildContentExpCreator | back to summary |
|---|---|
| protected CombinedChildContentExpCreator(ExpressionPool pool) | |
| continueGet | back to summary |
|---|---|
| public final CombinedChildContentExpCreator. | |
| get | back to summary |
|---|---|
| public CombinedChildContentExpCreator. computes a combined child content pattern and its continuation, with error recovery. After calling this method, caller can call getElementsOfConcern to obtain each EoC. If both feedAttributes and checkTagName are false, then StartTagInfo is also unnecessary.
| |
| get | back to summary |
|---|---|
| public CombinedChildContentExpCreator. computes a combined child content pattern and (,if possible,) its continuation. | |
| getMatchedElements | back to summary |
|---|---|
| public final ElementExp[] getMatchedElements() obtains matched elements. This method should be called after calling the get method. The result is in effect until the next invocation of get method. The extra care should be taken not to hold reference to the result longer than necessary. The contents of the result is valid only until the next invocation. Because OwnerAndContent objects are reused. Apparently this is a bad design, but this design gives us better performance. | |
| isComplex | back to summary |
|---|---|
| public final boolean isComplex() checks if the result of 'get' method is not the union of all elements of concern. Within this class, combined child content expression is always the union of all elements of concern. However, some derived class does not guarantee this property.
| |
| numMatchedElements | back to summary |
|---|---|
| public final int numMatchedElements() gets the number of matched elements. This method should be called after calling get method. The result is in effect until next invocation of get method. Apparently this is a bad design, but this design gives us better performance. | |
| onAnyString | back to summary |
|---|---|
| public void onAnyString() Implements com. | |
| onAttribute | back to summary |
|---|---|
| public void onAttribute(AttributeExp exp) Implements com. | |
| onChoice | back to summary |
|---|---|
| public void onChoice(ChoiceExp exp) Implements com. | |
| onConcur | back to summary |
|---|---|
| public void onConcur(ConcurExp exp) Implements com. | |
| onData | back to summary |
|---|---|
| public void onData(DataExp exp) Implements com. | |
| onElement | back to summary |
|---|---|
| public void onElement(ElementExp exp) Implements com. | |
| onEpsilon | back to summary |
|---|---|
| public void onEpsilon() Implements com. | |
| onInterleave | back to summary |
|---|---|
| public void onInterleave(InterleaveExp exp) Implements com. | |
| onList | back to summary |
|---|---|
| public void onList(ListExp exp) Implements com. | |
| onMixed | back to summary |
|---|---|
| public void onMixed(MixedExp exp) Implements com. | |
| onNullSet | back to summary |
|---|---|
| public void onNullSet() Implements com. | |
| onOneOrMore | back to summary |
|---|---|
| public void onOneOrMore(OneOrMoreExp exp) Implements com. | |
| onOther | back to summary |
|---|---|
| public void onOther(OtherExp exp) Implements com. | |
| onRef | back to summary |
|---|---|
| public void onRef(ReferenceExp exp) Implements com. | |
| onSequence | back to summary |
|---|---|
| public void onSequence(SequenceExp exp) Implements com. | |
| onValue | back to summary |
|---|---|
| public void onValue(ValueExp exp) Implements com. | |
| Modifier and Type | Field and Description |
|---|---|
| public final Expression | |
| public final Expression |
| Access | Constructor and Description |
|---|---|
| public |
| content | back to summary |
|---|---|
| public final Expression content | |
| continuation | back to summary |
|---|---|
| public final Expression continuation | |
| ExpressionPair | back to summary |
|---|---|
| public ExpressionPair(Expression content, Expression continuation) | |