Add support for G-code language

This is a special language controlling 3D printers (by RepRap, Makerbot,
Ultimaker etc.). It is not a general purpose programming language, but
still contains commands for e.g. looping. On the other hand, most of the
time it will be generated by another program, not hand-written. Hence I
classified it as "data".

Specification:
* http://reprap.org/wiki/G-code

Some repositories with examples:
* https://github.com/reprappro/Mendel
* https://github.com/BLLIP/bllip-parser
* https://github.com/MakerGear/M2
This commit is contained in:
Max Horn
2014-09-15 14:50:24 +02:00
parent c204d7c297
commit b67c2bc2b2
5 changed files with 55725 additions and 0 deletions

View File

@@ -756,6 +756,14 @@ Frege:
extensions:
- .fr
G-code:
type: data
lexer: Text only
extensions:
- .g
- .gco
- .gcode
Game Maker Language:
type: programming
color: "#8ad353"

57
samples/G-code/duettest.g Normal file
View File

@@ -0,0 +1,57 @@
; RepRapPro Ormerod
; Board test GCodes
M111 S1; Debug on
G21 ; mm
G90 ; Absolute positioning
M83 ; Extrusion relative
M906 X800 Y800 Z800 E800 ; Motor currents (mA)
T0 ; Extruder 0
G1 X50 F500
G1 X0
G4 P500
G1 Y50 F500
G1 Y0
G4 P500
G1 Z20 F200
G1 Z0
G4 P500
G1 E20 F200
G1 E-20
G4 P500
M106 S255
G4 P500
M106 S0
G4 P500
M105
G10 P0 S100
T0
M140 S100
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
G4 P5000
M105
M0

25912
samples/G-code/lm.g Normal file

File diff suppressed because it is too large Load Diff

29735
samples/G-code/rm.g Normal file

File diff suppressed because it is too large Load Diff

13
samples/G-code/square.g Normal file
View File

@@ -0,0 +1,13 @@
G28 X0 Y0
G1 X55 Y5 F2000
G1 Y180
G1 X180
G1 Y5
G1 X55
G1 Y180
G1 X180
G1 Y5
G1 X55
M0