Package eu.bandm.tools.d2d2.base
Class Def2Dtd
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.SinglePhase
eu.bandm.tools.d2d2.base.Def2Dtd
Implements the translation of a d2d definition module (imported from
.ddf/.umod/.dtd/ad lib) into a Dtd object.
After construction of an instance (always anew, no re-usage) the main method
convert(eu.bandm.tools.message.MessageReceiver<eu.bandm.tools.message.SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>,eu.bandm.tools.d2d2.model.Module,eu.bandm.tools.util.xml.XMLDocumentIdentifier,boolean,java.lang.@eu.bandm.tools.annotations.Opt String)
is called.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CheckedList<String> (package private) booleanprotected DTD.Dtdprotected booleanprotected booleanprotected booleanprotected Moduleprotected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> protected Set<Definition> protected DTD.CPprotected booleanprotected Set<Definition> Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidParseParticles are currently kept as local defs in local scope (THIS SHOULD CHANGE / FIXME) never mixed content / either structured or chars-only.
(( when GLOBAL, this does nolonger hold!voidvoidvoidvoidvoidvoidvoidvoid(package private) voidaddAtt(DTD.Attlist attlist, String qname, boolean isOptional) allows multiple occurences of d2d refs to one ddf-element, like in{xslt}template = ((name, match?)|(match,name?)), etc!!! Optional wins!protected voidconvert(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Module module, XMLDocumentIdentifier newId, boolean tdomMode, @Opt String tdomDocLanguage) Central working method for transformation to dtd.protected voidgetDocu(SourceItem item) protected voidmakeSeq(CheckedList<Expression> on) protected voidmarkNeeded(Definition def) protected NamespaceNamenormalize(NamespaceName nn, boolean isAttribute) protected voidtranslate(Definition def) Treat tags regexp and chars regexp differently.protected CheckedList<DTD.CP> translatesubs(Collection<Expression> subs) Methods inherited from class eu.bandm.tools.d2d2.model.SinglePhase
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, follow_definitions, follow_defInstances, follow_docu, follow_firsts, follow_globalSubsts, follow_imports, follow_itemDocu, follow_localdefs, follow_localSubsts, follow_modules, follow_namespaces, follow_obligates, follow_on, follow_rawModules, follow_text, follow_weakfirsts, follow_xattributesMethods inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_trace, action, action, action, action, action, compile, followAll_definitions, followAll_defInstances, followAll_docu, followAll_firsts, followAll_globalSubsts, followAll_imports, followAll_itemDocu, followAll_localdefs, followAll_localSubsts, followAll_modules, followAll_namespaces, followAll_obligates, followAll_on, followAll_rawModules, followAll_text, followAll_weakfirsts, followAll_xattributes, foreignObject, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, nomatch
-
Field Details
-
msg
-
module
-
dtd
-
tdomMode
protected boolean tdomMode -
tdomDocLanguage
-
subresult
-
iscomplex
protected boolean iscomplex -
haspcdata
protected boolean haspcdata -
allSingletonNames
CheckedList<String> allSingletonNames -
needed
-
visited
-
prefix2uri
-
uri2prefix
-
hasDocu
protected boolean hasDocu -
canProduceEpsilon
boolean canProduceEpsilon
-
-
Constructor Details
-
Def2Dtd
public Def2Dtd()
-
-
Method Details
-
convert
public DTD.Dtd convert(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Module module, XMLDocumentIdentifier newId, boolean tdomMode, @Opt @Opt String tdomDocLanguage) Central working method for transformation to dtd. Generates a file in UTF8 encoding.- Parameters:
msg- target for warning messages (CURRENTLY no errors).module- what to translatenewId- what is entered into the Dtd object as its ID.tdomMode- whether tdom processing instructions (w.r.t public and private) shall be generatedtdomDocLanguage- the language code to filter the documentation entries. Must be the complete code, like "tdom" or "user_en".
-
convertNeeded
protected void convertNeeded() -
normalize
-
getDocu
-
markNeeded
-
translate
Treat tags regexp and chars regexp differently. The following call to "match()" sets the global register variables of the visitor and allows different reactions:tags (a?, (b|c)*, #chars) ---> haspcdata true ---> iscomplex true --> (#PCDATA|a|b|c)* + warning tags ( a | b |c | #chars)* ---> haspcdata true ---> iscomplex false --> (#PCDATA|a|b)* tags ( a?, (b|c)*, x) ---> haspcdata false --> (a?, (b|c)*, x) chars ( a?, (b|"XX"), "))") ---> a?, b? //ignore all char data chars ( [a b*,c],"XX",d,"XX")? ---> (a, d)? //ignore all char data chars ('a'~ 'b'~ 'c') ---> null --> #PCDATA -
addAtt
allows multiple occurences of d2d refs to one ddf-element, like in{xslt}template = ((name, match?)|(match,name?)), etc!!! Optional wins! -
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
ParseParticles are currently kept as local defs in local scope (THIS SHOULD CHANGE / FIXME) never mixed content / either structured or chars-only.
(( when GLOBAL, this does nolonger hold!a = [p "ABC"] b = [p [q "ABC"]] ==> p = #chars | qCURRENTLY xml kind cannot be specified / is == element
CURRENTLY xml tag cannot be specified / is == the d2d tag- Overrides:
actionin classSinglePhase
-
charsFound
protected void charsFound() -
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
translatesubs
-
makeSeq
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-