scc

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

commit c821608f58c35cdcd45433f0173ab1ad84ba8093
parent 026e7301f8e481ff1702f0287d577981801889e6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 25 Aug 2012 18:09:20 +0200

Changed name of parsing functions for statement

These functions had a do_* name in order to avoid reserver words (for
example while, for, goto ...), but names were a bit ugly (do_do for example
...), so best solution is using a _ solution.

Diffstat:
Mflow.c | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/flow.c b/flow.c @@ -8,7 +8,7 @@ static struct node *stmt(void); static struct node * -do_goto(void) +_goto(void) { expect(GOTO); expect(IDEN); @@ -16,7 +16,7 @@ do_goto(void) } static struct node * -do_while(void) +_while(void) { register struct node *cond; @@ -28,7 +28,7 @@ do_while(void) } static struct node * -do_do(void) +_do(void) { register struct node *cond, *body; @@ -44,7 +44,7 @@ do_do(void) } static struct node * -do_for(void) +_for(void) { register struct node *exp1, *exp2, *exp3; @@ -61,7 +61,7 @@ do_for(void) } static struct node * -do_if(void) +_if(void) { register struct node *cond, *body; @@ -75,7 +75,7 @@ do_if(void) } static struct node * -do_switch(void) +_switch(void) { register struct node *cond; @@ -93,15 +93,15 @@ stmt(void) switch (yytoken) { case '{': return compound(); - case SWITCH: return do_switch(); - case IF: return do_if(); - case FOR: return do_for(); - case DO: return do_do(); - case WHILE: return do_while(); + case SWITCH: return _switch(); + case IF: return _if(); + case FOR: return _for(); + case DO: return _do(); + case WHILE: return _while(); case CONTINUE: case BREAK: case RETURN: - case GOTO: return do_goto(); + case GOTO: return _goto(); case CASE: /* TODO */ case DEFAULT: /* TODO */ case IDEN: /* TODO: check if it can be a label */;