Menu

#1 flex scanner jam

open-fixed
3
2006-09-22
2001-08-30
Steve Hack
No

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>

Discussion

  • Martin Quinson

    Martin Quinson - 2005-02-10

    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.

     
  • Martin Quinson

    Martin Quinson - 2005-02-10

    The dtd (for others to play with it)

     
  • Martin Quinson

    Martin Quinson - 2005-02-10

    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

     
  • Anonymous

    Anonymous - 2005-02-24

    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.

     
  • Martin Quinson

    Martin Quinson - 2005-02-24
    • status: open --> open-fixed
     
  • Martin Quinson

    Martin Quinson - 2005-02-24
    • status: open-fixed --> closed-fixed
     
  • Anonymous

    Anonymous - 2006-09-22
    • priority: 5 --> 3
    • assigned_to: nobody --> wdowling
     
  • Anonymous

    Anonymous - 2006-09-22

    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.)

     
  • Anonymous

    Anonymous - 2006-09-22
    • status: closed-fixed --> open-fixed
     
  • Anonymous

    Anonymous - 2006-09-22

    Logged In: YES
    user_id=95118

    Still open, as a wishlist item.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.