Javascript-based code editor for custom language syntax

I need a javascript / html based code editor that I will configure for a very simple custom coding language.

These editor tools should work in a standalone solution, so the source code must be downloaded or opened . The syntax of the language will look very simplified java script even with out variables I define only "if then" and "built in function name" for the user language.

So, it must have configuration support for custom coding language syntax

If you can reference some ready-to-use solutions, it will be so useful.

+7
source share
2 answers

I found a solution for my question

I used a code mirror

http://codemirror.net/

It has built-in support for many coding languages, including JavaScript / C # / VB / C / C ++ / CSS / etc

and according to the language file you can also change the list of supported keywords

+3
source

I'm not sure if you think this is a "code editor", but you can use gedit . You can create a new language definition and put it in the file "mylanguage.lang" and use it for coloring the syntax (see here ).

You can also create plugins for gedit to do more for your language, for example, build an AST or compile your code, etc. Plugins are written in Python (better or worse). Check out this page .

Here is one example of how neat Gedit plugins can be. This is a plugin for Gedit that interacts with Clang (C / C ++ / ObjC compiler) to give the programmer immediate warnings and errors for their code. Thus, you can create a plugin that can analyze your new language code and check for problems / suggest code completion, etc.

Although this may seem a little tedious, I don’t think you will find a ready-made solution to your problem. Since your language syntax is technically different from any other language (although it may be somewhat similar), you will not find an editor that magically knows your syntax. But if all you need is coloring the code, then Gedit is easy to configure. Unfortunately, more reliable editor functions are not so easy to do, but certainly possible!

-one
source

All Articles