On 06/28/2012 05:51 PM, Left Right wrote:
> Hello list.
> I'm in the early stage of improving a major editing mode for HaXe
> programming language, and I'm looking for integrating it with CEDET.
> One thing I certainly want to do is to have it "understood" by
> Semantic. The language syntax is fairly similar to C (it's current
> major mode is based on c-mode). Although I don't have the grammar all
> spelled yet, so I can't tell if it is deterministic, but it "feels"
> like it should be, possibly there would be minor exceptions, that may
> be possible to handle on the case by case basis, but no more than
> So, my question is, where do I start? Can you please show me to an
> example of another language doing the same thing? I hope I'd continue
> from there on my own.
Since HaXe is similar to C, you can start with the c bovine grammar.
If you do, you will either need to replicate all the useful C
overloads, or make HaXe a child mode of C. If you do, you need to use
define-child-mode to specify inheritance of the overload methods.
You can look in the c.el file for semantic-default-c-setup for
getting your parser hooked into your haxe mode.
Once that basic stuff is working, you can start tweaking the parser,
or you could start your own parser from scratch. If you start from
scratch, you could look at wisent/calc for a simple example. Another
simple grammar is cogre/wisent-dot.wy which is for graphviz files, and
is short and simple for a parser. That's in the cogre tools.