Skip to content

Commit 673714d

Browse files
committed
chores: release v0.5.0
Signed-off-by: Alex Snaps <alex@wcgw.dev>
1 parent a3d0fda commit 673714d

2 files changed

Lines changed: 5 additions & 36 deletions

File tree

runtime/Rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "antlr4rust"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors = ["Konstantin Anisimov <rrevenantt@gmail.com>", "Alex Snaps <alex@wcgw.dev>"]
55
homepage = "https://github.com/antlr4rust/antlr4"
66
repository = "https://github.com/antlr4rust/antlr4"

runtime/Rust/README.md

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# antlr4rust
2-
[![Crate](https://flat.badgen.net/crates/v/antlr-rust)](https://crates.io/crates/antlr4rust/0.3.0)
3-
[![docs](https://flat.badgen.net/badge/docs.rs/v0.3.0-beta)](https://docs.rs/antlr-rust/0.3.0-beta)
4-
![ANTLR4 testsuite](https://github.com/rrevenantt/antlr4rust/workflows/ANTLR4%20testsuite/badge.svg?event=push)
5-
![cargo test](https://github.com/rrevenantt/antlr4rust/workflows/cargo%20test/badge.svg)
6-
[![](https://tokei.rs/b1/github/rrevenantt/antlr4rust)](https://github.com/rrevenantt/antlr4rust)
2+
[![Crate](https://flat.badgen.net/crates/v/antlr4rust)](https://crates.io/crates/antlr4rust/0.5.0)
3+
[![docs](https://flat.badgen.net/badge/docs.rs/v0.5.0)](https://docs.rs/antlr4rust/0.5.0)
74

85

96
> [!IMPORTANT]
@@ -20,15 +17,7 @@ and [tests/my_tests.rs](tests/my_test.rs) for actual usage examples
2017

2118
## ANTLR4 Tool(parser generator)
2219

23-
Generator part is currently located in rust-target branch of my antlr4 fork [rrevenantt/antlr4/tree/rust-target](https://github.com/rrevenantt/antlr4/tree/rust-target)
24-
Latest version is automatically built to [releases](https://github.com/rrevenantt/antlr4rust/releases) on this repository.
25-
So if you just want to generate parser
26-
or if you want to contribute to only runtime part you don't have to do build it yourself.
27-
28-
But if you want to build or change generator yourself:
29-
* `git clone -b rust-target https://github.com/rrevenantt/antlr4` - clone my antlr4 fork
30-
* `git submodule update --init --recursive --remote` - update Rust target submodule
31-
* `mvn -DskipTests install` - build generator
20+
Can be built using maven, or downloaded from [github.com/antlr4rust/antlr4](https://github.com/antlr4rust/antlr4/releases/)
3221

3322
### Implementation status
3423

@@ -56,7 +45,7 @@ Then add following to `Cargo.toml` of the crate from which generated parser
5645
is going to be used:
5746
```toml
5847
[dependencies]
59-
antlr-rust = "0.3"
48+
antlr-rust = "0.5"
6049
```
6150

6251
### Parse Tree structure
@@ -96,26 +85,6 @@ there are quite some differences because Rust is not an OOP language and is much
9685
Also in Rust target `TokenFactory` is the way to specify token type. As example you can see [CSV](grammars/CSV.g4) test grammar.
9786
- All rule context variables (rule argument or rule return) should implement `Default + Clone`.
9887

99-
### Benchmarks
100-
Here is comparison of antlr generated XML lexer and parser
101-
(from default XML grammar but with custom minimal Token/TokenFactory/InputStream/RuleContext) to hand-written implementations in rust ecosystem.
102-
Keep in mind that `xmlparser` and `quick_xml` are much closer to being lexer than parser, so they should be compared with antlr lexer.
103-
Also while structs used by generated lexer and parser were customized to track as minimum data as required
104-
(which is possible by any user of antlr-rust),
105-
internals of the lexer cannot be customized enough yet and still track quite a lot of data that might not be used in particular case.
106-
So there is still room for improvement.
107-
```text
108-
lexers:
109-
large/large_xmlparser time: [1.8598 ms 1.8607 ms 1.8619 ms]
110-
large/large_quick_xml time: [1.4623 ms 1.4645 ms 1.4675 ms]
111-
large/large_antlr_xml_lexer time: [5.7866 ms 5.7877 ms 5.7891 ms]
112-
parsers:
113-
large/large_xmlrs time: [16.734 ms 16.748 ms 16.766 ms]
114-
large/large_minidom time: [7.0639 ms 7.0792 ms 7.0975 ms]
115-
large/large_roxmltree time: [4.9341 ms 4.9360 ms 4.9380 ms]
116-
large/large_antlr_xml_full time: [10.243 ms 10.248 ms 10.252 ms]
117-
```
118-
11988
### Unsafe
12089
Currently, unsafe is used only for downcasting (through separate crate)
12190
and to update data inside Rc via `get_mut_unchecked`(returned mutable reference is used immediately and not stored anywhere)

0 commit comments

Comments
 (0)