]> git.draconx.ca Git - gob-dx.git/blobdiff - src/parse.y
Release 2.0.18
[gob-dx.git] / src / parse.y
index b8792bbfa387600d088de35dde8d15d22a0c72b9..5c8cc98a74d6679da35d49f59083c0814528810c 100644 (file)
@@ -92,9 +92,10 @@ yyerror(char *str)
        char *out=NULL;
        char *p;
        
-       if(strcmp(yytext,"\n")==0) {
-               out=g_strconcat("Error: ",str," before newline",NULL);
-       } else if(yytext[0]=='\0') {
+       if (strcmp (yytext, "\n") == 0 ||
+           strcmp (yytext, "\r") == 0) {
+               out = g_strconcat ("Error: ", str, " before end of line", NULL);
+       } else if (yytext[0] == '\0') {
                out=g_strconcat("Error: ", str, " at end of input", NULL);
        } else {
                char *tmp = g_strdup(yytext);
@@ -156,7 +157,11 @@ push_function (int scope, int method, char *oid, char *id,
 
        g_assert(scope != CLASS_SCOPE);
        
-       if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
+       if(method == INIT_METHOD ||
+          method == CLASS_INIT_METHOD ||
+          method == CONSTRUCTOR_METHOD ||
+          method == DISPOSE_METHOD ||
+          method == FINALIZE_METHOD) {
                type = (Type *)node_new (TYPE_NODE,
                                         "name", "void",
                                         NULL);
@@ -688,7 +693,7 @@ ensure_property (void)
 %token SIGNED UNSIGNED LONG SHORT INT FLOAT DOUBLE CHAR
 
 %token <id> TOKEN NUMBER TYPETOKEN ARRAY_DIM SINGLE_CHAR
-%token <cbuf> CCODE ADCODE HTCODE PHCODE HCODE ACODE ATCODE STRING
+%token <cbuf> CCODE CTCODE ADCODE HTCODE PHCODE HCODE ACODE ATCODE STRING
 %token <line> PUBLIC PRIVATE PROTECTED CLASSWIDE PROPERTY ARGUMENT
 %token <line> VIRTUAL SIGNAL OVERRIDE
 %token <line> NICK BLURB MAXIMUM MINIMUM DEFAULT_VALUE ERROR FLAGS TYPE
@@ -765,6 +770,15 @@ ccode:             CCODE                   {
                        nodes = g_list_append(nodes,node);
                        g_string_free($<cbuf>1,FALSE);
                                        }
+       |       CTCODE                  {
+                       Node *node = node_new (CCODE_NODE,
+                                              "cctype", CT_CCODE,
+                                              "cbuf:steal", ($<cbuf>1)->str,
+                                              "line_no", ccode_line,
+                                              NULL);
+                       nodes = g_list_append(nodes,node);
+                       g_string_free($<cbuf>1,FALSE);
+                                       }
        ;
 
 ccodes:                ccodes ccode            { ; }