Remove all mention of the ERROR rule type
This commit is contained in:
parent
94807f0eb0
commit
88e8cab7f9
3 changed files with 3 additions and 35 deletions
12
README.md
12
README.md
|
|
@ -74,14 +74,7 @@ int main() {
|
|||
"type": "SEQ",
|
||||
"members": [
|
||||
{"type": "STRING", "value": "("},
|
||||
|
||||
// Error recovery is controlled by wrapping rule subtrees
|
||||
// in an 'ERROR' rule.
|
||||
{
|
||||
"type": "ERROR",
|
||||
"content": {"type": "SYMBOL", "name": "expression"}
|
||||
},
|
||||
|
||||
{"type": "SYMBOL", "name": "expression"},
|
||||
{"type": "STRING", "value": ")"}
|
||||
]
|
||||
}
|
||||
|
|
@ -225,6 +218,7 @@ clang \
|
|||
### References
|
||||
|
||||
- [Context Aware Scanning for Parsing Extensible Languages](http://www.umsec.umn.edu/publications/Context-Aware-Scanning-Parsing-Extensible)
|
||||
- [LR(1) Parser Generation System](http://arxiv.org/pdf/1010.1234.pdf) (Error recovery scheme)
|
||||
- [Efficient and Flexible Incremental Parsing](http://harmonia.cs.berkeley.edu/papers/twagner-parsing.ps.gz)
|
||||
- [Incremental Analysis of Real Programming Languages](http://harmonia.cs.berkeley.edu/papers/twagner-glr.pdf)
|
||||
- [Error Detection and Recovery in LR Parsers](http://what-when-how.com/compiler-writing/bottom-up-parsing-compiler-writing-part-13)
|
||||
- [Error Recovery for LR Parsers](http://www.dtic.mil/dtic/tr/fulltext/u2/a043470.pdf)
|
||||
|
|
|
|||
|
|
@ -170,20 +170,6 @@
|
|||
"required": ["type", "content"]
|
||||
},
|
||||
|
||||
"error-rule": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"pattern": "^ERROR$"
|
||||
},
|
||||
"content": {
|
||||
"$ref": "#/definitions/rule"
|
||||
}
|
||||
},
|
||||
"required": ["type", "content"]
|
||||
},
|
||||
|
||||
"prec-rule": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -246,7 +232,6 @@
|
|||
{ "$ref": "#/definitions/repeat1-rule" },
|
||||
{ "$ref": "#/definitions/repeat-rule" },
|
||||
{ "$ref": "#/definitions/token-rule" },
|
||||
{ "$ref": "#/definitions/error-rule" },
|
||||
{ "$ref": "#/definitions/prec-rule" },
|
||||
{ "$ref": "#/definitions/prec-left-rule" },
|
||||
{ "$ref": "#/definitions/prec-right-rule" }
|
||||
|
|
|
|||
|
|
@ -86,17 +86,6 @@ ParseRuleResult parse_rule(json_value *rule_json) {
|
|||
return { seq(members), "" };
|
||||
}
|
||||
|
||||
if (type == "ERROR") {
|
||||
json_value content_json = rule_json->operator[]("content");
|
||||
ParseRuleResult content = parse_rule(&content_json);
|
||||
if (content.rule.get()) {
|
||||
return { content.rule, "" };
|
||||
} else {
|
||||
error_message = "Invalid error content: " + content.error_message;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == "REPEAT") {
|
||||
json_value content_json = rule_json->operator[]("content");
|
||||
ParseRuleResult content = parse_rule(&content_json);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue