Skip to main content

G-code grammar for tree-sitter

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_gcode-0.1.1.tar.gz (31.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_gcode-0.1.1-cp310-abi3-win_arm64.whl (19.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_gcode-0.1.1-cp310-abi3-win_amd64.whl (21.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_gcode-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl (32.9 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (33.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_gcode-0.1.1-cp310-abi3-macosx_11_0_arm64.whl (20.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_gcode-0.1.1-cp310-abi3-macosx_10_9_x86_64.whl (19.5 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_gcode-0.1.1.tar.gz.

File metadata

  • Download URL: tree_sitter_gcode-0.1.1.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_sitter_gcode-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d9140ad9af7952dcbebd2dfdc56525b2d344074878e2758712d4c1767c15c02
MD5 2313eb5536ffffb8a4d0ccd83adff7f3
BLAKE2b-256 5858b1e50a6e0c2265aec91acc3635f19b79ba864302c1cdcf232a8228d05c05

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 5430b143609da29bc37a2d6020d9ef5166113f906b5ba4e82f68428ee8b29bc0
MD5 1cef81b496be61add8fa415b9b43cd5c
BLAKE2b-256 2403a85433665d16550dedb066c4eadafafb0abbaa29436bedd24d3863868698

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1e3f6bfa33ff22340bc08ef83ebb7a0ec3ecacb57e3e56a8cf15a7721ca4727b
MD5 a56217a5915bbcaec4678987e0cdb263
BLAKE2b-256 46274f8f5c121b919893f7c208ee447f1f9f13ef0fb290856460159d35de3034

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6b772b8eb7c57f753f69c9107a9b63a977b12c719a073717fa636ae1feb2b38e
MD5 e6f4e9d8c4f1f0009f870f7ebf2899dd
BLAKE2b-256 4672b1930643221f9a944056b081f1aef2d1f2299a8e71f927bfdd225ac00c7b

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 df727e90b17d33ec954464726e7b312790123b7c46a88aad38411adb929c0fd3
MD5 beba977a3da0abd6d756d80b63b364c4
BLAKE2b-256 0f1ef66442e59cbb6a35b03c90e399c2a764f15dde56d760b710369be648ed57

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7865f1325b76ca0f7b30b37dd468598d6dccfd0aeccad9b688290b0c617e6065
MD5 5eb7a528c43e6ebe40f48a352854f040
BLAKE2b-256 8e464f9760f5c233a85197956ed6cdebab07d353791c3fea008779823c0e0810

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36199cb31e36a4dbf76e68a114e7966ece7568ea06a193078ec7d973618f53bb
MD5 6bb1167b32266157666c92249a7757b5
BLAKE2b-256 6d358f8f4686b11ea9370add212f4a31943816dd10a0cbf44177ffcd2786e78c

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.1-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.1-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fc9148abfd4f11b1c11b5ea2ae5a0bc5d3102419858157c5c6553a0d2b32234a
MD5 a947cdd506a3321a0135c9fcec3eee41
BLAKE2b-256 5001bdd4a47b8479207a672d81a80462c136538dc26a94751e8f5626c1641a7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page