Syntactic or Lexical Error in writing an interpret

42 views Asked by At

For a school project I have to write an interpret in C for programming languge similar to Swift. I'm encountering an issue in my code, and I'm not sure if it's a syntactic or lexical error. In the following line of code: result = a -/ b And how should I recognize what is lexical and what syntax Error. Because I dont know if -/ is an invalid token and it is lexical error or after minus there should be divide so it is syntax error.

Same for example in code: if (result ==> ) it is a syntax error because after == there shouldnt be symbol > or it is lexical because ==> is not valid token

0

There are 0 answers