|
2 | 2 |
|
3 | 3 | [](https://marketplace.visualstudio.com/items?itemName=theodevelop.bison-flex-lang) |
4 | 4 | [](https://marketplace.visualstudio.com/items?itemName=theodevelop.bison-flex-lang) |
5 | | -[](https://github.com/theodevelop/Bison-Flex-Language-Support/actions/workflows/ci.yml) |
| 5 | +[](https://marketplace.visualstudio.com/items?itemName=theodevelop.bison-flex-lang) |
| 6 | +[](https://open.vsx.org/extension/theodevelop/bison-flex-lang) |
| 7 | +[](https://github.com/theodevelop/bison-flex-lang/actions/workflows/ci.yml) |
6 | 8 | [](LICENSE) |
7 | 9 |
|
8 | 10 | Full-featured language support for **GNU Bison** (`.y`, `.yy`) and **Flex/RE-flex** (`.l`, `.ll`) in Visual Studio Code. |
@@ -32,6 +34,10 @@ Real-time error detection as you type: |
32 | 34 | | Missing `%%` section separator | Missing `%%` section separator | |
33 | 35 | | Unclosed `%{ %}` code blocks | Unclosed `%{ %}` code blocks | |
34 | 36 | | Missing `%type` with `variant` semantic values | Unused start conditions and abbreviations | |
| 37 | +| Unused grammar rules (unreachable from start symbol) | Inaccessible rules (catch-all before specific pattern, or duplicate) | |
| 38 | +| Unused tokens (declared but never referenced) | Unknown/invalid directive | |
| 39 | +| Shift/reduce conflict heuristic | | |
| 40 | +| Unknown/invalid directive | | |
35 | 41 |
|
36 | 42 | ### Autocompletion |
37 | 43 |
|
@@ -75,6 +81,25 @@ Ready-to-use templates to speed up your workflow: |
75 | 81 |
|
76 | 82 | --- |
77 | 83 |
|
| 84 | +## Screenshots |
| 85 | + |
| 86 | +### Syntax Highlighting |
| 87 | + |
| 88 | + |
| 89 | +### Hover Documentation |
| 90 | + |
| 91 | + |
| 92 | +### Autocompletion |
| 93 | + |
| 94 | + |
| 95 | +### Diagnostics |
| 96 | + |
| 97 | + |
| 98 | +### Snippets |
| 99 | + |
| 100 | + |
| 101 | +--- |
| 102 | + |
78 | 103 | ## Supported File Types |
79 | 104 |
|
80 | 105 | | Language | Extensions | Aliases | |
@@ -115,6 +140,65 @@ Then press `F5` in VS Code to launch the Extension Development Host. |
115 | 140 | |---------|------|---------|-------------| |
116 | 141 | | `bisonFlex.enableDiagnostics` | `boolean` | `true` | Enable/disable real-time error detection | |
117 | 142 | | `bisonFlex.maxDiagnostics` | `number` | `100` | Maximum number of diagnostics per file | |
| 143 | +| `bisonFlex.bisonPath` | `string` | `"bison"` | Path to the Bison executable (must be in PATH or absolute) | |
| 144 | +| `bisonFlex.flexPath` | `string` | `"flex"` | Path to the Flex executable (must be in PATH or absolute) | |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## Build Integration (tasks.json) |
| 149 | + |
| 150 | +Drop this `.vscode/tasks.json` into your Bison/Flex project to get `Ctrl+Shift+B` build support with problem matchers: |
| 151 | + |
| 152 | +```json |
| 153 | +{ |
| 154 | + "version": "2.0.0", |
| 155 | + "tasks": [ |
| 156 | + { |
| 157 | + "label": "Build (Bison + Flex + Make)", |
| 158 | + "type": "shell", |
| 159 | + "command": "make", |
| 160 | + "group": { "kind": "build", "isDefault": true }, |
| 161 | + "presentation": { "reveal": "always", "panel": "shared" }, |
| 162 | + "problemMatcher": [ |
| 163 | + { |
| 164 | + "owner": "bison", |
| 165 | + "fileLocation": ["relative", "${workspaceFolder}"], |
| 166 | + "pattern": { |
| 167 | + "regexp": "^(.+?):(\\d+)(?:\\.(\\d+))?:\\s+(warning|error):\\s+(.+)$", |
| 168 | + "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 |
| 169 | + } |
| 170 | + }, |
| 171 | + { |
| 172 | + "owner": "flex", |
| 173 | + "fileLocation": ["relative", "${workspaceFolder}"], |
| 174 | + "pattern": { |
| 175 | + "regexp": "^(.+?):(\\d+):\\s+(warning|error):\\s+(.+)$", |
| 176 | + "file": 1, "line": 2, "severity": 3, "message": 4 |
| 177 | + } |
| 178 | + } |
| 179 | + ] |
| 180 | + }, |
| 181 | + { |
| 182 | + "label": "Bison: Compile current file", |
| 183 | + "type": "shell", |
| 184 | + "command": "bison", |
| 185 | + "args": ["-d", "-v", "${file}"], |
| 186 | + "group": "build", |
| 187 | + "problemMatcher": [] |
| 188 | + }, |
| 189 | + { |
| 190 | + "label": "Flex: Compile current file", |
| 191 | + "type": "shell", |
| 192 | + "command": "flex", |
| 193 | + "args": ["-o", "${fileBasenameNoExtension}.c", "${file}"], |
| 194 | + "group": "build", |
| 195 | + "problemMatcher": [] |
| 196 | + } |
| 197 | + ] |
| 198 | +} |
| 199 | +``` |
| 200 | + |
| 201 | +> **Tip**: `bison -d` generates the `.tab.h` header; `-v` produces the `.output` report with the parse table. |
118 | 202 |
|
119 | 203 | --- |
120 | 204 |
|
@@ -144,7 +228,7 @@ Contributions are welcome! Here's how to get started: |
144 | 228 | ### Running Tests |
145 | 229 |
|
146 | 230 | ```bash |
147 | | -npx ts-node --project server/tsconfig.json test-parsers.ts |
| 231 | +npx ts-node --project server/tsconfig.json tests/test-parsers.ts |
148 | 232 | ``` |
149 | 233 |
|
150 | 234 | ### Building for Production |
|
0 commit comments