• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

CS 326 Final Exam

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

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

Vista previa del contenido

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

Información del documento

Subido en
10 de agosto de 2025
Número de páginas
7
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$8.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
196
Última venta
-




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes