• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

CS 326 Final Exam

Document preview thumbnail
Preview 2 out of 7 pages

CS 326 Final Exam finite automata: chars go into a lexer to make tokens CFG/PDA: tokens go into parser to make AST these then do other stuff - answersWhat is the lexer parser diagram? Any arbitrary program fed to, lets call an analyzer, can it, with infinite memory and speed, determine if the arbitrary program will stop sometime in the future? - answersWhat is the halting problem? Symmetry in language design. - answersWhat is orthogonality? statically typed and dynamically typed. - answersWhat are the two language "types"? assign - var = expression - answersWhat is Backus-Naur Form? The process of breaking up symbols, typically text, into tokens. - answersWhat is lexing? True - answersT/F. Regular grammars are finite automata. - answersexcercise: derive and parse tree program — begin stmt_list end stmt_list stmt I stmt ; stmt_list stmt —var=expression var—A I B I C expression — var + var | var - var | var - answersexcercise: derive and parse tree

Content preview

CS 326 Final Exam
finite automata: chars go into a lexer to make tokens

CFG/PDA: tokens go into parser to make AST

these then do other stuff - answers✔✔What is the lexer parser diagram?



Any arbitrary program fed to, lets call an analyzer, can it, with infinite memory and speed, determine if
the arbitrary program will stop sometime in the future? - answers✔✔What is the halting problem?



Symmetry in language design. - answers✔✔What is orthogonality?



statically typed and dynamically typed. - answers✔✔What are the two language "types"?



<assign> -> <var> = <expression> - answers✔✔What is Backus-Naur Form?



The process of breaking up symbols, typically text, into tokens. - answers✔✔What is lexing?



True - answers✔✔T/F. Regular grammars are finite automata.



- answers✔✔excercise: derive and parse tree



<program> —> begin <stmt_list> end

<stmt_list> <stmt> I <stmt> ; <stmt_list>

<stmt> —><var>=<expression>

<var>—>A I B I C

<expression> —> <var> + <var> | <var> - <var> | <var>



- answers✔✔excercise: derive and parse tree

, <assign> -> <id> = <expr>

<id> -> A | B | C

<expr> -> <id> + <expr>

| <id> * <expr>

| (<expr>)

| <id>



When one input can produce two different outputs, i.e. parse trees. - answers✔✔What is ambiguity?



No, it is impossible to prove a grammar is not ambiguous, but one can prove a grammar is ambiguous by
finding an example. - answers✔✔Can you prove a grammar is not ambiguous?



LL: left to right, left-most derivation with no look ahead. - answers✔✔Define LL generator



GLR: generalized left-to-right. right-most derivation and handles some ambiguity. - answers✔✔Define
GLR generator



Adaptive LL*: allows some ambiguity in certain parts. Balances flexibility and speed. - answers✔✔Define
Adaptive LL* generator



Allows optional conditionals in grammar writing and recursion.

e -> (+ | -) term | term

T -> T [+ T] - answers✔✔What is EBNF?



e -> e (+ | -) term | term

term -> term (* | /) factor | factor

factor -> factor ^ exponent | id

exponent -> id

Document information

Uploaded on
August 10, 2025
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$8.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
196
Last sold
-




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions