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,@eu.bandm.tools.annotations.Opt java.lang.String)
is called.-
Field Summary
Modifier and TypeFieldDescription(package private) CheckedList<String>
(package private) boolean
protected DTD.Dtd
protected boolean
protected boolean
protected boolean
protected Module
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
protected Set<Definition>
protected DTD.CP
protected boolean
protected Set<Definition>
Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
void
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!void
void
void
void
void
void
void
void
(package private) void
addAtt
(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 void
convert
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Module module, XMLDocumentIdentifier newId, boolean tdom_mode, @Opt String tdom_doc_language) Central working method for transformation to dtd.protected void
getDocu
(SourceItem item) protected void
makeSeq
(CheckedList<Expression> on) protected void
markNeeded
(Definition def) protected NamespaceName
normalize
(NamespaceName nn, boolean isAttribute) protected void
translate
(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_xattributes
Methods inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_trace, 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
-
tdom_mode
protected boolean tdom_mode -
tdom_doc_language
-
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 tdom_mode, @Opt @Opt String tdom_doc_language) 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.tdom_mode
- whether tdom processing instructions (w.r.t public and private) shall be generatedtdom_doc_language
- 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:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in 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 | q
CURRENTLY xml kind cannot be specified / is == element
CURRENTLY xml tag cannot be specified / is == the d2d tag- Overrides:
action
in classSinglePhase
-
charsFound
protected void charsFound() -
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
translatesubs
-
makeSeq
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-
action
- Overrides:
action
in classSinglePhase
-