|
10 | 10 | * An LL(1) parser (Left-to-right, Leftmost derivation, 1 token-lookahead) is a |
11 | 11 | top-down parser for a subset of context-free languages. It parses the input |
12 | 12 | from Left to right, performing Leftmost derivation of the sentence, and can |
13 | | - only use 1 tokens of lookahead when parsing a sentence. |
| 13 | + only use 1 token of lookahead when parsing a sentence. |
14 | 14 |
|
15 | 15 | * A parsing table is a collection of data that a generic implementation of the |
16 | 16 | LL(1) parser consumes to know how to parse a given context-free grammar. In |
17 | | - this case the collection of thata involves Deterministic Finite Automatons, |
| 17 | + this case the collection of data involves Deterministic Finite Automatons, |
18 | 18 | calculated first sets, keywords and transition labels. |
19 | 19 |
|
20 | 20 | * A grammar is defined by production rules (or just 'productions') that specify |
|
26 | 26 |
|
27 | 27 | rule_name: rule_description; |
28 | 28 |
|
29 | | - meaning the rule 'a: b' specifies that a can be replaced by b. A Context-free |
30 | | - grammars is a grammars in which the left-hand side of each production rule |
31 | | - consists of only a single nonterminal symbol. Context free grammars can |
| 29 | + meaning the rule 'a: b' specifies that a can be replaced by b. A context-free |
| 30 | + grammar is a grammar in which the left-hand side of each production rule |
| 31 | + consists of only a single nonterminal symbol. Context-free grammars can |
32 | 32 | always be recognized by a Non-Deterministic Automatons. |
33 | 33 |
|
34 | 34 | * Terminal symbols are literal symbols which may appear in the outputs of the |
|
47 | 47 |
|
48 | 48 | * The first sets of a rule (FIRST(rule)) are defined to be the set of terminals |
49 | 49 | that can appear in the first position of any string derived from the rule. |
50 | | - This is useful for LL(1) parsers as the parser is only allow to look at the |
51 | | - next token in the input to know which rule needs to parse. For example given |
| 50 | + This is useful for LL(1) parsers as the parser is only allowed to look at the |
| 51 | + next token in the input to know which rule needs to parse. For example, given |
52 | 52 | this grammar: |
53 | 53 |
|
54 | 54 | start: '(' A | B ')' |
|
0 commit comments