Theme Editor: Put together a simple GUI to test going back and forth between a tree...
[kugel-rb.git] / apps / plugins / lua / action_helper.pl
blobeb66c2b01e99f76fe5dd769a18d09f13a128ddb7
1 #!/usr/bin/env perl
2 ############################################################################
3 # __________ __ ___.
4 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 # \/ \/ \/ \/ \/
9 # $Id$
11 # Copyright (C) 2009 by Maurus Cuelenaere
13 # All files in this archive are subject to the GNU General Public License.
14 # See the file COPYING in the source tree root for full license agreement.
16 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 # KIND, either express or implied.
19 ############################################################################
21 $i = 0;
22 $j = 0;
23 while(my $line = <STDIN>)
25 chomp($line);
26 if($line =~ /^\s*(ACTION_[^\s]+)(\s*=.*)?,\s*$/)
28 $actions[$i] = sprintf("\t%s = %d,\n", $1, $i);
29 $i++;
31 elsif($line =~ /^\s*(CONTEXT_[^\s]+)(\s*=.*)?,\s*$/)
33 $contexts[$j] = sprintf("\t%s = %d,\n", $1, $j);
34 $j++;
38 print "-- Don't change this file!\n";
39 printf "-- It is automatically generated of action.h %s\n", '$Revision$';
41 print "rb.actions = {\n";
42 foreach $action(@actions)
44 print $action;
46 print "}\n";
48 print "rb.contexts = {\n";
49 foreach $context(@contexts)
51 print $context;
53 print "}\n";