yntax 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: ®
Soru 3.
1. Syntax rule: <assign> ® <var> = <expr>
Semantic rule: <expr>.expected_type ¬ <var>.actual_type
2. Syntax rule: <expr> ® <var>
Semantic rule: <expr>.actual_type ¬ <var>.actual_type
Predicate: <expr>.actual_type == <expr>. expected_type
3. Syntax rule: <expr> ® <var> + <term>
Semantic rule: <expr>.actual_type ¬ <term>.actual_type
Predicate: <expr>.actual_type == <expr>. expected_type
4. Syntax rule: <term> ® <var>
Semantic rule: <term>.actual_type ¬ <var>.actual_type
5. Syntax rule: <term> ® <var>[2] + <var>[3]
Semantic rule: <term>.actual_type ¬ <var>[2].actual_type
Predicate: <var>[2].actual_type == <var>[3].actual_type
6. Syntax rule: <var> ®A|B|C
Semantic rule: <var>.actual_type ¬ look-up(<var>.string)
Belirtilen gramer kurallarına göre aşağıdaki soruları cevaplayınız.
a. C = B + C + A cümlesi için parser tree yapısını oluşturun.
b. Bu gramere göre bu doğru bir cümle midir?
Step by step
Solved in 2 steps with 1 images