15.01.2015 Views

Journal of Research in Innovative Teaching - National University

Journal of Research in Innovative Teaching - National University

Journal of Research in Innovative Teaching - National University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The problem <strong>in</strong>volves deal<strong>in</strong>g with operator precedence. Accord<strong>in</strong>g to the calculator<br />

language grammar, the highest precedence is for parenthesis. Parentheses appear <strong>in</strong> the last<br />

production <strong>of</strong> the grammar, as shown <strong>in</strong> Figure 2. The recall operation, denoted by the letter R, is<br />

<strong>of</strong> the same high precedence. It makes sense to start by replac<strong>in</strong>g an R with its value from the<br />

calculator memory before we evaluate other parts <strong>of</strong> the expression. However, an R operator can<br />

only appear after we use an S operator, or a store operator. The S operator stores the value <strong>of</strong> the<br />

token that is to the left <strong>of</strong> it <strong>in</strong>to the calculator memory. When an S operator is used <strong>in</strong> an<br />

expression, we can use an R operator somewhere after it. As one would expect, the grammar is<br />

set as to have multiplication and division with higher precedence than addition and subtraction.<br />

S<strong>in</strong>ce the calculator grammar is an LL(1) grammar, associativity <strong>of</strong> operators goes from left to<br />

right.<br />

The Solution<br />

To implement the simple calculator language <strong>in</strong>terpreter, students had to learn important<br />

programm<strong>in</strong>g language concepts. The project <strong>in</strong>volved the implementation <strong>of</strong> a scanner, a parser,<br />

and an abstract syntax tree. The students had to deliver the project <strong>in</strong> three weeks. With such a<br />

time constra<strong>in</strong>t, APDT proved to be a practical major success. Students were able to learn the<br />

course objectives and deliver the project deliverables on-time. They learned to use Agile Project<br />

Management techniques that made them adjust quickly and dynamically accord<strong>in</strong>g to project<br />

progress and time frames. The skills learned and used throughout the use case are skills that<br />

every IT pr<strong>of</strong>essional needs to master <strong>in</strong> today's accelerated Internet-time workplace (Romney,<br />

2009). The students do not learn the course subject alone, but the best practices and techniques<br />

used <strong>in</strong> the <strong>in</strong>dustry. Us<strong>in</strong>g cutt<strong>in</strong>g-edge technologies, such as virtualization, and the latest<br />

teach<strong>in</strong>g methodologies, such as APDT, allows for efficient resource management that results <strong>in</strong><br />

<strong>in</strong>creased productivity <strong>in</strong> less time.<br />

Redef<strong>in</strong><strong>in</strong>g the Problem<br />

The APDT nature <strong>of</strong> the use case allowed the students to redef<strong>in</strong>e the problem <strong>in</strong> hand. The<br />

problem was redef<strong>in</strong>ed from “implement<strong>in</strong>g a calculator language <strong>in</strong>terpreter” to “implement<strong>in</strong>g<br />

a scanner, and a parser with an abstract syntax tree that would work together to evaluate an<br />

expression accord<strong>in</strong>g to the calculator language grammar.” This redef<strong>in</strong>ition identified three<br />

major milestones that can be used to break the problem <strong>in</strong>to three subprojects. A smaller problem<br />

is easier to handle and can, <strong>in</strong> turn, be subdivided without affect<strong>in</strong>g the other subprojects.<br />

Another key concept students learned and dealt with was the <strong>in</strong>tegration <strong>of</strong> the solution for each<br />

subproject to achieve a viable solution to the ma<strong>in</strong> problem at hand. All <strong>of</strong> these are critical<br />

project management concepts essential <strong>in</strong> the workplace.<br />

The LL(1) grammar was used to build a parser that returns an AST for the parsed<br />

expression. The AST was used to evaluate the parsed expression. The overall data flow <strong>of</strong> the<br />

calculator <strong>in</strong>terpreter is shown <strong>in</strong> Figure 3. An expression goes through the scanner that does the<br />

lexical analysis. The scanner returns tokens to the parser. The parser uses the tokens to create an<br />

AST. The AST is then traversed to get the value <strong>of</strong> the expression (Lee, 2008).<br />

Putt<strong>in</strong>g the Pieces Together<br />

Build<strong>in</strong>g and <strong>in</strong>tegrat<strong>in</strong>g the use case project was simplified by us<strong>in</strong>g the virtual labs. Students<br />

were able to have isolated development environments for each sub-project that ensured<br />

modification to one would not affect the others. The virtual labs allowed the students to<br />

68

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!