https://github.com/mcchatman8009/antlr4-editor
A fully Antlr4 supported NPM Editor Library
https://github.com/mcchatman8009/antlr4-editor
ace-editor antlr4 antlr4-editor codemirror dsl editor grammar language monaco-editor parser typescript-editor validator
Last synced: 2 months ago
JSON representation
A fully Antlr4 supported NPM Editor Library
- Host: GitHub
- URL: https://github.com/mcchatman8009/antlr4-editor
- Owner: mcchatman8009
- License: other
- Created: 2018-08-11T05:53:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T10:32:39.000Z (over 2 years ago)
- Last Synced: 2025-03-25T08:16:39.230Z (3 months ago)
- Topics: ace-editor, antlr4, antlr4-editor, codemirror, dsl, editor, grammar, language, monaco-editor, parser, typescript-editor, validator
- Language: TypeScript
- Homepage:
- Size: 1.1 MB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Antlr4 Editor
## Overview
The goal of this project/library is to provide developers with a simple to use API to develop
web compatible code editors, using only Antlr4 Grammars. Allowing for the creation of the editor and language
to be more unified during the development process.**(Currently the only fully supported editor platform is codemirror at the moment)**
## Getting Started
```bash
npm install -S antlr4-editor
```### Example Generating An Editor
Generate the source files for creating a C Editor.
```javascript
antlr4-editor -o src/editor -r compilationUnit samples/c/C.g4
```
Example Output
Run the Test Editor Application
```javascript
node ./src/editor/test-editor-app.js
```### Javascript Code of a Simple C Editor
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);```
### TODOS
- [ ] 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