Code example for a new language

Hello, I am trying to use AlterNet’s TextEditor for a new language. I have tried the way to create a new xml example. But I still cannot figure out how to create a new language with code complete function. I am trying to use NeedCodeCompletion for the customization. But I always get null for the e.Provider. And I do not know how to fill the e.Provider before it called out.
Another stuff what I am concerned: I would like to use ‘/’ to replace ‘(’ to start the parameter filled in. Thanks!

Hi,

If you use generic Lexer and editing its Schema, this would only give you a syntax highlighting.
You can read a bit more about it here:

Please also refer to the Code Editor user guide, which contains section about code completion and creating own language here:

In a nutshell you either need to either handle NeedCodeCompletion event and provide list of possible items, or offload this task to the SyntaxParser. In most cases this list is context-specific, so you would probably need to do some parsing to figure out the context.

If you provide more information about your language, we might be able to give more specific advise.
Could you also elaborate on replacing character in the parameter filled in?

Kind regards,
Dmitry

Thanks for the help. We are working on the DMIS language, which is used for Coordinate Measure Machine device. The language is called DMIS: Dimensional Measuring Interface Standard.

And then we need compile, debug and run this language. Is it possible to use AlterNet to work out these jobs?

Hi,

I had a quick look to the DMIS and I could not find much of open information like language standard or their scripting engine. But from what I could find it looks highly specialized and a bit far from where our expertise is.

Regards,
Dmitry

Yes, it is quite specialized. I would like to know if we could finish the editor functions and the debug functions via AlterNet. Below is an example for DMIS code segments.

DECL/INTGR,i
DECL/CHAR,64,tname,fname[2,5]
i=ASSIGN/3
tname=ASSIGN/CONCAT(‘tol’,STR(i))
fname[1,1]=ASSIGN/CONCAT(‘feat’,STR(i))
F(@fname[1,1])=FEAT/GSURF
T(@tname)=TOL/PROFS,-0.1,0.1
OUTPUT/F(@fname[1,1]),T(@tname)
$$ yields the following output:
OUTPUT/F(feat3),T(tol3)
F(feat3)=FEAT/GSURF
T(tol3)=TOL/PROFS,-0.1,0.1