-
Notifications
You must be signed in to change notification settings - Fork 13
Support datum_coment
Higepon Taro Minowa edited this page Sep 22, 2022
·
24 revisions
Rewrite Reader.y in a way that R7RS describes list and dot list.
〈datum〉 −→ 〈simple datum〉 | 〈compound datum〉
| 〈label〉 = 〈datum〉 | 〈label〉 #
〈simple datum〉 −→ 〈boolean〉 | 〈number〉
| 〈character〉 | 〈string〉 | 〈symbol〉 | 〈bytevector〉
〈symbol〉 −→ 〈identifier〉
〈compound datum〉 −→ 〈list〉 | 〈vector〉 | 〈abbreviation〉
〈list〉 −→ (〈datum〉*) | (〈datum〉+ . 〈datum〉)
〈abbreviation〉 −→ 〈abbrev prefix〉 〈datum〉
〈abbrev prefix〉 −→ ’ | ` | , | ,@
〈vector〉 −→ #(〈datum〉*)
〈label〉 −→ # 〈uinteger 10〉
Per https://stackoverflow.com/questions/29235967/bison-one-or-more-occurrences-in-grammar-file
One or more:
declarations
: declaration
| declarations declaration
;
Zero or more:
declarations
: /* empty */
| declarations declaration
;
- Algorithm (Bison 3.8.1)
- shift: push tokens to stack
- reduce: matched a group of tokens is replaced by one token(= lhs in the grammer) in the stack.
- reduce continues until the entire input down to a single grouping which is start symbol.
- Lookahead (Bison 3.8.1)
- lookahead token is stored in yychar.
- Shift/Reduce (Bison 3.8.1)
- if shift/reduce conflicts, the parse chooses shift. eg) if
expr then stmt else
vsif expr then
- if shift/reduce conflicts, the parse chooses shift. eg) if
- Precedence (Bison 3.8.1)
- Why Precedence (Bison 3.8.1)
- Using Precedence (Bison 3.8.1)
- Use %left or %right to let the parser know your choice.
- Precedence Only (Bison 3.8.1)
- Precedence Examples (Bison 3.8.1)
- How Precedence (Bison 3.8.1)
- Non Operators (Bison 3.8.1)
- Contextual Precedence (Bison 3.8.1)
%prec
- Parser States (Bison 3.8.1)
- Reduce/Reduce (Bison 3.8.1)
- reduce/reduce conflict. Bison chooses to use the rule that appears first in the grammer file.
- REREAD THIS
- Mysterious Conflicts (Bison 3.8.1)
- REREAD THIS
- Tuning LR (Bison 3.8.1)
- Generalized LR Parsing (Bison 3.8.1)
- Memory Management (Bison 3.8.1)
- Counterexamples (Bison 3.8.1)
- Graphviz (Bison 3.8.1)
- Xml (Bison 3.8.1)
- Debugging (Bison 3.8.1)
- Tracing (Bison 3.8.1)
- Enabling Traces (Bison 3.8.1)
- Mfcalc Traces (Bison 3.8.1)
- Might be useful later.
- Tracing (Bison 3.8.1)