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.0.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.0-cp310-abi3-win_arm64.whl (19.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_gcode-0.1.0-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.0-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.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: tree_sitter_gcode-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2e03923721214b92d21caa68c6bb6407d9ff645f3cc2f10e9a9c25b351c034d5
MD5 da4389d4ba0ca1ff3ffc81efb8b3a8ab
BLAKE2b-256 c5838e21a074d5a87d60de664aff13cde7fbeb0f4ee04860296b7f19d8c5e975

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 55dc9bd797f5b9027f1d179b61887d45cef2d5dbf61bb077834679358a2d669d
MD5 0cd50854774e4ce054aec2f09233828d
BLAKE2b-256 7ba64eaf4de408837ed82326448755df39044a54f38396cb6b5cbfb35253a498

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 374aa9e57c6be343b56870f675cb95e863025897d0b4c23b2db526ba7661835d
MD5 0342b294c27049a056410d5c131cfed2
BLAKE2b-256 0ae59749e2fdd9e6c2b6b8ad5492ad21a2b25e1bdd77cbb316b5f04a96f17bd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7b1dd44b1a4d4be0f30407b80e812b92095a03d5c9ac5447ea6c534d1289e926
MD5 841ed85165aae751a69bcd7a5ae6fa4f
BLAKE2b-256 c1ca884f96559d6ed3daf25b2b676291f8f6297425ffa2eee49420b2ec216013

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9e6678c99e7344b6021994dcaa07f13b8537aacc57b2151b956946ec6037502c
MD5 8d9f64438d43f7cea92c68c03b0faf6f
BLAKE2b-256 0a1c579c4eab35968410be7d7c56d10e37b173f5e56a9b4b3f4bc48c70987914

See more details on using hashes here.

File details

Details for the file tree_sitter_gcode-0.1.0-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.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8cdd61090ec5b84c09478408a4238fc4c7c60409544bfe457b6fb9bda155a614
MD5 9e1189152e7e5a8d962fbdeb6451361d
BLAKE2b-256 bcc5269869508b7557347d700ca524a63681404b78a3a21e305035506e56eac5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3988b617ef7aa22ef1c3583961611917ae03890776757ebac56f9db6f5492a7c
MD5 56762db68b5c20a3994c84681a493bb8
BLAKE2b-256 2d9adaad64344283db06ecf2f657770a47f2b857d4d39ffadcf91faffdae8af4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_gcode-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 420ebf83184ae3ed3ab7e9d7ea2c7981ce852aa28da55d5ea57e953c31580853
MD5 60cce4879cb4388f349347741c037de9
BLAKE2b-256 26fc20baf62807f52c30284e2f25e6059ec21d0897740c024aed91a11f45f0b4

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