relationship and difference between Semantics and syntax with real life and programming example in terms of compiler Construction
im have problem with real life examples
i dont what type of an example should i quote here
I'm not great at this, but I hate to see you get nothing. Syntax is the proper construction of a "sentence". AFAIK, semantic is the meaning of the "sentence". I quote sentence because for the most part compilers are parsing code. For instance: int functionName( int argumentOne ) Has a return type. Has a name. Has the type and name for an argument in parenthesis. Is syntactically correct. In C and C derived languages, this means (semantically) that we're defining a function that takes an integer as an argument and returns an integer. Googling "semantic definition" was very simple and gave me a definition of semantic right at the top.
Join our real-time social learning platform and learn together with your friends!