change some LAYER_GUI to LAYER_HUD, update tinygettext, fix a warning in miniswig
[supertux.git] / tools / miniswig / parser.yy
index 461c9f8..e609476 100644 (file)
@@ -1,4 +1,5 @@
 %{
+#include <config.h>
 
 #include <iostream>
 #include <sstream>
@@ -34,12 +35,13 @@ static Class* current_class = 0;
 static Function* current_function = 0;
 static Type* current_type = 0;
 static Field* current_field = 0;
-static ClassMember::Visbility current_visibility;
+static ClassMember::Visibility current_visibility;
 
 class ParseError : public std::exception
 {
 public:
-    ParseError(const std::string& message) throw()
+    ParseError(const std::string& message) throw() :
+         message()
     {
         std::ostringstream msg;
         msg << "Parse error in '" << current_file
@@ -70,6 +72,7 @@ private:
 %token T_STRUCT
 %token T_STATIC
 %token T_SUSPEND
+%token T_CUSTOM
 %token T_CONST
 %token T_UNSIGNED
 %token T_SIGNED
@@ -77,9 +80,7 @@ private:
 %token T_BOOL
 %token T_CHAR
 %token T_SHORT
-%token T_INT
 %token T_LONG
-%token T_FLOAT
 %token T_DOUBLE
 %token T_PUBLIC
 %token T_PROTECTED
@@ -308,6 +309,11 @@ function_declaration:
 function_attributes:
     /* empty */
     | T_CONST function_attributes
+    | T_CUSTOM '(' T_STRING ')' function_attributes
+      {
+        current_function->parameter_spec = $3;
+        current_function->custom = true;
+      }
     | T_SUSPEND function_attributes
       {
         current_function->suspend = true;
@@ -436,6 +442,7 @@ namespace_refs:
 
 %%
 
+__attribute__((noreturn))
 void yyerror(const char* error)
 {
     throw ParseError(error);