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
This commit is contained in:
Minero Aoki 2009-05-23 14:30:54 +00:00
parent 92ed010477
commit e002c1089a
4 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,10 @@
Sat May 23 22:31:06 2009 Minero Aoki <aamine@loveruby.net>
* 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 <aamine@loveruby.net>
* net/loveruby/cflat/compiler/IRGenerator.java: refactoring:

View File

@ -1,2 +1,5 @@
// stddef.h
const void* NULL = 0;
typedef unsigned long size_t;
typedef long ptrdiff_t;

View File

@ -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

View File

@ -324,7 +324,6 @@ TOKEN: {
| <TYPEDEF : "typedef">
| <IMPORT : "import">
| <SIZEOF : "sizeof">
| <NULL : "NULL">
}
// #@@}
@ -1331,11 +1330,6 @@ ExprNode primary():
{
return new VariableNode(location(t), t.image);
}
| t=<NULL>
{
TypeRef ref = new PointerTypeRef(new VoidTypeRef());
return new IntegerLiteralNode(location(t), ref, 0);
}
| "(" n=expr() ")"
{
return n;