]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Add Rust front-end base AST data structures
authorJoel Phillips <simplytheother@gmail.com>
Fri, 21 Oct 2022 11:34:11 +0000 (13:34 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 13 Dec 2022 13:00:03 +0000 (14:00 +0100)
commit6b35ae12ce9371bf0ae7ad202c4393cdd77fad55
tree81f4cf5d0069ed5b725352e9508637a719bfa7be
parentdc4171edb3c35690c67a928cbb431aa702bdbe79
gccrs: Add Rust front-end base AST data structures

This is a full C++11 class hierarchy representing the Rust AST. We do not
allow dynamic_cast and so the main mechanism to work with the AST is by
using the visitor interface. Slowly we are adding TREE_CODE style node
types to the AST which will allow for more ways to work with the AST but
for now this is it.

See: https://doc.rust-lang.org/reference/items.html

gcc/rust/
* ast/rust-ast-full-decls.h: New.
* ast/rust-ast-full-test.cc: New.
* ast/rust-ast-full.h: New.
* ast/rust-ast.h: New.
* operator.h: New.

Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Signed-off-by: Joel Phillips <simplytheother@gmail.com>
gcc/rust/ast/rust-ast-full-decls.h [new file with mode: 0644]
gcc/rust/ast/rust-ast-full-test.cc [new file with mode: 0644]
gcc/rust/ast/rust-ast-full.h [new file with mode: 0644]
gcc/rust/ast/rust-ast.h [new file with mode: 0644]
gcc/rust/operator.h [new file with mode: 0644]