SymbiFlow / uxsdcxx

generate C++ reader/writer from XSD schema
Apache License 2.0
6 stars 2 forks source link

sequences accept the wrong inputs #26

Closed duck2 closed 5 years ago

duck2 commented 5 years ago
   <xsd:sequence>
      <xsd:element name="isbn" type="isbn"/>
      <xsd:element name="title" type="title"/>
      <xsd:element name="genre" type="genre"/>
      <xsd:element name="author" type="author" maxOccurs="unbounded"/>
    </xsd:sequence>

generates this state machine:

enum class gtok_t_book {ISBN, TITLE, GENRE, AUTHOR};
[...]
int gstate_t_book[NUM_T_BOOK_STATES][NUM_T_BOOK_INPUTS] = {
    {0, -1, -1, -1},
    {0, -1, -1, -1},
    {-1, 1, -1, -1},
    {-1, -1, -1, 2},
    {-1, -1, 3, -1},
};

where initial state is 4 and accept state is 0. This implies an expected input of "author genre title isbn isbn isbn ..." which is the complete reverse of the described DFA.