| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
0 parents commit a7a9a76
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + #!/bin/bash | ||
| 2 | + | ||
| 3 | + set -e | ||
| 4 | + set -x | ||
| 5 | + | ||
| 6 | + antlr4="java org.antlr.v4.Tool" | ||
| 7 | + grun="java org.antlr.v4.gui.TestRig" | ||
| 8 | + | ||
| 9 | + $antlr4 fortran.g4 | ||
| 10 | + javac fortran*.java | ||
| 11 | + | ||
| 12 | + # Test: | ||
| 13 | + $grun fortran module -tree examples/m1.f90 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + module m1 | ||
| 2 | + implicit none | ||
| 3 | + private | ||
| 4 | + public sp, dp, hp | ||
| 5 | + | ||
| 6 | + | ||
| 7 | + end module | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + grammar fortran; | ||
| 2 | + | ||
| 3 | + module | ||
| 4 | + : 'module' IDENT 'implicit none' private_decl? public_decl? 'end' IDENT? | ||
| 5 | + ; | ||
| 6 | + | ||
| 7 | + private_decl | ||
| 8 | + : 'private' | ||
| 9 | + ; | ||
| 10 | + | ||
| 11 | + public_decl | ||
| 12 | + : 'public' IDENT (',' IDENT)* | ||
| 13 | + ; | ||
| 14 | + | ||
| 15 | + IDENT | ||
| 16 | + : ('a' .. 'z' | 'A' .. 'Z') ('a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_')* | ||
| 17 | + ; | ||
| 18 | + | ||
| 19 | + WS | ||
| 20 | + : [ \t\r\n] -> skip | ||
| 21 | + ; | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments