Skip to content

Commit 2fb4aab

Browse files
committed
update Readme
1 parent e276292 commit 2fb4aab

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

LICENSE.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[The "BSD 3-clause license"]
2+
Copyright (c) 2020-2021 Konstantin Anisimov. All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
8+
1. Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
2. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software
15+
without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@
33
[![docs](https://flat.badgen.net/badge/docs.rs/v0.2.0)](https://docs.rs/antlr-rust/0.2.0)
44
![ANTLR4 testsuite](https://github.com/rrevenantt/antlr4rust/workflows/ANTLR4%20testsuite/badge.svg?event=push)
55
![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)
67

78
[ANTLR4](https://github.com/antlr/antlr4) runtime for Rust programming language.
89

9-
Tool(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)
10-
Latest version is automatically built to [releases](https://github.com/rrevenantt/antlr4rust/releases) on this repository.
11-
1210
For examples you can see [grammars](grammars), [tests/gen](tests/gen) for corresponding generated code
1311
and [tests/my_tests.rs](tests/my_test.rs) for actual usage examples
1412

15-
## Building antlr4/rust-target Tool(generator)
13+
## ANTLR4 Tool(parser generator)
14+
15+
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)
16+
Latest version is automatically built to [releases](https://github.com/rrevenantt/antlr4rust/releases) on this repository.
17+
So if you just want to generate parser
18+
or if you want to contribute to only runtime part you don't have to do build it yourself.
1619

17-
If you would like to work with the rust-target, in the antlr4 repo:
18-
* `git clone https://github.com/rrevenantt/antlr4`
19-
* `git checkout rust-target`
20-
* `git submodule update --init --recursive`
21-
* `mvn -DskipTests install`
20+
But if you want to build or change generator yourself:
21+
* `git clone -b rust-target https://github.com/rrevenantt/antlr4` - clone my antlr4 fork
22+
* `git submodule update --init --recursive` - update Rust target submodule
23+
* `mvn -DskipTests install` - build generator
2224

2325
### Implementation status
2426

@@ -37,9 +39,6 @@ Remaining things before merge:
3739
Can be done after merge:
3840
- Documentation
3941
- [ ] Some things are already documented but still far from perfect, also more links needed.
40-
- Code quality
41-
- [ ] Clippy sanitation
42-
- [ ] Not all warning are fixed
4342
- cfg to not build potentially unnecessary parts
4443
(no Lexer if custom token stream, no ParserATNSimulator if LL(1) grammar)
4544
- run rustfmt on generated parser
@@ -54,7 +53,7 @@ Can be done after merge:
5453
### Usage
5554

5655
You should use the ANTLR4 "tool" to generate a parser, that will use the ANTLR
57-
runtime, located here. You can run it with the following command:
56+
runtime located here. You can run it with the following command:
5857
```bash
5958
java -jar <path to ANTLR4 tool> -Dlanguage=Rust MyGrammar.g4
6059
```
@@ -137,4 +136,7 @@ patch version changes of the crate should not require updating of generator part
137136

138137
## Licence
139138

140-
BSD 3-clause
139+
BSD 3-clause.
140+
Unless you explicitly state otherwise,
141+
any contribution intentionally submitted for inclusion in this project by you
142+
shall be licensed as above, without any additional terms or conditions.

tests/gen/referencetoatnparser.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ where
134134
}
135135

136136
/// Trait for monomorphized trait object that corresponds to the nodes of parse tree generated for ReferenceToATNParser
137-
pub trait ReferenceToATNParserContext<'input>: for<'x> Listenable<
138-
dyn ReferenceToATNListener<'input> + 'x,
139-
> + ParserRuleContext<'input, TF = LocalTokenFactory<'input>, Ctx = ReferenceToATNParserContextType>
137+
pub trait ReferenceToATNParserContext<'input>: for<'x> Listenable<dyn ReferenceToATNListener<'input> + 'x>
138+
+ ParserRuleContext<'input, TF = LocalTokenFactory<'input>, Ctx = ReferenceToATNParserContextType>
140139
{
141140
}
142141

0 commit comments

Comments
 (0)