During the past years, when adding new features, especially those of C23 I felt that the current parser might not be suitable to fully handle the whole range of C90 to C23. At first I thought we'd need separate parsers (C90-C17 vs C23), but now I think that a new parser that can handle them all should be possible.
I know of a project to create such a parser (AFAIK based on the Jutta Degener grammar from 2012, which is based on the Jeff Lee grammar from 1985). The license situation of that one is unclear though; if it gets resolved soon, we might be able to use parts of it.
This would also fix the function prototype issue [bugs:#2664].
Diff:
Hope it will be not single pass one.
Why do you hope for it to not be single pass?
It will most likely be a lex / yacc parser again.
A bit offtopic. I talk about compiler, not parser.
https://sourceforge.net/p/sdcc/bugs/2962/#53ab
Yes. Lexer and parser will be single pass anyway. In the long term, however we will want to do a the lexing and parsing pass, and then a second iCode pass. Not sure yet if the AST stuff should be part of the former or latter.
Work has started. I think I'll do a new lexer first. For now I think, the old parser can mostly stay the way it is, while the work on the lexer is done. Maybe the new lexer can even be merged to trunk before the new parser is ready.
In [r13508] I merged the current work into trunk. So far this is just an improved lexer, which fixes a few bugs, and improves error messages when encountering unsupported features, such as complex numbers and decimal floating point.
Related
Commit: [r13508]