scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit bc40f94fdda9ad39a8cc71a9b5a4c80eebe210a8
parent 712fa062baee56baf1c9e7c33c46937bb95064a0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 29 Jun 2012 10:42:12 +0200

Renamed -> token from PTR to INDIR

There was a name conflict with the type operator PTR, and PTR was not a good
name for this token, because could be misunderstand with * operator.

Diffstat:
Mexpr.c | 8++++----
Mlex.c | 2+-
Mtokens.h | 2+-
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/expr.c b/expr.c @@ -62,10 +62,10 @@ static void postfix(void) expect(')'); gen_call(); continue; - case '.': fp = gen_field; goto expect_iden; - case PTR: fp = gen_ptr; goto expect_iden; - case INC: fp = gen_postinc; goto next; - case DEC: fp = gen_postdec; goto next; + case '.': fp = gen_field; goto expect_iden; + case INDIR: fp = gen_ptr; goto expect_iden; + case INC: fp = gen_postinc; goto next; + case DEC: fp = gen_postdec; goto next; default: fputs("leaving static void postfix(void)", stderr); return; diff --git a/lex.c b/lex.c @@ -120,7 +120,7 @@ static unsigned char minus(void) switch (c = getc(yyin)) { case '-': return DEC; - case '>': return PTR; + case '>': return INDIR; case '=': return SUB_EQ; default: ungetc(c, yyin); diff --git a/tokens.h b/tokens.h @@ -18,7 +18,7 @@ enum tokens { UNSIGNED, SIGNED, /* other tokens */ IDEN = 128, CONSTANT, SIZEOF, - PTR, INC, DEC, SHL, SHR, + INDIR, INC, DEC, SHL, SHR, LE, GE, EQ, NE, AND, OR, MUL_EQ, DIV_EQ, MOD_EQ, ADD_EQ, SUB_EQ, AND_EQ, XOR_EQ, OR_EQ, SHL_EQ, SHR_EQ,