eclipse - Where to find a similar to C grammar as inspiration in Xtext? -


i working on dsp toolchain named crosscore embedded studio sharc processors. ide implemented apart assembly language support poor.

i not sure whether or not analog devices give better support in near future.

i mean, there no code folding, no outlines , minimalistic code colouring support. quickly implement more efficient , looking @ way implement new language definition in eclipse luna.

what found . followed 5 , 15 minutes tutorials , read articles it.

i ready implement language. because assembly language inherits similar aspects (i.e. preprocessor directives, c/c++ comments, arithmetic operations , semicolons endings), actively looking @ c grammar example xtext.

unfortunately did not find yet. sadly, discovered c or c++ cannot described in xtext because of muliple language layers such c-preprocessor , c. not admit defeat yet , think can implement sufficent require approximate syntax colouring, code folding , outlines support.

where can find helpful examples implement such language?

here sharc assembly language looks like:

#include <foo.h> #include "foo.h" #ifdef bar     .segment/dm slow; #else     .segment/dm fast; #endif  label:     r1 = r2; /* comment */     r3 = dm( _symbol + 0 );     r5 = r3 + 1; // comment     jump(db);        nop;        r8 = pass r8;  another_label:     {   // not recognized assembly, useful readabily, enable code folding here...         r2 = 3;     }  final_label.end: nop; .endseg; 

although not have long trajectory using xtext, recommend search grammar 1 trying accomplish not limiting xtext. far know, xtext built on top of antlr, powerful parser generator reading, processing, executing, or translating structured text or binary files (from its website). now, there several contributions antlr project in terms of grammars examples, , can find them here.

in repository can find c grammar written in antlr, should starting point towards xtext grammar; not vary much.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -