Name of files and functions etc.

2005-03-29 Thread David Pettersson
Hi!
This message primerely concernce java but I think the question is of 
general interest so I post it here and hope that this is OK.

I jumped on one of the newbe gcc hackers quests described at 
http://gcc.gnu.org/projects/#beginner_gcc_hackers .
More precisely I started to clean up the long actions in 
gcc/java/parse.y. Happy that the thing still compiled after my
first attack, I decided to be a little more serious. My problems:

Currently I have placed the factor out functions in a files named 
parse_factor.c (and .h). I feel this is a somewhat bad name,
is there any rule for file naming in use at gcc.

The functions that replaces the actions I call the same as the actions 
left hand side nonterminal with a _ and a number
added, thus the two rules for array_type in parse.y looks like this 
after the change:
array_type:
   primitive_type dims
   {
 $$ = array_type_1(ctxp,($1));
   }
|   name dims
   {
 $$ = array_type_2(ctxp,($1));
   }
;
Is this good (at least it is easy to find the place they are used even 
if the names aren't any "implicit comments" on the code).

Regards
David


Re: Name of files and functions etc.

2005-03-29 Thread David Pettersson
Thanks for all the answers!
Usually the hardest part of programming is finding the right names for 
things,
but good names cant be replaced by any amount of documentation.

By the way, how much changes should a patch contain in this case? As I 
understand the guidlines
there should be one significant change per patch. Does this mean that 
cleaning the parse.y is
one patch or that moving out all actions in parse.y that use 
pop_current_osb is one patch (my first goal)?

Is there any use doing this or are gcjx going to rule the world from 
tomorrow?

David