Frage | Antworten |
Syntax | The form of its expressions, statements, and program units |
Semantics | The meaning of the expressions, statements, and program units |
Sentences | The strings of a language. Ex. English: a string of characters form a word, and a string of words form a sentence. |
Lexemes | The lowest-level syntactic units such as its numeric literals, operators, and special words. |
Identifiers | A group of lexemes |
Token | The category of a group of lexemes |
Metalanguage | A language that is used to describe another language. |
Backus-Naur Form (BNF) | A metalanguage for programming languages. It is used to describe the syntax of programming languages. |
Nonterminal (Symbols) | Can have two or more distinct definitions, representing two or more possible syntactic forms in language. |
Terminal (Symbols) | The lexemes or tokens of the rules |
Grammar | A finite nonempty collection of rules |
Recursion | When a function calls upon itself. A rule is recursive if its LHS appears in its RHS. Ex. <ident_list> → identifier | identifier, <ident_list> <ident_list> appears on both sides. |
Start Symbol | A special nonterminal that begins the grammar. Ex. <program> |
Derivation | A repeated application of rules, starting with the start symbol and ending with a sentence (all terminal symbols). |
Ambiguous | A grammar is ambiguous if and only if it generates a sentential form that has two or more distinct parse trees. |
Möchten Sie mit GoConqr kostenlos Ihre eigenen Karteikarten erstellen? Mehr erfahren.