→ Semantic rule: .expected_type .actual_type2. Syntax rule: → Semantic rule: .actual_type .actual_typePredicate: .actual_type == . expected_type3. Syntax rule: → + Semantic rule: .actual_type...


1. Syntax rule: <assign> → <var=<expr><br>Semantic rule: <expr> .expected_type <var> .actual_type<br>2. Syntax rule: <expr> → <var><br>Semantic rule: <expr> .actual_type <var> .actual_type<br>Predicate: <expr> .actual_type == <expr>. expected_type<br>3. Syntax rule: <expr> → <var> + <term><br>Semantic rule: <expr> .actual_type <term> .actual_type<br>Predicate: <expr> .actual_type == <expr>. expected_type<br>4. Syntax rule: <term> → <var><br>Semantic rule: <term> .actual_type - <var> .actual_type<br>5. Syntax rule: <term> → <var> [2] + <var> [3]<br>Semantic rule: <term> .actual_type <var> [2] .actual_type<br>Predicate: <var> [2] .actual_type == <var> [3] .actual_type<br>6. Syntax rule: <var> → A|B|C<br>Semantic rule: <var> .actual_type - look-up (<var> .string)<br>Answer the following questions according to the grammatical rules specified.<br>a. Create the parser tree structure for the C = B+C+A sentence.<br>b. Is this a correct sentence according to this grammar?<br>

Extracted text: 1. Syntax rule: → Semantic rule: .expected_type

.actual_type 2. Syntax rule:

Semantic rule: .actual_type

.actual_type Predicate: .actual_type == . expected_type 3. Syntax rule:

+ Semantic rule: .actual_type .actual_type Predicate: .actual_type == . expected_type 4. Syntax rule:

Semantic rule: .actual_type -

.actual_type 5. Syntax rule:

[2] +

[3] Semantic rule: .actual_type

[2] .actual_type Predicate:

[2] .actual_type ==

[3] .actual_type 6. Syntax rule:

→ A|B|C Semantic rule:

.actual_type - look-up (
.string) Answer the following questions according to the grammatical rules specified. a. Create the parser tree structure for the C = B+C+A sentence. b. Is this a correct sentence according to this grammar?















Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here