def getdomain(self):
sdlist = []<EOL>while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] in self.LWS:<EOL><INDENT>self.pos += <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:(>':<EOL><INDENT>self.commentlist.append(self.getcomment())<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:[>':<EOL><INDENT>sdlist.append(self.getdomainliteral())<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:.>':<EOL><INDENT>self.pos += <NUM_LIT:1><EOL>sdlist.append('<STR_LIT:.>')<EOL><DEDENT>elif self.field[self.pos] in self.atomends:<EOL><INDENT>break<EOL><DEDENT>else: sdlist.append(self.getatom())<EOL><DEDENT>return '<STR_LIT>'.join(sdlist)<EOL>
Get the complete domain name from an address.