IDE for custom syntax highlighting/autocompletion

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Flumble
Yes Man
Posts: 1951
Joined: Sun Aug 05, 2012 9:35 pm UTC

IDE for custom syntax highlighting/autocompletion

Postby Flumble » Sun Mar 15, 2015 12:44 am UTC

...and whatnot.

What is a good program that allows you to make lexer and parser rules for your language with ease and, optionally, offers autocompletion of keywords/variables? (and of course allows you to decorate the parser rules with text markup)

For context: I'm programming some stuff in an assembly dialect (no DSL yet) and I'd like some visual cues as to which character sequences are registers and which are macros, variables, opcodes or numbers. Some of the syntax can be covered in a user defined language in notepad++, but the tool is pretty limited.

User avatar
Xanthir
My HERO!!!
Posts: 5228
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: IDE for custom syntax highlighting/autocompletion

Postby Xanthir » Sun Mar 15, 2015 2:45 am UTC

This is probably an incomplete solution, but any editor that accepts .tmLanguage files (so, TextMate, Sublime, etc) will let you define syntax highlighting based on regexes. I've used this to good effect to help remind people what correct syntax is of Bikeshed files (my specification-authoring file format).

I'm pretty sure that Sublime (and others?) let you define autocomplete files as well, which you can associate with a file extension. I haven't used this.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: IDE for custom syntax highlighting/autocompletion

Postby troyp » Tue Mar 17, 2015 6:48 pm UTC

You could look at using generic-mode in Emacs*. That's pretty suitable for this sort of thing. There are various completion options like company-mode available (although you might get by with just yasnippet and dabbrev-expand). And there are basically no limits to what you can do in Emacs.
* If you don't already have Emacs set up, you use a starter kit to give you a reasonable starting configuration (eg. Emacs Prelude, or - if you prefer a vi implementation - spacemacs or oh-my-emacs, which enable evil-mode by default)

User avatar
You, sir, name?
Posts: 6974
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: IDE for custom syntax highlighting/autocompletion

Postby You, sir, name? » Sat Mar 21, 2015 4:20 pm UTC

I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: IDE for custom syntax highlighting/autocompletion

Postby troyp » Wed Mar 25, 2015 10:14 pm UTC

@YSN: Your link is broken (by a spurious '=' at the end). Fixed:
Vim Wiki: Creating your own syntax files

Story
Posts: 78
Joined: Wed Aug 26, 2009 9:03 pm UTC

Re: IDE for custom syntax highlighting/autocompletion

Postby Story » Mon Apr 06, 2015 5:37 am UTC

CodeMirror also allows custom syntax highlighting if you need something web based. I haven't tried to define custom autocomplete though so I don't know how well that works.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 6 guests