what is the advantage of using negative enums

Posted by Naveen on Stack Overflow See other posts from Stack Overflow or by Naveen
Published on 2010-04-26T03:06:39Z Indexed on 2010/04/26 3:13 UTC
Read the original article Hit count: 231

Filed under:
|

In the kaleidoscope parser / AST example at LLVM, the enum is given all negative values. Why the minus sign ?

enum Token {
  tok_eof = -1,
  // commands
  tok_def = -2, tok_extern = -3,
  // primary
  tok_identifier = -4, tok_number = -5
};

© Stack Overflow or respective owner

Related posts about enums

Related posts about llvm