0% found this document useful (0 votes)
36 views

College of Electrical and Mechanical Engineering, Nust Islamabad

This document provides an overview of Assignment No. 10 which explores Xtext, Xbase, and Xtend. It includes examples of Xtext grammars and generated languages. It also covers tutorials and examples for Xbase and Xtend, testing knowledge with multiple choice questions.

Uploaded by

Mukhtar Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

College of Electrical and Mechanical Engineering, Nust Islamabad

This document provides an overview of Assignment No. 10 which explores Xtext, Xbase, and Xtend. It includes examples of Xtext grammars and generated languages. It also covers tutorials and examples for Xbase and Xtend, testing knowledge with multiple choice questions.

Uploaded by

Mukhtar Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

ASSIGNMENT NO.

10

COLLEGE OF ELECTRICAL AND MECHANICAL


ENGINEERING, NUST ISLAMABAD

ASSIGNMENT NO.10

1
ASSIGNMENT NO.10

Assignment No.10
Objective:

In this assignment, we are going to explore Xtext, Xbase and Xtend .

Task 1
Exploring Xtext Examples_1
Grammar

The language output from the Grammar

2
ASSIGNMENT NO.10

Xtend mapping code

Xtend mapping code

3
ASSIGNMENT NO.10

Snapshot of Console

Output Model

4
ASSIGNMENT NO.10

Xtext Home Automation Example_2


Grammar

The language output from the Grammar

Xtend mapping code

5
ASSIGNMENT NO.10

Snapshot of Console

Output Model

6
ASSIGNMENT NO.10

Xtext Simple Arithmetic Example_3


Grammar

The language output from the Grammar

7
ASSIGNMENT NO.10

Xtend mapping code

8
ASSIGNMENT NO.10

Snapshot of Console

Output Model

Xtext State-Machine Example_4


Grammar

9
ASSIGNMENT NO.10

The language output from the Grammar

10
ASSIGNMENT NO.10

Xtend mapping code

Snapshot of Console

11
ASSIGNMENT NO.10

Output Model

Task 2
Exploring Xbase Tutorial Example

Question: _______are notations for representing fixed values.


a. Data type
b. Integer
c. Constants
d. Literals
Answer: Literals
Question:_____ features can be accessed using :: .
a. Static
b. Dynamic
c. Fixed
d. Column
Answer: Static
Question: A block expression is just a ____ of expressions which are all executed.
a. Array
b. Unit
c. List
d. Value

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

Xtend Active Annotation Example


Question: Getter method in Xtend fires change events?
a. True
b. False
Answer: True

Xtend Solutions from Euler


Question: Xtend uses extract keyword for importing files in current file?
a. True
b. False
Answer: False

14

You might also like