College of Electrical and Mechanical Engineering, Nust Islamabad
College of Electrical and Mechanical Engineering, Nust Islamabad
10
ASSIGNMENT NO.10
1
ASSIGNMENT NO.10
Assignment No.10
Objective:
Task 1
Exploring Xtext Examples_1
Grammar
2
ASSIGNMENT NO.10
3
ASSIGNMENT NO.10
Snapshot of Console
Output Model
4
ASSIGNMENT NO.10
5
ASSIGNMENT NO.10
Snapshot of Console
Output Model
6
ASSIGNMENT NO.10
7
ASSIGNMENT NO.10
8
ASSIGNMENT NO.10
Snapshot of Console
Output Model
9
ASSIGNMENT NO.10
10
ASSIGNMENT NO.10
Snapshot of Console
11
ASSIGNMENT NO.10
Output Model
Task 2
Exploring Xbase Tutorial Example
12
ASSIGNMENT NO.10
Answer: List
Question: ((String)obj) in Java is written as __________in Xbase.
a. (obj in String)
b. (obj as String)
c. (obj for String)
d. None
Answer: (obj as String)
Question: A closures is an _________ function can access variables from the outer lexical scope.
a. Typed
b. Anonymous
c. Static
d. Non- anonymous
Answer: anonymous
Question: The if expression in Xbase and Java is ________.
a. different
b. exactly same
Answer: exactly same
Question: In Xbase Loops constructs are expressions not statements.
a. True
b. False
Answer: True
Question: Xbase has no support for exception handling?
a. True
b. False
Answer: False
Question: The Xbase switch expression is and _____than the switch statement in Java.
a. weak
b. powerful
13
ASSIGNMENT NO.10
c. elaborated
d. easy to write
Answer: powerful
Question: Xbase doesn’t support Java's primitives and also the autoboxing introduced with Java.
a. True
b. False
Answer: False
Task 3
Xtend Introductory Example
Question: Xtend string literals work without single or double quotes like following code
segment?
a. True
b. False
Answer: False
14