Syntax Tree Project Overview
- 21Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
21 questions
- 1The first step in parsing, which breaks plain text into chunks called tokens, is_____analysis.
Hint
This step is about breaking text into meaningful tokens before understanding structure.
Answer
lexical
- 2The definition of how words can fit together to form larger concepts in a language is called_____.
Hint
Just like in English, this defines rules for combining words into phrases and sentences.
Answer
grammar
- 3The Syntax Tree project provides an object layer representing the result of parsing_____.
Hint
This language is the focus of the talk.
Answer
Ruby
- 4In Syntax Tree, nodes are_____by default, meaning they cannot be mutated after creation.
Hint
This property avoids side effects and makes reasoning about changes easier.
Answer
immutable
- 5The visitor pattern in Syntax Tree uses a technique called_____dispatch, where two methods are called to route the visit.
Hint
It involves both the node's accept method and the visitor's visit method.
Answer
double
- 6In the visitor pattern, the generic_____
visitmethod accepts any node and then callson that node.Hint
This method is defined on every node and triggers the visitor callback.
Answer
accept
- 7The Ripper library is a standard Ruby parser that provides an_____-based parser.
Hint
Ripper fires methods as it parses, which you can define to handle tokens.
Answer
event
- 8Ripper does not provide_____information for nodes, which Syntax Tree must track separately.
Hint
This includes things like line numbers and character positions.
Answer
location
- 9Syntax Tree has fewer nodes than Ripper events because it merges some, such as the_____
ifnode for bothA if Band.Hint
Both are conditional expressions with the same meaning.
Answer
if B A
- 10Comments in Ruby do not appear in Ripper's events; Syntax Tree attaches them after parsing using a_____search over child nodes.
Hint
This efficient search method helps find the best node to associate with a comment.
Answer
binary
- 11The prettyprint algorithm, which powers Syntax Tree's formatter, was developed in the early '90s by_____.
Hint
The author's name is mentioned in the context of the Prettier Printer paper.
Answer
Wadler
- 12In prettyprint, a_____is a node that indicates where the output can be broken onto new lines.
Hint
It allows the formatter to decide when to insert a line break.
Answer
breakable
- 13When the line is too long, the formatter breaks the_____group first.
Hint
It starts with the group that encloses the most code.
Answer
outermost
- 14The Syntax Tree CLI's_____
matchcommand outputs a Ruby expression that can be used in aninclause formatching against a node.Hint
This expression exactly matches the source code given.
Answer
pattern
- 15The Syntax Tree CLI's_____
searchcommand uses pattern matching syntax to find nodes, and it can be combined with the output of the `` command.Hint
This command generates the pattern you can then search for.
Answer
match
- 16The Language Server Protocol (LSP) runs a_____RPC server behind an editor to provide language features.
Hint
The protocol uses a common data interchange format.
Answer
JSON
- 17Syntax Tree can translate its nodes into the syntax tree used by RuboCop, which is the_____parser.
Hint
This parser is named after its author's GitHub handle.
Answer
whitequark
- 18The YARV visitor in Syntax Tree compiles nodes into instruction sequence objects that represent_____code.
Hint
YARV is the Ruby VM; its instructions are similar to bytecode in other VMs.
Answer
bytecode
- 19The mutation visitor in Syntax Tree uses the `_____` method to create a new tree after applying changes.
Hint
This method creates a modified copy of the node without mutating the original.
Answer
copy
- 20Kevin Newton is working on a new Ruby parser at Shopify that will be more efficient, error tolerant, and_____.
Hint
The new parser aims to be easier to maintain and use across platforms.
Answer
portable
- 21The Pretty Ruby formatter previously had tens of thousands of lines of code but is now a thin wrapper around_____.
Hint
This is the name of the project presented.
Answer
Syntax Tree

Ask anything
We've read this whole study set, so questions about it get the best answers.