コード例 #1
0
ファイル: bmachine.py プロジェクト: hhu-stups/pyB
 def parse_parameters(self):
     assert self.has_mch_header
     self.mch_name = self.aMachineHeader.idName
     for idNode in self.aMachineHeader.children:
         assert isinstance(idNode, AIdentifierExpression)
         # 2.1 id names [a-zA-Z][a-zA-Z0-9_]*
         string = idNode.idName
         if contains_lower_character(string):
             # Page 116. 7.5 
             # scalar parameters: the name of a scalar parameter is an identifier 
             # that must contain at least one lowercase character.
             self.scalar_params.append(idNode)
         else:
             # Page 116. 7.5 
             # set parameters: the name of a set parameter is an identifier 
             # that must not contain a lowercase character.
             # TODO: This impl was always wrong write a Testcase with Book 
             self.set_params.append(idNode)
     if not self.scalar_params==[]:
         assert self.has_constraints_mc
コード例 #2
0
ファイル: test_helpers.py プロジェクト: hhu-stups/pyB
 def test_contains_lower_character(self):
     assert not contains_lower_character("BOOK")
     assert contains_lower_character("capacity")
     assert contains_lower_character("Book")
     assert contains_lower_character("az")