An full editor front-end library that can support various editor platforms, all using Antlr4
npm install antlr4-editor(Currently the only fully supported editor platform is codemirror at the moment)
bash
npm install -S antlr4-editor
`$3
Generate the source files for creating a C Editor.
`javascript
antlr4-editor -o src/editor -r compilationUnit samples/c/C.g4
`
Example Output
!Output Example
Run the Test Editor Application
`javascript
node ./src/editor/test-editor-app.js
`
$3
Given that you've generated editor source code, the following code creates
a simple C language code editor.
`javascript
const createEditor = require('./editor').createEditor;const editor = createEditor();
editor.setEditorPlaceholderText('Enter your code here...');
editor.setShowLineNumbers(true);
editor.setDisplayEditorErrors(true);
editor.focus();
const el = editor.getDomElement();
// Render the editor
document.body.appendChild(el);
``- [ ] Improve API Documentation
- [ ] Add Ace Editor Support
- [ ] Add Monaco Editor Support
- [ ] Create Sample Editors
- [ ] Publish Sample Editors
- [ ] Create Tutorials
- [X] Add CodeMirror Support
- [ ] Provide CLI Support