Computer Science, asked by nagarajknaik831, 1 year ago

Difference between lexical phase error with syntactic phase error

Answers

Answered by danielochich
0
Lexical phase error happen if no prefix of the input string forms a valid token, when this happens the the lexer will usually sends or report an error.
At this point, it may stop reading the input or it may attempt continued lexical analysis by skipping characters until a valid prefix is found.
The purpose of this latter approach is try finding other lexical errors in the same input, so several of these can be corrected by the user before re- running the lexer.
Syntax error occurs during the parsing of input code, and are caused by grammatically incorrect statements.
Typing error might be an illegal character in the input, a missing operation or two operations in a raw.

Answered by Anonymous
0

Explanation:

Lexical errors are those illegal string, unmatched symbols, length of the boundaries are exceeding. syntax errors are those missing operand, missing left parenthesis, missing right parenthesis etc.

Similar questions