Parsing
Parsing:
Converting an
(SQL) query into
a query parse tree
Structure of the SQL query parser
We will discuss the
details of
the SQL language parser in
this webpage
(SQL pre-proprecessor will be discussed
in next webpage)
Terminology:
parser and
parse tree
Terminology:
parser and
parse tree
Example of a
parse tree
(annotated with atoms and
syntactic categories)
Atoms (a.ka.: terminals in compilers)
Examples:
Keywords:
SELECT,
FROM, ...
Identifiers:
employee,
address, ...
Constants:
3.14,
"John", ...
Operators:
+,
>=, ...
Separators:
(,
;, ...
Syntactic Categories
(a.ka.: non-terminals in compilers)
Examples:
<QUERY>,
<Arithmetic-Expression>,
<Boolean-Expression>,...
Structure of a Parse Tree
Structure of a Parse Tree
Structure of a Parse Tree
❮
❯