forked from rrevenantt/antlr4rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed most of the bugs, full listener support, added tree walker supp…
…ort. almost all remaining features implemented
- Loading branch information
1 parent
5bf545a
commit 67eb97b
Showing
49 changed files
with
2,263 additions
and
1,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,11 @@ | |
name = "antlr-rust" | ||
version = "0.1.0" | ||
authors = ["Konstantin Anisimov <[email protected]>"] | ||
description = "ANTLR4 runtime for Rust" | ||
edition = "2018" | ||
build = false | ||
license = "BSD-3-Clause" | ||
keywords = ["ANTLR","ANTLR4","parsing","runtime"] | ||
categories = ["parsing"] | ||
|
||
[dependencies] | ||
lazy_static = "1.4.*" | ||
|
@@ -12,6 +15,7 @@ byteorder = "1" | |
murmur3 = "0.4" | ||
bit-set = "0.5.*" | ||
once_cell = "1.2.*" | ||
backtrace = "0.3" | ||
|
||
[lib] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
grammar Labels; | ||
z : s[0] ; | ||
s[isize v] : q=e {println!("{}",$e.v)}; | ||
e returns [isize v] | ||
: a=e op='*' b=e {$v = $a.v * $b.v;} # mult | ||
| a=e '+' b=e {$v = $a.v + $b.v;} # add | ||
| INT {$v = $INT.int;} # anInt | ||
| '(' x=e ')' {$v = $x.v;} # parens | ||
| x=e '++' {$v = $x.v+1;} # inc | ||
| e '--' # dec | ||
| ID {$v = 3;} # anID | ||
; | ||
ID : 'a'..'z'+ ; | ||
INT : '0'..'9'+ ; | ||
WS : (' '|'\n') -> skip ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.