ast2firm: Implement casting from complex to real types.
[cparser] / token.c
diff --git a/token.c b/token.c
index 50de656..f278a6f 100644 (file)
--- a/token.c
+++ b/token.c
@@ -1,21 +1,6 @@
 /*
  * This file is part of cparser.
- * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
  */
 #include <config.h>
 
@@ -24,6 +9,7 @@
 
 #include <assert.h>
 #include <stdio.h>
+#include <stdbool.h>
 
 #include "symbol.h"
 #include "lang_features.h"
@@ -33,7 +19,7 @@
 
 symbol_t *token_symbols[T_LAST_TOKEN];
 
-const source_position_t builtin_source_position = { "<built-in>", 0, 0, true };
+const position_t builtin_position = { "<built-in>", 0, 0, true };
 
 static token_kind_t last_id;
 
@@ -67,6 +53,11 @@ static void register_pp_token(pp_token_kind_t const id, char const *const string
 
 void init_tokens(void)
 {
+       static bool tokens_initialized = false;
+       if (tokens_initialized)
+               return;
+       tokens_initialized = true;
+
        memset(token_symbols, 0, T_LAST_TOKEN * sizeof(token_symbols[0]));
 
 #define T(mode,x,str,val)  register_token(mode, x, str);