/**
 * Thrift scanner.
 * 
 * Tokenizes a thrift definition file.
 * @author Mark Slee <mcslee@facebook.com>
 */

%{

#include "main.h"
#include "parse/t_program.h"

/**
 * Must be included AFTER parse/t_program.h, but I can't remember why anymore
 * because I wrote this a while ago.
 */
#include "thrift.tab.hh"

%}

/**
 * Provides the yylineno global, useful for debugging output
 */
%option lex-compat 	

/** 
 * Helper definitions, comments, constants, and whatnot
 */

intconstant  ([+-]?[0-9]+)
hexconstant  ("0x"[0-9A-Fa-f]+)
dubconstant  ([+-]?[0-9]*(\.[0-9]+)?([eE][+-]?[0-9]+)?)
identifier   ([a-zA-Z_][\.a-zA-Z_0-9]*)
whitespace   ([ \t\r\n]*)
multicomm    ("/*""/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/")
comment      ("//"[^\n]*)
unixcomment  ("#"[^\n]*)
symbol       ([:;\,\{\}\(\)\=<>\[\]])
dliteral      ("\""[^"]*"\"")
sliteral      ("'"[^']*"'")

%%

{whitespace}  { /* do nothing */ }
{multicomm}   { /* do nothing */ }
{comment}     { /* do nothing */ }
{unixcomment} { /* do nothing */ }

{symbol}      { return yytext[0]; }

"namespace"     { return tok_namespace;     }
"cpp_namespace" { return tok_cpp_namespace; }
"cpp_include"   { return tok_cpp_include;   }
"cpp_type"      { return tok_cpp_type;      }
"java_package"  { return tok_java_package;  }
"include"       { return tok_include;       }

"void"          { return tok_void;          }
"bool"          { return tok_bool;          }
"byte"          { return tok_byte;          }
"i16"           { return tok_i16;           }
"i32"           { return tok_i32;           }
"i64"           { return tok_i64;           }
"double"        { return tok_double;        }
"string"        { return tok_string;        }
"map"           { return tok_map;           }
"list"          { return tok_list;          }
"set"           { return tok_set;           }
"async"         { return tok_async;         }
"typedef"       { return tok_typedef;       }
"struct"        { return tok_struct;        }
"exception"     { return tok_xception;      }
"extends"       { return tok_extends;       }
"throws"        { return tok_throws;        }
"service"       { return tok_service;       }
"enum"          { return tok_enum;          }
"const"         { return tok_const;         }

{intconstant} {
  yylval.iconst = atoi(yytext);
  return tok_int_constant;
}

{hexconstant} {
  sscanf(yytext+2, "%x", &yylval.iconst);
  printf("%d\n", yylval.iconst);
  return tok_int_constant;
}

{dubconstant} {
  yylval.dconst = atof(yytext);
  return tok_dub_constant;
}

{identifier} {
  yylval.id = strdup(yytext);
  return tok_identifier;
}

{dliteral} {
  yylval.id = strdup(yytext+1);
  yylval.id[strlen(yylval.id)-1] = '\0';
  return tok_literal;
}

{sliteral} {
  yylval.id = strdup(yytext+1);
  yylval.id[strlen(yylval.id)-1] = '\0';
  return tok_literal;
}

%%
