Sublime Forum

New Syntax Definiton

#1

Hello everybody guys

Apologize me for open another topic with that question.
I am a robot programmer, I used always another famous editor but when I tried this one couldn’t go back to others.

I’m trying to write a syntax definiton for KUKA robots but I’m a total noob, I have tried also to do the example but i can’t understand anything :frowning:. (Instead of Snippets, really easy to create !!!)
Could somebody help me? I have also an .uew where the language is defined (It is used for the other editor, maybe could help to convert quickly for sublime text 2).

Your help will be appreciated

Thanks

0 Likes

#2

[quote=“snaffo”]Hello everybody guys

Apologize me for open another topic with that question.
I am a robot programmer

… at this point I stopped reading due to excessive laughing]

[/quote]

Thanks! :smiley:

0 Likes

#3

Thanks! :smiley:[/quote]

:open_mouth: what I’ve done ?
Sorry if I was rude or being a robot “programmer” is a shame for you or either i used wrong terms.

0 Likes

#4

@Snaffo: you are not rude. It’s just that the words you pick, at first read, looks like „i’m a programmer that is a robot”, and not „i’m a programmer that programs robots” :smile:

Now, regarding your question: there are chances that a syntax is already made for your language (which is it, btw?). Other than that, you can search for a syntaxt highlight for textmate (they are compatible) or trying to make one by yourself:

and so on.

0 Likes

#5

The language is almost derived from C but is made ad hoc for KUKA robots.

Is called KRL but is not KRL language, it has two type of files .src for runtime enviroment and .dat for variables, frames positions and movements.

I have also try your links but i don’t know how it works, i try to past an example that i’ve made but isn’t working (AAApackage error)

1 { scopeName = 'source.untitled'; 2 fileTypes = (.src, .dat ); 3 foldingStartMarker = '\{\s*;FOLD'; 4 foldingStopMarker = '^\s*;ENDFOLD}'; 5 patterns = ( 6 { name = 'keyword.control.untitled'; 7 match = '\b(IF|WHILE|FOR|DEF|END|RETURN|SWITCH|CASE|LOOP|ENDLOOP|ENDSWITCH|ENDWHILE|DEFAULT|REPEAT|UNTIL|DO|DECL|BOOL|PUBLIC|GLOBAL)\b'; 8 }, 9 { name = 'string.quoted.double.untitled'; 10 begin = '"'; 11 end = '"'; 12 patterns = ( 13 { name = 'constant.character.escape.untitled'; 14 match = '\\.'; 15 } 16 ); 17 }, 18 ); 19 }

Here is an example of a general program for pick a part

[code]DEF PG1-2_1F521PAD010R01 ()
;FOLD INI
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN ==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;Make your modifications here

;ENDFOLD (USER INI)
;ENDFOLD (INI)

;**********************************************************
;************** PICK FROM STATION 15 ***************
;**********************************************************

;FOLD START JOB HANDSHAKING
CONTINUE
[O145_Out_of_JOB_1]=TRUE ;Fuori ingombro
CONTINUE
[O177_end_JOB_1]=FALSE ;Start JOB 1
CONTINUE
WAIT FOR ( [I177_proceed_to_JOB_1] )

;********** ROBOT INSIDE STATION 15 ***********
CONTINUE
[O145_Out_of_JOB_1}]=FALSE ;In ingombro
;ENDFOLD

;FOLD InitGripper.Grp1 ;%{PE}%MKUKATPUSER
InitGripper(1)
;ENDFOLD
;FOLD InitGripper.Grp2 ;%{PE}%MKUKATPUSER
InitGripper(2)
;ENDFOLD

;MOVEMENTS TO STATION 15

;********* PICKING PART ************

;FOLD Part.Present = Grp1, Supervision = FALSE;%{PE}%MKUKATPUSER
PartPresent( 1, TRUE, FALSE)
;ENDFOLD
;FOLD GripperClose.Grp1 ‘A_521’, Set;%{PE}%MKUKATPUSER
SetCloseGripper (1)
;ENDFOLD
;FOLD GripperClose.Grp1 ‘A_521’, Set With Control;%{PE}%MKUKATPUSER
SetCloseGripperControl(1)
;ENDFOLD

;ADJUSTMENTS FOR CLOSING CLAMPS

;FOLD Part.Present = Grp2, Supervision = FALSE;%{PE}%MKUKATPUSER
PartPresent( 2, TRUE, FALSE)
;ENDFOLD
;FOLD GripperClose.Grp2 ‘B_521’, Set;%{PE}%MKUKATPUSER
SetCloseGripper (2)
;ENDFOLD
;FOLD GripperClose.Grp2 ‘B_521’, Set With Control;%{PE}%MKUKATPUSER
SetCloseGripperControl(2)
;ENDFOLD

;************ PART PICKED **************

;*********** OUTSIDE STATION 15 *************
;FOLD Part.Present = Grp1, Supervision = TRUE;%{PE}%MKUKATPUSER
PartPresent( 1, TRUE, TRUE)
;ENDFOLD
;FOLD Part.Present = Grp2, Supervision = TRUE;%{PE}%MKUKATPUSER
PartPresent( 2, TRUE, TRUE)
;ENDFOLD

;MOVEMENTS TO STATION 20

;FOLD END JOB HANDSHAKING
TRIGGER WHEN DISTANCE=1 DELAY=0 DO [O177_end_JOB_1]=TRUE ;Fine JOB 1

;******* MOVIMENTO AL FUORI INGOMBRO ********
TRIGGER WHEN DISTANCE=1 DELAY=0 DO [O145_Out_of_JOB_1]=TRUE ;Fuori ingombro

;ENDFOLD

END[/code]

As you can see is really similiar to C, most important things are

;used to make a comment
;FOLD — used to make a fold for the instrucions
;ENDFOLD used to close the fold

I guess keywords from C will be also fine in there

Thank you for answer :smile:

0 Likes