Parser Generator Skill
Overview
Expert skill for parser generation and implementation using LL, LR, LALR, PEG, and Pratt parsing techniques.
Capabilities
- Generate parsers from grammar specifications (ANTLR, Bison, tree-sitter)
- Implement recursive descent parsers with predictive parsing
- Implement Pratt parsers for expression handling
- Generate LALR/GLR parse tables
- Implement PEG parsers with packrat memoization
- Handle grammar conflicts (shift-reduce, reduce-reduce)
- Generate concrete syntax trees (CST) and AST transformations
- Implement operator precedence parsing
Target Processes
- parser-development.js
- language-grammar-design.js
- ast-design.js
- lsp-server-implementation.js
Dependencies
- ANTLR4
- tree-sitter
- Bison/Yacc
Usage Guidelines
- Grammar Analysis: Analyze grammar class requirements (LL(k), LALR, etc.) before selecting parser type
- Conflict Resolution: Document and resolve all shift-reduce/reduce-reduce conflicts explicitly
- Error Recovery: Implement synchronization points for robust error recovery
- AST Construction: Design AST node types before implementing production actions
- Expression Parsing: Use Pratt parsing for complex expression precedence handling
Output Schema
{
"type": "object",
"properties": {
"parserType": {
"type": "string",
"enum": ["recursive-descent", "pratt", "lalr", "glr", "peg", "ll"]
},
"grammarClass": { "type": "string" },
"conflicts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"resolution": { "type": "string" }
}
}
},
"generatedFiles": {
"type": "array",
"items": { "type": "string" }
}
}
}
1---2name: parser-generator3description: Expert skill for parser generation and implementation using LL, LR, LALR, PEG, and Pratt parsing techniques4---5
6# Parser Generator Skill
7
8## Overview
9
10Expert skill for parser generation and implementation using LL, LR, LALR, PEG, and Pratt parsing techniques.
11
12## Capabilities
13
14- Generate parsers from grammar specifications (ANTLR, Bison, tree-sitter)
15- Implement recursive descent parsers with predictive parsing
16- Implement Pratt parsers for expression handling
17- Generate LALR/GLR parse tables
18- Implement PEG parsers with packrat memoization
19- Handle grammar conflicts (shift-reduce, reduce-reduce)
20- Generate concrete syntax trees (CST) and AST transformations
21- Implement operator precedence parsing
22
23## Target Processes
24
25- parser-development.js
26- language-grammar-design.js
27- ast-design.js
28- lsp-server-implementation.js
29
30## Dependencies
31
32- ANTLR4
33- tree-sitter
34- Bison/Yacc
35
36## Usage Guidelines
37
381. **Grammar Analysis**: Analyze grammar class requirements (LL(k), LALR, etc.) before selecting parser type
392. **Conflict Resolution**: Document and resolve all shift-reduce/reduce-reduce conflicts explicitly
403. **Error Recovery**: Implement synchronization points for robust error recovery
414. **AST Construction**: Design AST node types before implementing production actions
425. **Expression Parsing**: Use Pratt parsing for complex expression precedence handling
43
44## Output Schema
45
46```json
47{
48 "type": "object",
49 "properties": {
50 "parserType": {
51 "type": "string",
52 "enum": ["recursive-descent", "pratt", "lalr", "glr", "peg", "ll"]
53 },
54 "grammarClass": { "type": "string" },
55 "conflicts": {
56 "type": "array",
57 "items": {
58 "type": "object",
59 "properties": {
60 "type": { "type": "string" },
61 "resolution": { "type": "string" }
62 }
63 }
64 },
65 "generatedFiles": {
66 "type": "array",
67 "items": { "type": "string" }
68 }
69 }
70}
71```