Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ChocolateNao/tree-sitter-gcode

Repository files navigation

tree-sitter-gcode

CI discord matrix npm crates pypi

G-code grammar for tree-sitter.

Features

  • General codes (like G, axes, parameters etc.)
  • Wide range of file extensions supported (see file-types)
  • Both inline and end-of-line comments (some G-code flavors support both)
  • Indexed axes words (as specified in ISO 6983-1)
  • Checksums
  • G-code expressions (specified in RS274NGC)
  • Named parameters (check named paramters for LinuxCNC)
  • M98 and M99 G-Code subprograms with parameter variables (check cnccookbook)
  • G-code subroutines with conditionals and loops support (extended O-codes in LinuxCNC)
  • Fanuc-style subprograms, conditionals and loops

Status

This parser was written using a list of references described in the References section. It should work with most cases. Due to wide range of G-code implementations, some unique features may not be supported in this grammar. However, I was trying my best to match common specifications as precise as possible.

Feel free to open an issue with a feature request or do a pull request to extend this grammar to support more features.

References

AltStyle によって変換されたページ (->オリジナル) /