Lexical analyzer groups a sequence of characters into tokens. Syntax analyzer checks if these tokens adhere to a grammar syntax.