Hello,
i am trying to develop a GCC frontend using flex and bison as
lexer/parser.
i've read several documentation (the list below and also the
gccint.info)
* https://github.com/rabishah/Mini-C-Compiler-using-Flex-And-Yacc/
* http://www.tldp.org/HOWTO/GCC-Frontend-HOWTO.html
* https://gcc.gnu.org/wiki/WritingANewFrontEnd
* https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00648.html
* https://gcc.gnu.org/wiki/FrontEnd/skeleton
* http://blog.lxgcc.net/wp-content/uploads/2011/03/GCC_frontend.pdf
* http://cobolforgcc.sourceforge.net/cobol_14.html#SEC96
* https://gcc.gnu.org/onlinedocs/gccint/Parsing-pass.html#Parsing-pass
but still having some problems to make it work.
the code is on github:
https://github.com/danielneis/gcc-neis-frontend
the project compiles and generates my compiler "neis1". it is a valid
elf and i can run it with --help and it shows me the help.
when i run it (passing 0 or more arugments), i got:
$ ./gcc/neis1
Execution times (seconds)
phase setup : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01
(100%) wall 55 kB (99%) ggc
TOTAL : 0.00 0.00 0.00
56 kB
Sometimes the "phase setup" does not appears.
It seems that my parse funcion is not called, although i have
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE neis_parse_file
at my neis-lang.c file.
Thanks in advance,
--
Daniel Neis Araujo