Under special circumstances, compilation gets stuck at "Checking modules..."
Submitted by Anton Vikstrom
Link to original bug (#568592)
Description
We used xsd2ttcn to generate code from ETSI specification for X1 types and ran into the problem that compilation would get stuck forever at "Checking modules...".
The exact code causing the problem is:
type XSD.String H323Uri (pattern "^h323:[a-zA-Z0-9!#$\q{0, 0, 0, 38}&-;=?-[]_~%]+$");
type XSD.String Impu (pattern "^[a-zA-Z0-9!#$\q{0, 0, 0, 38}&-;=?-[]_~%]+$");
type XSD.String Impi (pattern "^[a-zA-Z0-9!#$\q{0, 0, 0, 38}&-;=?-[]_~%]+$");
type XSD.AnyURI SIPURI (pattern "sips#(0,1):[a-zA-Z0-9!#$\q{0, 0, 0, 38}&-;=?-[]_~%]+");
type XSD.AnyURI TELURI (pattern "tel:[a-zA-Z0-9!#$\q{0, 0, 0, 38}&-;=?-[]_~%]+");
where the types are defined in the XSD protocol module:
type XMLStringWithNoCRLFHT AnyURI with { variant "XSD:anyURI"; };
type utf8string XMLStringWithNoCRLFHT ( char(0,0,0,32)..char(0,0,215,255), char(0,0,224,0)..char(0,0,255,253), char(0,1,0,0)..char(0,16,255,253) )
type XMLCompatibleString String with { variant "XSD:string"; };
type utf8string XMLCompatibleString ( char(0,0,0,9)..char(0,0,0,9), char(0,0,0,10)..char(0,0,0,10), char(0,0,0,12)..char(0,0,0,12), char(0,0,0,32)..char(0,0,215,255), char(0,0,224,0)..char(0,0,255,253), char(0,1,0,0)..char(0,16,255,253) )
After a bit of experimentation, this is what I came up with:
The problems seems to occur if ALL of the following conditions are met:
-
We are sub-typing one of the restricted types from XSD (XSD.AnyURi or XSD.String) with a character pattern.
-
The character pattern contains "\q{0,0,0,38}" (changing 38 to 36 compiles; I have not tried other numbers) inside of a set of alternatives, i.e., "[ ]".
-
There is "&-;" on the RIGHT side of "\q{0,0,0,38}" inside the set of alternatives.
-
There is a range of lowercase-only character (like "a-z") on the LEFT side of "\q{0,0,0,38}" inside the set of alternatives ("[ ]").
-
There is a range of uppercase-only character (like "A-Z") on the LEFT side of "\q{0,0,0,38}" inside the set of alternatives ("[ ]").
Based on the above, a minimal failing example would be:
type XSD.AnyURI TELURI (pattern "tel:[a-zA-Z\q{0, 0, 0, 38}&-;]+");
Version: 7.1.0