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.

need to deal with. Students learned <strong>in</strong> a one-month course how to adjust a def<strong>in</strong>ed problem to<br />

available skills, discover workarounds while progress<strong>in</strong>g to a solution, and work <strong>in</strong> teams to meet<br />

deadl<strong>in</strong>es. APDT supported by virtualization allowed the students to th<strong>in</strong>k outside the box and<br />

experiment with multiple options <strong>in</strong>stead <strong>of</strong> follow<strong>in</strong>g a traditional approach to a s<strong>in</strong>gle solution<br />

(Romney, 2009).<br />

Use Case Problem Def<strong>in</strong>ition<br />

The use case was a project that <strong>in</strong>volved complet<strong>in</strong>g the development <strong>of</strong> an <strong>in</strong>terpreter for a<br />

simple calculator language. The students used problem-driven techniques to learn the concepts <strong>of</strong><br />

programm<strong>in</strong>g language grammars, scanners, parsers and Abstract Syntax Trees (AST). An AST<br />

is an <strong>in</strong>termediate form that is passed from the front end to the back end <strong>in</strong> the process <strong>of</strong><br />

language semantic analysis. A parser builds an AST by remov<strong>in</strong>g irrelevant nodes from the tree's<br />

<strong>in</strong>terior (Scott, 2006). An AST is also known as an Annotated Syntax Tree because the<br />

rema<strong>in</strong><strong>in</strong>g nodes are then annotated by the parser with useful <strong>in</strong>formation, called node attributes.<br />

In our case, the language and the implementation road map were partially provided for the<br />

students from Lee (2008). Figure 2 shows the LL(1) calculator language grammar that was used<br />

for implement<strong>in</strong>g the project.<br />

Figure 2. LL(1) Calculator Language Grammar Used <strong>in</strong> the Use Case Project<br />

An LL(1) grammar is one that can be parsed by predictive parsers that need to look only<br />

one symbol ahead <strong>in</strong> the <strong>in</strong>put stream to determ<strong>in</strong>e the next pars<strong>in</strong>g action decisions. Predictive<br />

parsers are recursive-decent parsers that need no backtrack<strong>in</strong>g. LL(1) stands for Left-to-right<br />

Left-most derivation with one <strong>in</strong>put symbol look-ahead (Aho, Lam, Sethi, & Ullman, 2007). The<br />

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

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

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

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

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

Figure 3<br />

The Calculator Language Interpreter Involves Different Concepts That The Students Learned Through<br />

Agile Problem Driven Teach<strong>in</strong>g In One Month with Ruby<br />

67

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

Saved successfully!

Ooh no, something went wrong!