TIVI-153: Add as dependency for iputils
[profile/ivi/opensp.git] / doc / ideas.htm
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Strict//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>Ideas for improving SP</TITLE>
5 </HEAD>
6 <BODY>
7 <H1>Ideas for improving SP</H1>
8 <H2>
9 Parser
10 </H2>
11 <P>
12 When !internalCharsetIsDocCharset, need to check that every
13 significant character is an SGML character.
14 <P>
15 Treat "ISO Registration Number NNN//" public ids specially.  Warn if
16 they use designating sequence inconsistently.
17 <P>
18 Pass non-declared attributes through to application.
19 <P>
20 Avoid expensive overflow test in stringToNumber when length of number
21 is less then something guaranteed not to overflow.
22 <P>
23 Allow external character set to be complete character set description.
24 <P>
25 Maybe distinguish non-SGML characters as separate event even when
26 internalCharsetIsDocCharset.
27 <P>
28 Supporting caching across multiple runs of parser in single
29 process.
30 <P>
31 Make Dtd copiable.
32 <P>
33 ?Subdoc parser needs character set for system id (should be system
34 character set).
35 <P>
36 Recover better from non-existent documents or subdocuments.
37 <P>
38 Think about entity declarations/references in inactive LPDs.
39 <P>
40 Don't allow name groups in parameter entity references in document
41 type specifications in start-/end-tags.
42 <P>
43 With link, don't do a pass 2 unless we replace a referenced entity
44 (what about default entity?).
45 <P>
46 Options to warn about things that HTML disallows: marked sections in
47 instance, explicit subsets.
48 <P>
49 Option to warn about MDCs in comments in comment declarations.
50 <P>
51 Option to warn about omitted REFC.
52 <P>
53 Check that names of added functions are valid names in concrete syntax
54 (both characters and lengths).  Also need to do upper-case
55 substitution on them?
56 <P>
57 Recover from nested doctype declaration intelligently.
58 <P>
59 Recover from missing doctype declaration intelligently. 
60 <P>
61 Could optimize parsing of attribute literals using technique similar
62 to extendData().
63 <P>
64 attributeValueLength error should give actual length of value.
65 <P>
66 Recover better from entity reference with name group in literal.
67 <P>
68 At start of pass 2 clear everything in pass1LPDs except entity sets.
69 <P>
70 Give an error if EXPLICIT > 1 and LPDs don't chain as required by
71 436:5-7 and 436:18-20.
72 <P>
73 Handle quantity errors by reporting at the end of the prolog and the
74 end of the instance any quantities that need to be increased.
75 <P>
76 Make noSuchReservedName error more helpful.
77 <P>
78 Function characters should perform their function even when markup
79 recognition is suppressed. (I think I've handled this.)
80 <P>
81 Give a warning for notation attribute that is #CONREF.
82 <P>
83 Try to separate out Parser::compileModes().
84 <P>
85 In CompiledModelGroup have vector that gives an index for each element type
86 that occurs in the model group.  Then in each leaf content token have a
87 vector that maps this index to a LeafContentToken *, if there
88 is a simple transition (no and groups involved) to that element type.
89 <P>
90 MatchState::minAndDepth and MatchState::AndInfo should be separated
91 off info object pointed to from MatchState; pointer would be null for
92 elements with no AND groups.
93 <P>
94 What to do if we encounter USELINK or USEMAP declaration after DTD in
95 prolog?  Should stop prolog and start DTD.  If we have SCOPE INSTANCE
96 then if we get an unknown declaration type in prolog, don't give
97 error, but unget token and start instance.
98 <P>
99 ?Have separate version of reportNonSgml() for case where datachar is allowed.
100 <P>
101 Implement CONCUR.
102 <P>
103 AttributeDefinition constructors should have Owner&lt;DeclaredValue> &,
104 arguments to avoid storage leaks when exceptions are thrown.
105 <P>
106 Create a list like IList but which keeps track of length.  Then
107 combine tagLevel into openElement stack, and inputLevel into
108 inputStack.
109 <P>
110 AttributeDefinition::makeValue should return
111 ConstResourcePointer&lt;AttributeValue>.
112 <P>
113 Syntax member functions should use reference for result.
114 <P>
115 Have a LocationKey data structure that can be used to determine the
116 relative order of locations in possibly different concurrent
117 instances.  Contains: offset in document instance; is it a replacement
118 of named character reference; for each entity and numeric character
119 reference: location in entity and index of dtd in which instance is
120 declared.
121 <P>
122 On systems with fixed stacks, avoid unlimited stack growth: hard
123 limits on number of SUBDOCS and GRPLVL.
124 <P>
125 With extendData and extendS don't extend more than some fixed amount
126 (eg 1024), otherwise could overrun InputSource buffer on 16-bit
127 system.
128 <P>
129 Have a location in ElementType saying where the first mention of the
130 element name was.  Useful for giving warnings about undefined
131 elements.
132 <P>
133 How to detect 310:8-10?
134 <P>
135 AttributeSemantics should return const pointers rather than ResourcePointer's
136 <P>
137 Rename Parser -> ParserImpl SgmlParser -> Parser
138 Syntax::isB -> Syntax::isBlank
139 <P>
140 What mode should be used for parsing other prolog after document element?
141 <P>
142 Flag out of context data.
143 <P>
144 Provide mechanism to allow character names to be mapped onto universal
145 character numbers.
146 <P>
147 Provide mechanism to allow specification of wbat characters are
148 control characters (for the purposes of SHUNCHAR controls).
149 <P>
150 With SCOPE INSTANCE, which syntax should be used for delimiters in
151 bracketed text entities?
152 <P>
153 Better error messages for ambiguous delimiters.
154 <P>
155 Do we need both EndLpd and ComplexLink/SimpleLink events?
156 <P>
157 What to do about 457:19-21?
158 <P>
159 Rename lpd_ to activeLpd_; allLpd_ to lpd_.
160 <P>
161 Test for validity of character numbers in syn ref charset (perhaps
162 unnecessary, because bad numbers won't be translateable into doc
163 charset).
164 <P>
165 Option to read bootstrap character set from entity.
166 <P>
167 In AttributeDefinitionList have a flag that is true if any checking of
168 unspecified values in attribute list is needed (ie CURRENT, REQUIRED,
169 non-implied ENTITY, non-implied NOTATION).  In this case can avoid
170 running over attributes in AttributeList::finish, by computing value
171 only when user calls Attribute::value().
172 <P>
173 Construct link attributes from definition if no applicable link rule.
174 (RAST maybe doesn't want this.  Make it a separate method in LinkProcess and
175 use in SgmlsEventHandler. Very useful with ArcEngine.)
176 <P>
177 Shouldn't have OpenElementInfo in Message.  Instead use RTTI.
178 <P>
179 noSuchAttribute: include gi in message; if element is undefined, don't
180 give error at all
181 <P>
182 noSuchAttributeToken: say what element or entity
183 <P>
184 nonExistentEntityRef should say document/link type
185 <P>
186 Distinguish errors that are totally recoverable.
187 <P>
188 Find better way to unpack entity information in entity attribute.
189
190 <H2>
191 Entity Manager
192 </H2>
193 <P>
194 Build document<->internal translation tables once per document not
195 once per entity.
196 <P>
197 Avoid document<->internal translations when one is the subset of the other
198 (or something like that).
199 <P>
200 In cases where it won't cause problems, don't translate
201 non-SGML/unrepresentable characters when doing document<->internal
202 translations, so that user gets better error message.
203 <P>
204 Recover better from unknown document character sets (shouldn't report
205 them as non-SGML characters).
206 <P>
207 Maybe need to keep track of set of SGML characters as numbers in document
208 character set.
209 <P>
210 Optimize TranslateDecoder where underlying codingSystem is identity by
211 using simple lookup table.
212 <P>
213 Make use of charset parameter in MIME header for HTTP.  Also generate
214 AcceptCharsets line in request.
215 <P>
216 Implement .mim files (if extension of file is same as environment variable
217 SP_MIME_EXT assume it has a MIME header).
218 <P>
219 Avoid using TranslateCodingSystem when translation is a no-op.
220 <P>
221 Make SP_CONVERT when !SP_MULTI_BYTE.
222 <P>
223 Avoid requiring that BASE sysid exist.
224 <P>
225 When FSI has only a single storage manager and that is a literal,
226 return an InternalInputSource.
227 <P>
228 Allow user of InputSource to specify what bit combinations they
229 want to see for RS and RE.
230 <P>
231 Have environment variable SP_INPUT_BCTF that overrides SP_BCTF for
232 input.
233 <P>
234 Avoid using numeric character references for all characters in storage
235 object identifier of literal storage manager in effective system
236 identifier.
237 <P>
238 Instead of registering coding system pass CodingSystemKit that can create
239 that can create coding systems.
240 <P>
241 Need BCTF entry in catalog that specifies default BCTF.
242 <P>
243 Allow encodings to be externally specified (eg in a catalog) as a
244 combination of a BCTF and a character set.
245 <P>
246 An SOEntityCatalog should consist of a Vector&lt;ConstPtr&lt;EntityCatalog>
247 > which can be shared between several catalogs.  This would facilitate
248 > caching.
249 <P>
250 Maybe need to be able to specify two types of catalog entry file: one
251 used for all documents; one used for this document alone.
252 <P>
253 Allow end-tags in FSIs.  Support alternative SOSs.
254 <P>
255 Character sets in the catalog need rethinking.  Also character set of
256 ParsedSystemId::Map::publicId.
257 <P>
258 Allow for HTTP proxy.
259 <P>
260 Cache catalogs.
261 <P>
262 Use Microsoft ActiveX (formerly Sweeper) DLL on Win95 or NT.
263 <P>
264 Support FILE URLs.
265 <P>
266 Perhaps don't want to do searching for catalog files (and perhaps
267 command line files).
268 <P>
269 Provide mechanism for specifying when (if at all) base dir is searched
270 relative to other dirs.
271 <P>
272 Provide extension to catalog format to distinguish entities declared
273 in non-base DTDs. Perhaps precede entity name by document type name
274 surrounded by GRPO/GRPC delimiters.
275 <P>
276 URLStorageManager should use a DescriptorManager shared with
277 PosixStorageManager.
278 <P>
279 URLStorageManager::resolveRelative should delete "xxx/../" and "./"
280 components.  Might also be a good idea to resolve host names.
281 <P>
282 Implement JIS encoding system (what should be done with half-width yen
283 and overbar in JIS-Roman? translate to Unicode).
284 <P>
285 ExternalInfoImpl::convertOffset: when the position is the character
286 past the last character and the last character was a newline, line
287 number should be number of lines + 1.
288 <P>
289 Try harder to rewind in StdioStorageObject.
290
291 <H2>
292 Generic
293 </H2>
294 <P>
295 Provide mechanism to access data entities using generated system id.
296 <P>
297 Support IMPLICIT/SIMPLE LINK.
298 <P>
299 Character set information.
300 <P>
301 Need to know space character that separates token.  Alternatively
302 provide broken down view of tokens.
303 <P>
304 Need to know IDREF (and other declared values)?
305
306 <H2>
307 nsgmls
308 </H2>
309 <P>
310 Problem with "\#n;" escape sequence is that it might get used other
311 than in data.  Probably should get rid of this feature, and give
312 a warning when there's an unencodable character.
313
314 <H2>
315 Internal
316 </H2>
317 <P>
318 Make sure all files use #pragma i/i.
319 <P>
320 Get rid of assumption that Vector&lt;T>::size_type, String&lt;T>::size_type
321 is size_t.
322 <P>
323 Maybe align Owner with auto_ptr.
324 <P>
325 Get rid of uses of string as identifier.
326 <P>
327 ?Maybe support non-const copy constructors for NCVector/Owner.
328 <P>
329 Get rid of asEntityOrigin (as far as possible).  Make
330 InputSourceOrigin::defLocation virtual on origin.  Avoid excessive use
331 of asInputSourceOrigin.
332 <P>
333 Hash should define Hash(String&lt;unsigned char>),
334 Hash(String&lt;unsigned short>) etc.
335 <P>
336 Invert sense of SP_HAVE_BOOL define.
337 <P>
338 Get rid of OutputCharStream::open.  Instead have
339 OutputCharStream::setEncoding.  (Perhaps make a friend so we can use
340 ostream if we're not interested in encodings.)  Allow use of ostream
341 instead of OutputCharStream.  Change ParserToolkit::errorStream_'s coding
342 system when we change the coding system.
343 <P>
344 Support 32-bit Char. Need to fix XcharMap and SubstTable.
345 Detemplatize SubstTable.  Then support UTF-16.
346 <P>
347 Have a common version of Ptr for things that have a virtual
348 destructor.
349 <P>
350 Have a common version of Owner for all things that have a virtual
351 destructor.
352 <P>
353 Inheritance in AttributeSemantics unnecesary.
354 <P>
355 Rename ISet -> RangeSet.
356 <P>
357 ISet and RangeMap should use binary search.
358 <P>
359 Better hash function for wide characters.
360 <P>
361 OutputCharStream should canonically use RS/RE and translate to system
362 newline char with raw option that prevents this.
363 <P>
364 Avoid having Entity.h depend on ParserState, perhaps by double
365 dispatching.
366 <P>
367 Add uses of explicit keyword.
368 <P>
369 When generating message.h file; if we don't have .cxx file and
370 namespaces are supported, use anonymous namespace.
371
372 <H2>
373 Application framework
374 </H2>
375 <P>
376 Only use static programName for outOfMemory message.
377 <P>
378 Need to use AppChar *const * not AppChar ** in CmdLineApp.
379 <P>
380 When reporting message with MessageEventHandler need to be able to
381 update error count.
382 <P>
383 Option argument names need to be internationalized.
384 <P>
385 Support response files for DOS.
386 <P>
387 Sort options in usage message.
388 <P>
389 StringMessageArg should be associated with a character set (in
390 particular, need to distinguish parser character sets from
391 StorageManager character sets).
392 <P>
393 Should translate StringMessageArg from document character set to
394 system character set.  Have MessageReporter::setDocumentCharacter
395 function.
396 <P>
397 In MessageReporter, maybe distinguish messages coming from the parser.
398 <P>
399 Don't ever give a non-existent file as a location in a error message.
400 <P>
401 Text of messages should be able to specify that an open quote or close
402 quote should be inserted at a particular point.
403 <P>
404 When outputting a StringMessageArg translate \r to \n.
405 <P>
406 Make sure wild cards work in VC++ and MS-DOS.
407
408 <H2>
409 Win32
410 </H2>
411 <P>
412 Remove path and extension from program name in error messages.
413 <P>
414 Compilers can typically eliminate unused templates.  Reengineer Vector
415 to reduce code size with such compilers.
416 <P>
417 Store messages in resources; requires numeric tags for messages.
418 <P>
419 Should automatically register all available code pages.
420 <P>
421 Make use of IsTextUnicode() API.
422 <P>
423 Have StorageManager that uses Win32 API directly.  Would avoid limits
424 on number of open files. Also use flag that says file is being
425 accessed sequentially.
426 <P>
427 Allow DTDs to be compiled into binary by having storage manager that
428 uses resource ids.
429
430 <H2>
431 Architecture engine
432 </H2>
433 <P>
434 Should give an error with -A if the specified arch does not exist.
435 <P>
436 Interpret APPINFO parameter, and automatically enable architectural
437 processing based on this.
438 <P>
439 Handle derived architecture support attributes.
440 <P>
441 When doing architectural processing in link type, not possible to have
442 notation declaration, so need some other way to specify public
443 identifier for architecture.
444 <P>
445 Allow DOCTYPE to be declared inline (as with CONCUR or EXPLICIT LINK).
446 <P>
447 Grok conventional comments.
448 <P>
449 Make work automatically with EventHandlers that process subdoc.  Make
450 references to subdocs architectural.
451 <P>
452 Support different SGML declaration for meta-DTD.
453 <P>
454 Maybe should map internal sdata/cdata entities to copies in meta-DTD.
455 <P>
456 Perhaps when getting open element info should indicate that gis are
457 architectural.
458 <P>
459 Think about references to SDATA entities in default values in meta-DTD.
460 <P>
461 Add default entity from real DTD to meta-DTD.
462 <P>
463 Tokenize ArcForm attribute appropriately.
464 <P>
465 Make special case for parsing DTD when entity can't be accessed.
466 <P>
467 Try to provide extension that would allow architecture elements be
468 asynchronous with actual elements?  This would provide CONCUR
469 functionality.
470
471 <H2>
472 sgmlnorm
473 </H2>
474 <P>
475 Avoid bogus newline from invalid empty document.
476 <P>
477 Avoid always escaping >.
478 <P>
479 Option to say whether to use character references for 8-bit characters.
480 <P>
481 Option to output implied attributes.
482 <P>
483 Option to output all non-implied attributes.
484 <P>
485 Option to omit attribute name with name tokens.
486 <P>
487 Protect against recognition of short references.
488 <P>
489 Option to preserve CDATA entity references.
490 <P>
491 Option to output general entity declarations in DTD subset
492 (but what about data attributes)?
493
494 <H2>
495 spam
496 </H2>
497 <P>
498 Option to normalize names.
499 <P>
500 Add comments round expanded entities to prevent false delimiter
501 recognition.
502 <P>
503 Add newline at the end if last thing was omitted tag.
504 <P>
505 Option to warn about changes in internal entities when not expanding.
506
507 <H2>
508 Documentation
509 </H2>
510 <P>
511 Error message format.
512 <P>
513 &lt;catalog&gt; FSI tag.
514 </BODY>
515 </HTML>