Package eu.bandm.tools.d2d2.base
Class Dtd2Def.Phase1.AttConverter
java.lang.Object
eu.bandm.tools.dtm.DTM.MATCH_ONLY_00
eu.bandm.tools.dtm.DTM.SinglePathVisitor
eu.bandm.tools.d2d2.base.Dtd2Def.Phase1.AttConverter
- Enclosing class:
- Dtd2Def.Phase1
Translates d2d attribute definitions to d2d expressions on references.
and creates the corresponding d2d definitions. The latter either in the
global aux element
Dtd2Def.attContainer
, or local to the current element
targetEl
. The name may be mangled due to LL(1) conflicts with the
content model (As in HTML "td/abbr" vs "td/@abbr" and "ins/cite" vs "ins/@cite").
"#FIXED
" attributes are not translated at all.
Create one instance and re-use it for all attributes of one single element,
by invoking translate(DTM.Attribute)
.
-
Field Summary
Modifier and TypeFieldDescriptionThe tags which can start the translation of the element's content model, and thus cannot appear as names of optional attributes.(package private) boolean
Visitor register, set when the currently visited attribute is fixed.(package private) boolean
Visitor register, set when the currently visited attribute is reqired.(package private) final TagsRegExp
The d2d definition for which the attributes shall be translated.Fields inherited from class eu.bandm.tools.dtm.DTM.MATCH_ONLY_00
_visitor_debug_stream, partial
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Sets only the flag.protected void
Sets only the flag.protected String
makeQname
(NamespaceName nn, Location<XMLDocumentIdentifier> elloc) Translate an attribute's NamespaceName into a valid d2d name.(package private) @Opt Expression
translate
(DTM.Attribute att) Central service point: Convert one attribute, generate the necessary d2d definition, add it to an element def in the generated module, and return the appropriate reference expression.Methods inherited from class eu.bandm.tools.dtm.DTM.SinglePathVisitor
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, action, action, follow_alts, follow_attrs, follow_elems, follow_elems, follow_elems, follow_instructions
Methods inherited from class eu.bandm.tools.dtm.DTM.MATCH_ONLY_00
action, action, action, compile, followAll_alts, followAll_attrs, followAll_elems, followAll_elems, followAll_elems, followAll_instructions, 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, nomatch
-
Field Details
-
targetEl
The d2d definition for which the attributes shall be translated. -
firsttags
The tags which can start the translation of the element's content model, and thus cannot appear as names of optional attributes. -
fixed
boolean fixedVisitor register, set when the currently visited attribute is fixed. -
required
boolean requiredVisitor register, set when the currently visited attribute is reqired.
-
-
Constructor Details
-
AttConverter
AttConverter(TagsRegExp targetEl, Set<String> firsttags) Evident.
-
-
Method Details
-
makeQname
Translate an attribute's NamespaceName into a valid d2d name.- Parameters:
elloc
- Location of the element's definition, used for error messages.
-
translate
Central service point: Convert one attribute, generate the necessary d2d definition, add it to an element def in the generated module, and return the appropriate reference expression. -
action
Sets only the flag.- Overrides:
action
in classDTM.SinglePathVisitor
-
action
Sets only the flag.- Overrides:
action
in classDTM.SinglePathVisitor
-