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);
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);
%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
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 { ; }