How can we use the mapping for a given expression E and a st

How can we use the mapping for a given expression E and a state s by using denotational semantics to solve some programming problems? please answer in typed text as it was hard for me to read before from a hand written answers. Thank you

Solution

Let\'s take an example grammer to represent an arithmetic expression which contains + and * operators.

<exp>::=<exp>+<exp>

|<exp>*<exp>

|<id>

<id>::=a|b|c

Let\'s take an expression a*b+c

To check whether the expression is syntactically correct or not, we have to start derivation from start symbol.

<exp>-> exp+exp

->exp*exp+exp

-> id*id+I\'d

->a*b+c

From the start symbol if we can derive expression then it is syntactically correct.

How can we use the mapping for a given expression E and a state s by using denotational semantics to solve some programming problems? please answer in typed tex

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site