2 Copyright (C) 2007-2008, Parrot Foundation.
7 src/main.c - the Entry Point to Parrot Programs
23 #include "parrot/parrot.h"
24 #include "parrot/embed.h"
25 #include "parrot/imcc.h"
29 =item C<int main(int argc, char * argv[])>
31 The entry point from the command line into Parrot.
38 main(int argc
, char * argv
[])
40 const char *sourcefile
;
44 /* internationalization setup */
45 /* setlocale(LC_ALL, ""); */
46 PARROT_BINDTEXTDOMAIN(PACKAGE
, LOCALEDIR
);
47 PARROT_TEXTDOMAIN(PACKAGE
);
49 Parrot_set_config_hash();
51 interp
= Parrot_new(NULL
);
52 imcc_initialize(interp
);
54 /* We parse the arguments, but first store away the name of the Parrot
55 executable, since parsing destroys that and we want to make it
57 Parrot_set_executable_name(interp
, Parrot_str_new(interp
, argv
[0], 0));
59 sourcefile
= parseflags(interp
, &argc
, &argv
);
60 status
= imcc_run(interp
, sourcefile
, argc
, argv
);
63 /* Clean-up after ourselves */
64 Parrot_destroy(interp
);
65 Parrot_exit(interp
, 0);
74 F<compilers/imcc/main.c>, unfortunately.
82 * c-file-style: "parrot"
84 * vim: expandtab shiftwidth=4: