From e002c1089af3153da41026d8328c2e2595ee3a44 Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Sat, 23 May 2009 14:30:54 +0000 Subject: [PATCH] r4884@macbookpro: aamine | 2009-05-23 22:30:20 +0900 * net/loveruby/cflat/parser/Parser.jj: now NULL is not a reserved word. * import/stddef.hb: define const NULL. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4231 1b9489fe-b721-0410-924e-b54b9192deb8 --- ChangeLog | 7 +++++++ import/stddef.hb | 3 +++ import/stdio.hb | 2 +- net/loveruby/cflat/parser/Parser.jj | 6 ------ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98cc2c1..b02a142 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat May 23 22:31:06 2009 Minero Aoki + + * net/loveruby/cflat/parser/Parser.jj: now NULL is not a reserved + word. + + * import/stddef.hb: define const NULL. + Sat May 23 22:22:11 2009 Minero Aoki * net/loveruby/cflat/compiler/IRGenerator.java: refactoring: diff --git a/import/stddef.hb b/import/stddef.hb index fa0bd0d..4ae9a71 100644 --- a/import/stddef.hb +++ b/import/stddef.hb @@ -1,2 +1,5 @@ // stddef.h + +const void* NULL = 0; typedef unsigned long size_t; +typedef long ptrdiff_t; diff --git a/import/stdio.hb b/import/stdio.hb index f4e3681..fd0246b 100644 --- a/import/stdio.hb +++ b/import/stdio.hb @@ -1,7 +1,7 @@ // #@@range/head{ // stdio.hb -import stddef; // for size_t +import stddef; // for NULL and size_t import stdarg; typedef unsigned long FILE; // dummy diff --git a/net/loveruby/cflat/parser/Parser.jj b/net/loveruby/cflat/parser/Parser.jj index 9b5b1c2..5b27446 100644 --- a/net/loveruby/cflat/parser/Parser.jj +++ b/net/loveruby/cflat/parser/Parser.jj @@ -324,7 +324,6 @@ TOKEN: { | | | - | } // #@@} @@ -1331,11 +1330,6 @@ ExprNode primary(): { return new VariableNode(location(t), t.image); } - | t= - { - TypeRef ref = new PointerTypeRef(new VoidTypeRef()); - return new IntegerLiteralNode(location(t), ref, 0); - } | "(" n=expr() ")" { return n;