AST : abstract syntax tree (1a) an opening parenthesis, followed by (1b) zero or more list elements, followed by (1c) a
Posted: Sat Nov 27, 2021 2:22 pm
AST : abstract syntax tree
(1a) an opening parenthesis, followed by
(1b) zero or more list elements, followed by
(1c) a closing parenthesis
where a list element is either
(2) a nanoL list (expression), or
(3) an alphanumeric "atom" (i.e., an identifier starting with a
letter)
nanoL ignores whitespace around its tokens (parentheses and
atoms).
1. Using the algebraic data type defined above
(NanoElement, NanoList, and NanoAtom), construct a specific AST
instance for the nanoL expression
( ( hello world ) ( what up ) )
(1a) an opening parenthesis, followed by
(1b) zero or more list elements, followed by
(1c) a closing parenthesis
where a list element is either
(2) a nanoL list (expression), or
(3) an alphanumeric "atom" (i.e., an identifier starting with a
letter)
nanoL ignores whitespace around its tokens (parentheses and
atoms).
1. Using the algebraic data type defined above
(NanoElement, NanoList, and NanoAtom), construct a specific AST
instance for the nanoL expression
( ( hello world ) ( what up ) )