I just have to build myself some parsers for different computer languages. I thought about using ANTLR but what I really want is to explore this myself because I dislike the idea of generated code (yeah silly I know).
The question is how are compile errors (missing identifiers, wrong token for a certain rule etc.) are handled and represented within ASTs etc.
What I know from compiler lectures is that a parser usually tries to throw away token or try to find the next matching code element (like missing a ';' and so taking the ';' of the next expression).
But then how is this expressed within the AST. Is there some malformed expression object/type? I am a bit puzzled.
I do not want to just reject a certain input but handle it.