spirali / kaira

Main repository of project Kaira
http://verif.cs.vsb.cz/kaira
GNU General Public License v3.0
5 stars 8 forks source link

Combine (replace) token_name with overloaded operator << #5

Open msurkovsky opened 9 years ago

msurkovsky commented 9 years ago

It would be better if types which are used on places overloads operator << instead of using token_name function for string representation of tokens. Currently there is used token_name method which has to be specified for such types. But when types with token_name method and other types which usually provide their string representation through << operator have to be combined drawbacks come to light. It would be useful to have one unique way for providing string representation of a type. There is a question whether token_name method should be preserved and a new solution will be a combination of both attempts or it should be completely deleted?

spirali commented 9 years ago

I think that it can be combined in a way that 'token_name' is preferred if it exists. If it does not exist then << is used. (The same mechanism as for external/internal token_name, where external is preferred). Not only because of backward-comparability, but sometimes << can be unusable for token name.