When creating a DTD with nested elements, the lexer
does not have all the necessary error states.
DTD:
<!ELEMENT joke susp>
<!ELEMENT susp EMPTY>
XML:
<joke>
</joke>
Output:
flex scanner jam - it needs to have an error message
stating that it is expecting <susp>
Logged In: YES
user_id=85746
It doesn't jam anymore (thanks Will), but repport:
Invalid XML (XML input line 4, state 11): Syntax error on
character `<'.
Is it acceptable to you? May I close this bug?
(btw, XML must read:
<?xml version='1.0'?>
<!DOCTYPE joke SYSTEM "joke.dtd">
<joke>
</joke>
)
Thanks, Mt.
The dtd (for others to play with it)
Logged In: YES
user_id=85746
reminder for myself.
flexml -A -L joke.dtd && flex joke-dummy.l && echo 'main()
{yylex();return 0;}' >> lex.yy.c && gcc lex.yy.c && cat
joke.xml | ./a.out
Logged In: YES
user_id=95118
The modifications in skel revision 1.20 (24 Jan 2005)
address this problem. In particular I added a catch-all rule:
<*> { .|[\n] FAIL("Syntax error on character `%c'.",
yytext[0]); }
It would be possible to give better error messages, but at
least we don't get a scanner jammed message.
Logged In: YES
user_id=95118
I am lowering the priority on this bug because the generated
scanner is functional and complete; it just doesn't generate
the most descriptive error message when given erroneous
input. So this is more of a wishlist item than a bug.
(Also closed bug #457550 and pointed that bug to this one
since it is closely related.)
Logged In: YES
user_id=95118
Still open, as a wishlist item.