9

I'm using ANTLR for creating a new general purpose programming language and I'm quite happy with it.

Due to the fact that I would like to provide good tools for ease the development of programs written with my language I'm starting to thinking on realising a editor for that language through a proper Eclipse plugin.

Is there any tools/project that allow you to have a fully-fledged editor (with syntax highlighting, code completion, etc.). I know that Xtext allow you to do this in automatic, what about ANTLR?

I've seen this mail to the ANTLR mailing list but it has no answers

  • Xtext uses ANTLR under the hood – moritz Apr 12 '11 at 11:52
  • I know that. What I'm asking is if exists any tool that starting from a ANTLR grammar allows you to generate a editor plugin for eclipse (like what is doina Xtext). Is anything like that existing for ANTLR or not? – the_dark_destructor Apr 12 '11 at 12:48

2 Answers2

5

I'd give Xtext a try. It does not provide all the features of Antlr on the grammar level, but the framework offers great infrastructure components such as a tight integration with the Eclipse modeling components and the Eclipse UI.

Sebastian Zarnekow
  • 6,609
  • 20
  • 23
  • many thanks. I will do it for sure. It seems that my grammar is not so complex, so translating it in Xtext will be no so troublesome. However it seems that no automated support for doing the same job starting from an ANTLR grammar exists. – the_dark_destructor Apr 28 '11 at 16:39
  • 1
    It is hardly possible to transform an Antlr grammar to Xtext automatically. The Xtext grammar contains more information such as the mapping of concrete syntax elements to type-safe abstract syntax elements. Those cannot be extracted / inferred from a plain Antlr grammar. However, pasting your grammar into a newly created Xtext grammar and solving the automatically identified issues is usually not too painful. – Sebastian Zarnekow Apr 28 '11 at 17:25
3

Monticore almost seems to do what you (and I) hope for. In their Message Sequence Chart example there is an Eclipse Editor, it is an Eclipse Sample project. I am currently looking into it. Monticore is based upon antlr and the grammar looks quite similar to ANTLRs.

dschulten
  • 2,994
  • 1
  • 27
  • 44