/*------------------------------------------------------------------------------
| Part of Tweedledum Project.  This file is distributed under the MIT License.
| See accompanying file /LICENSE for details.
*-----------------------------------------------------------------------------*/
// This file defines all token kinds.
// Took the idea from Clang :)
#ifndef TOKEN
#define TOKEN(X)
#endif
#ifndef PUNCTUATOR
#define PUNCTUATOR(X,Y) TOKEN(X)
#endif
#ifndef PPKEYWORD
#define PPKEYWORD(X) TOKEN(pp_ ## X)
#endif
#ifndef KEYWORD
#define KEYWORD(X,Y) TOKEN(kw_ ## X)
#endif
#ifndef UOPERATOR
#define UOPERATOR(X,Y) TOKEN(kw_uop_ ## X)
#endif

TOKEN(unknown)
TOKEN(error)
TOKEN(eof)
TOKEN(comment)
TOKEN(identifier)
TOKEN(real)
TOKEN(nninteger)
TOKEN(string)

// Punctuators
PUNCTUATOR(l_square,   "[")
PUNCTUATOR(r_square,   "]")
PUNCTUATOR(l_paren,    "(")
PUNCTUATOR(r_paren,    ")")
PUNCTUATOR(l_brace,    "{")
PUNCTUATOR(r_brace,    "}")
PUNCTUATOR(period,     ".")
PUNCTUATOR(star,       "*")
PUNCTUATOR(plus,       "+")
PUNCTUATOR(minus,      "-")
PUNCTUATOR(arrow,      "->")
PUNCTUATOR(slash,      "/")
PUNCTUATOR(caret,      "^")
PUNCTUATOR(semicolon,  ";")
PUNCTUATOR(equalequal, "==")
PUNCTUATOR(comma,      ",")

// preprocessor keywords
PPKEYWORD(include)

// Keywords
KEYWORD(barrier, "barrier")
KEYWORD(creg,    "creg")
KEYWORD(cx,      "CX")
KEYWORD(gate,    "gate")
KEYWORD(if,      "if")
KEYWORD(measure, "measure")
KEYWORD(pi,      "pi")
KEYWORD(opaque,  "opaque")
KEYWORD(openqasm,"OPENQASM")
KEYWORD(qreg,    "qreg")
KEYWORD(reset,   "reset")
KEYWORD(u,       "U")

// Keywords unary operators
UOPERATOR(sin,  "sin")
UOPERATOR(cos,  "cos")
UOPERATOR(tan,  "tan")
UOPERATOR(exp,  "exp")
UOPERATOR(ln,   "ln")
UOPERATOR(sqrt, "sqrt")

#undef UOPERATOR
#undef KEYWORD
#undef PPKEYWORD
#undef PUNCTUATOR
#undef TOKEN

