Looking for COMP3000 Programming Languages test answers and solutions? Browse our comprehensive collection of verified answers for COMP3000 Programming Languages at ilearn.mq.edu.au.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Given the following grammar, which is a string that could be generated?
a -> b | c ;
b -> "matt" d ;
c -> "damian" e ;
d -> "makes me sad" | "broke my skateboard" | "ate my lunch" ;
e -> "is tops" | "is my favourite" ;
Which of the following is a good reason for using the visitor pattern for traversing AST nodes?
When generating the AST classes for our Lox interpreters, what is the purpose of writing a "tool" (e.g., GenerateAst)?
In the following grammar, which symbols are "terminals"
e -> t | f ;
t -> "foo" | "bar" ;
f -> "foo()" | "bar()" ;
Terminals are represented with a quoted string in the metasyntax. Which of the concepts we've seen so far represent terminals in our interpreter?
Which lox expression corresponds to the following tree? .
Which of the following are optimisations a compiler/interpreter might do? Note, there could be more than one correct answer.
Imagine the following diagram of programming language implementation options is sound and complete. We want to create a compiler/interpreter to convert our "source" language into one of out target languages (x86 or ARM).
How many different possible implementations are there? (Hint, this is a COMP2010 question)
Which of these characteristics would make a language implementation certainly a compiler: