The semantic analysis phase is generally more complex and written by hand, but can be partially or fully automated using attribute grammar.