public class Def2Dtd extends SinglePhase
convert(MessageReceiver,Module,XMLDocumentIdentifier,boolean,String)
is called.
Modifier and Type | Field and Description |
---|---|
protected DTD.Dtd |
dtd |
protected boolean |
hasDocu |
protected boolean |
haspcdata |
protected boolean |
iscomplex |
protected Module |
module |
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> |
msg |
protected Set<Definition> |
needed |
protected Map<String,String> |
prefix2uri |
protected DTD.CP |
subresult |
protected @Opt String |
tdom_doc_language |
protected boolean |
tdom_mode |
protected Map<String,String> |
uri2prefix |
protected Set<Definition> |
visited |
_visitor_debug_stream, partial
Constructor and Description |
---|
Def2Dtd() |
Modifier and Type | Method and Description |
---|---|
void |
action(Alt x) |
void |
action(CharExpr x) |
void |
action(Empty x) |
void |
action(Insertion x) |
void |
action(Opt x) |
void |
action(ParseParticle x)
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 |
action(Pcdata x) |
void |
action(Perm x) |
void |
action(Plus x) |
void |
action(Reference x) |
void |
action(Seq x) |
void |
action(Star x) |
void |
action(StringConst x) |
void |
action(Subst x) |
protected void |
charsFound() |
DTD.Dtd |
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 |
convertNeeded() |
protected @Opt String |
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) |
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action
_visitor_trace, action, action, action, action, 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, nomatch
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
protected Module module
protected DTD.Dtd dtd
protected boolean tdom_mode
protected DTD.CP subresult
protected boolean iscomplex
protected boolean haspcdata
protected Set<Definition> needed
protected Set<Definition> visited
protected boolean hasDocu
public DTD.Dtd convert(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Module module, XMLDocumentIdentifier newId, boolean tdom_mode, @Opt @Opt String tdom_doc_language)
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".protected void convertNeeded()
protected NamespaceName normalize(NamespaceName nn, boolean isAttribute)
@Opt protected @Opt String getDocu(SourceItem item)
protected void markNeeded(Definition def)
protected void translate(Definition def)
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
public void action(Empty x)
action
in class SinglePhase
public void action(Subst x)
action
in class SinglePhase
public void action(Reference x)
action
in class SinglePhase
public void action(Insertion x)
action
in class SinglePhase
public void action(ParseParticle x)
a = [p "ABC"] b = [p [q "ABC"]] ==> p = #chars | qCURRENTLY xml kind cannot be specified / is == element
action
in class SinglePhase
protected void charsFound()
public void action(StringConst x)
action
in class SinglePhase
public void action(CharExpr x)
action
in class SinglePhase
public void action(Pcdata x)
action
in class SinglePhase
protected CheckedList<DTD.CP> translatesubs(Collection<Expression> subs)
protected void makeSeq(CheckedList<Expression> on)
public void action(Perm x)
action
in class SinglePhase
public void action(Seq x)
action
in class SinglePhase
public void action(Alt x)
action
in class SinglePhase
public void action(Opt x)
action
in class SinglePhase
public void action(Star x)
action
in class SinglePhase
public void action(Plus x)
action
in class SinglePhase
see also the complete user documentation .