Closed parrt closed 2 years ago
:) I have to refactor the code but...
What sort of design did you have in mind in terms of interface?
Well, it was kind of working, but it only seems to work for a few grammars like "abb" and "cpp". There's a problem in displaying the parse tree for most grammars, but likely because the server crashes during the parse. But, even with "abb" and "cpp" and I think "java", the parse trees get clipped quite a bit, and I can't ever see the whole tree via scrolling or zooming out.
The changes are simple.
The grammar-v4.js file is generated automatically by a bash script, but the script has a few bugs, so some of the information isn't right. There is a design decision on how much to encode in grammars-v4.js. The antlr-client.js, or even server, could scrape from github.com/antlr/grammars-g4 the information grammars-g4.js contains. I just wanted to focus on getting the UI to work.
Here's the diff in the sources:
diff --git a/.gitignore b/.gitignore
index a1c2a23..50512b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,5 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+target/
+nohup.out
diff --git a/static/index.html b/static/index.html
index 4cc0792..075bf98 100644
--- a/static/index.html
+++ b/static/index.html
@@ -15,6 +15,7 @@
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="css/style.css">
+ <script src="js/grammars-v4.js"></script>
<script src="js/antlr-client.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.10.1/ace.js" type="text/javascript" charset="utf-8"></script>
</head>
@@ -60,6 +61,10 @@
<!-- RUN BUTTON -->
+ <br>
+ <select id="selectgrammar" size=1 onchange="select_grammar(this.value)">
+ <option value="Expr" selected>Expr</option>
+ </select>
<br>
<span class="chunk-header">Start rule</span> <img title="Enter a rule name here from your grammar to the left where parsing should begin for the input specified above. Hit Run to test." src="images/helpicon.png" width="12" align="bottom"><br>
<span class='editor' id="start" contenteditable="true" style="min-height: 1em; min-width: 10em; max-width: 20em">program</span>
diff --git a/static/js/antlr-client.js b/static/js/antlr-client.js
index 5b02fa8..65a09a9 100644
--- a/static/js/antlr-client.js
+++ b/static/js/antlr-client.js
@@ -552,6 +552,70 @@ function setupTreeTabs() {
});
}
+function select_grammar(selectedValue){
+ // Find.
+ var name = $("#selectgrammar option:selected" ).text();
+ console.log(name);
+ const found = grammars_v4.find(function(element)
+ {
+ return element.name == name;
+ });
+ // Set grammar.
+ if (found)
+ {
+ $.get(found.lexer).done(function(data){
+ $("#grammar").data("lexerSession").setValue(data);
+ $("#grammar").data("editor").setSession($("#grammar").data("lexerSession")); // force redraw.
+ $("#parsertab").removeClass("tabs-header-selected");
+ $("#lexertab").addClass("tabs-header-selected");
+ });
+ $.get(found.parser).done(function(data){
+ $("#grammar").data("parserSession").setValue(data);
+ $("#grammar").data("editor").setSession($("#grammar").data("parserSession")); // force redraw.
+ $("#parsertab").addClass("tabs-header-selected");
+ $("#lexertab").removeClass("tabs-header-selected");
+ });
+ $.get(found.example).done(function(data){
+ $("#input").data("session").setValue(data);
+ });
+ $("#start").text(found.start);
+
+/*
+ setupTreeTabs();
+
+ $("#profile_choice").hide();
+ $("#profile_header").hide();
+ $("#profile").hide();
+ $("#profile_choice").click(function () {
+ if ( $("#profile_choice").text().startsWith("Show") ) {
+ $("#profile_choice").text("Hide profiler");
+ $("#profile_header").show();
+ $("#profile").show();
+ }
+ else {
+ $("#profile_choice").text("Show profiler");
+ $("#profile_header").hide();
+ $("#profile").hide();
+ }
+ });
+
+ $("#tool_errors").hide();
+ $("#parse_errors").hide();
+ $("#tool_errors_header").hide();
+ $("#parse_errors_header").hide();
+*/
+ }
+}
+
+function setupSelectGrammarTable() {
+ var selectgrammar = $("#selectgrammar").get(0);
+ var i = 0;
+ for (const g of grammars_v4) {
+ var opt = new Option(g.name, g.name);
+ selectgrammar.options[i] = opt;
+ i = i + 1;
+ }
+}
// MAIN
$(document).ready(function() {
String.prototype.sliceReplace = function (start, end, repl) {
@@ -586,4 +650,5 @@ $(document).ready(function() {
$("#parse_errors").hide();
$("#tool_errors_header").hide();
$("#parse_errors_header").hide();
+ setupSelectGrammarTable();
});
diff --git a/static/js/grammars-v4.js b/static/js/grammars-v4.js
new file mode 100644
index 0000000..50c2a01
--- /dev/null
+++ b/static/js/grammars-v4.js
@@ -0,0 +1,1829 @@
+var grammars_v4 = [
+ {
+ name: "abb",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/abb/abbLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/abb/abbParser.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/abb/examples/robdata.sys"
+ },
+ {
+ name: "abnf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/abnf/Abnf.g4",
+ start: "rulelist",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/abnf/examples/iri.abnf"
+ },
+ {
+ name: "acme",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/acme/acme.g4",
+ start: "acmeCompUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/acme/cmu/ClientAndServerFam.acmetest"
+ },
+ {
+ name: "agc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/agc/agc.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/agc/examples/501_RESTART_TABLES_AND_ROUTINES.agc"
+ },
+ {
+ name: "alef",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alef/alef.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alef/examples/example1.txt"
+ },
+ {
+ name: "algol60",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/algol60/algol60.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/algol60/examples/003_bairstow2.alg"
+ },
+ {
+ name: "alloy",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alloy/alloy.g4",
+ start: "alloyModule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alloy/examples/fact.als"
+ },
+ {
+ name: "alpaca",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alpaca/alpaca.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/alpaca/examples/conway.alp"
+ },
+ {
+ name: "angelscript",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/angelscript/angelscript.g4",
+ start: "script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/angelscript/examples/example1.txt"
+ },
+ {
+ name: "antlr/antlr2",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr2/ANTLRv2Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr2/ANTLRv2Parser.g4",
+ start: "grammar_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr2/examples/ada.g2"
+ },
+ {
+ name: "antlr/antlr3",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr3/ANTLRv3Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr3/ANTLRv3Parser.g4",
+ start: "grammarDef",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr3/examples/Antlr3.g"
+ },
+ {
+ name: "antlr/antlr4",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr4/ANTLRv4Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr4/ANTLRv4Parser.g4",
+ start: "grammarSpec",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/antlr/antlr4/examples/apt.g4"
+ },
+ {
+ name: "apex",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/apex/apex.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/apex/examples/ExampleRunAs.cls"
+ },
+ {
+ name: "arithmetic",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/arithmetic/arithmetic.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/arithmetic/examples/number1.txt"
+ },
+ {
+ name: "asl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asl/ASL.g4",
+ start: "asl",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asl/examples/assignments"
+ },
+ {
+ name: "asm/asm6502",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm6502/asm6502.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm6502/examples/bubblesort.txt"
+ },
+ {
+ name: "asm/asm8080",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm8080/asm8080.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm8080/examples/CPM22.ASM"
+ },
+ {
+ name: "asm/asm8086",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm8086/asm8086.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asm8086/examples/BIOS.A86"
+ },
+ {
+ name: "asm/asmMASM",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asmMASM/asmMASM.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asmMASM/examples/hello.asm"
+ },
+ {
+ name: "asm/asmZ80",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asmZ80/asmZ80.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/asmZ80/examples/CPM22.Z80"
+ },
+ {
+ name: "asm/pdp7",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/pdp7/pdp7.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asm/pdp7/examples/adm.s"
+ },
+ {
+ name: "asn/asn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asn/asn/ASN.g4",
+ start: "modules",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asn/asn/examples/example1.asn"
+ },
+ {
+ name: "asn/asn_3gpp",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asn/asn_3gpp/ASN_3gpp.g4",
+ start: "moduleDefinition",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/asn/asn_3gpp/example3-examples/3gpp.asn"
+ },
+ {
+ name: "b",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/b/b.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/b/examples/example1.b"
+ },
+ {
+ name: "basic",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/basic/jvmBasic.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/basic/a"
+ },
+ {
+ name: "bcpl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bcpl/bcpl.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bcpl/examples/cg8086.b"
+ },
+ {
+ name: "bdf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bdf/bdf.g4",
+ start: "font",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bdf/examples/example1.txt"
+ },
+ {
+ name: "bibcode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bibcode/bibcode.g4",
+ start: "bibcode",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bibcode/examples/example1.txt"
+ },
+ {
+ name: "bnf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bnf/bnf.g4",
+ start: "rulelist",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/bnf/examples/postal.bnf"
+ },
+ {
+ name: "brainflak",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/brainflak/brainflak.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/brainflak/examples/example1.txt"
+ },
+ {
+ name: "brainfuck",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/brainfuck/brainfuck.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/brainfuck/examples/collatz.b"
+ },
+ {
+ name: "c",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/c/C.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/c/examples/add.c"
+ },
+ {
+ name: "calculator",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/calculator/calculator.g4",
+ start: "equation",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/calculator/examples/area.txt"
+ },
+ {
+ name: "callable",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/callable/callable_.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/callable/examples/example1.txt"
+ },
+ {
+ name: "capnproto",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/capnproto/CapnProto.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/capnproto/examples/addressbook.capnp"
+ },
+ {
+ name: "clf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clf/clf.g4",
+ start: "log",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/clf/access_log"
+ },
+ {
+ name: "clif",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clif/CLIF.g4",
+ start: "termseq",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clif/examples/module.clif"
+ },
+ {
+ name: "clojure",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clojure/Clojure.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clojure/examples/example1.txt"
+ },
+ {
+ name: "clu",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clu/clu.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/clu/bottles-examples/133.txt"
+ },
+ {
+ name: "cmake",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cmake/CMake.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cmake/examples/CMakeLists.txt"
+ },
+ {
+ name: "cobol85",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cobol85/Cobol85.g4",
+ start: "startRule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cobol85/examples/example1.txt"
+ },
+ {
+ name: "cookie",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cookie/cookie.g4",
+ start: "cookie",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cookie/examples/example1.txt"
+ },
+ {
+ name: "cool",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cool/COOL.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cool/examples/arith.cl"
+ },
+ {
+ name: "cpp",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cpp/CPP14Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cpp/CPP14Parser.g4",
+ start: "translationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cpp/examples/and_keyword.cpp"
+ },
+ {
+ name: "cql",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cql/cql.g4",
+ start: "cql",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cql/examples/example1.txt"
+ },
+ {
+ name: "cql3",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cql3/CqlLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cql3/CqlParser.g4",
+ start: "root",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cql3/examples/alterKeyspace.cql"
+ },
+ {
+ name: "creole",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/creole/creole.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/creole/examples/bold.txt"
+ },
+ {
+ name: "csharp",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/csharp/CSharpLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/csharp/CSharpParser.g4",
+ start: "compilation_unit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/csharp/examples/AllInOneNoPreprocessor.cs"
+ },
+ {
+ name: "css3",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/css3/css3.g4",
+ start: "stylesheet",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/css3/examples/bootstrap.css"
+ },
+ {
+ name: "csv",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/csv/CSV.g4",
+ start: "csvFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/csv/examples/example1.csv"
+ },
+ {
+ name: "ctl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ctl/ctl.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ctl/examples/example1.txt"
+ },
+ {
+ name: "cto",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cto/CtoLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cto/CtoParser.g4",
+ start: "modelUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/cto/invalid"
+ },
+ {
+ name: "cypher",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cypher/CypherLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cypher/CypherParser.g4",
+ start: "script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/cypher/examples/call1.txt"
+ },
+ {
+ name: "dart2",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dart2/Dart2Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dart2/Dart2Parser.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dart2/examples/collections.dart"
+ },
+ {
+ name: "databank",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/databank/databank.g4",
+ start: "databank",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/databank/examples/example1.db"
+ },
+ {
+ name: "datalog",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/datalog/",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/datalog/examples/example1.txt"
+ },
+ {
+ name: "dice",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dice/DiceNotationLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dice/DiceNotationParser.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dice/examples/arithmetic_dice.txt"
+ },
+ {
+ name: "dif",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dif/dif.g4",
+ start: "dif",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dif/examples/example1.txt"
+ },
+ {
+ name: "doiurl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/doiurl/doiurl.g4",
+ start: "doiuri",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/doiurl/examples/example1.txt"
+ },
+ {
+ name: "dot",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dot/DOT.g4",
+ start: "graph",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/dot/examples/cluster.dot"
+ },
+ {
+ name: "edif300",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/edif300/EDIF300.g4",
+ start: "goal",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/edif300/examples/empty.edf"
+ },
+ {
+ name: "edn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/edn/edn.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/edn/examples/depds.edn"
+ },
+ {
+ name: "erlang",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/erlang/Erlang.g4",
+ start: "forms",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/erlang/examples/fac.P"
+ },
+ {
+ name: "evm-bytecode",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/evm-bytecode/EVMBLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/evm-bytecode/EVMBParser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/evm-bytecode/examples/0xcDA72070E455bb31C7690a170224Ce43623d0B6f"
+ },
+ {
+ name: "fasta",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fasta/fasta.g4",
+ start: "sequence",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fasta/examples/NC_009925.faa"
+ },
+ {
+ name: "fdo91",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fdo91/fdo91.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fdo91/examples/example1.txt"
+ },
+ {
+ name: "fen",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fen/fen.g4",
+ start: "fen",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fen/examples/example1.txt"
+ },
+ {
+ name: "flatbuffers",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/flatbuffers/FlatBuffers.g4",
+ start: "schema",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/flatbuffers/examples/flatbench.fbs"
+ },
+ {
+ name: "flowmatic",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/flowmatic/flowmatic.g4",
+ start: "flowmatic",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/flowmatic/examples/example1.txt"
+ },
+ {
+ name: "focal",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/focal/focal.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/focal/examples/example1.txt"
+ },
+ {
+ name: "fol",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fol/fol.g4",
+ start: "condition",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fol/examples/example1.txt"
+ },
+ {
+ name: "fortran77",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fortran77/Fortran77Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fortran77/Fortran77Parser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/fortran77/examples/example1.txt"
+ },
+ {
+ name: "gdscript",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gdscript/GDScriptLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gdscript/GDScriptParser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gdscript/examples/getnode.gd"
+ },
+ {
+ name: "gedcom",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gedcom/gedcom.g4",
+ start: "gedcom",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gedcom/examples/example1.txt"
+ },
+ {
+ name: "gff3",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gff3/gff3.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gff3/examples/NC_001633.gff"
+ },
+ {
+ name: "gml",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gml/gml.g4",
+ start: "graph",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gml/examples/example1.txt"
+ },
+ {
+ name: "golang",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/golang/GoLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/golang/GoParser.g4",
+ start: "sourceFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/golang/examples/anonymousMethods.go"
+ },
+ {
+ name: "graphstream-dgs",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/graphstream-dgs/DGSLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/graphstream-dgs/DGSParser.g4",
+ start: "dgs",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/graphstream-dgs/examples/attributes.dgs"
+ },
+ {
+ name: "gtin",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gtin/gtin.g4",
+ start: "gtin",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/gtin/examples/bookland1.txt"
+ },
+ {
+ name: "guido",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/guido/guido.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/guido/examples/example1.txt"
+ },
+ {
+ name: "guitartab",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/guitartab/guitartab.g4",
+ start: "tab",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/guitartab/examples/example1.txt"
+ },
+ {
+ name: "haskell",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/haskell/HaskellLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/haskell/HaskellParser.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/haskell/examples/color.hs"
+ },
+ {
+ name: "html",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/html/HTMLLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/html/HTMLParser.g4",
+ start: "htmlDocument",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/html/abc.examples/com.html"
+ },
+ {
+ name: "icalendar",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/icalendar/ICalendar.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/icalendar/examples/example1.ics"
+ },
+ {
+ name: "icon",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/icon/icon.g4",
+ start: "start",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/icon/examples/hello.txt"
+ },
+ {
+ name: "idl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/idl/IDL.g4",
+ start: "specification",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/idl/examples/helloworld.idl"
+ },
+ {
+ name: "inf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/inf/inf.g4",
+ start: "inf",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/inf/examples/example1.txt"
+ },
+ {
+ name: "informix",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/informix/informix.g4",
+ start: "compilation_unit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/informix/examples/example1.txt"
+ },
+ {
+ name: "iri",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/iri/IRI.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/iri/examples/example1.iri"
+ },
+ {
+ name: "iso8601",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/iso8601/iso8601.g4",
+ start: "iso",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/iso8601/examples/b-1-1-cd-b.txt"
+ },
+ {
+ name: "istc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/istc/istc.g4",
+ start: "istc",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/istc/examples/example1.txt"
+ },
+ {
+ name: "itn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/itn/itn.g4",
+ start: "itinerary",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/itn/examples/example1.txt"
+ },
+ {
+ name: "jam",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/jam/jam.g4",
+ start: "jam",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/jam/examples/example1.txt"
+ },
+ {
+ name: "janus",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/janus/janus.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/janus/examples/example1.txt"
+ },
+ {
+ name: "java/java",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java/JavaLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java/JavaParser.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java/examples/AllInOne11.java"
+ },
+ {
+ name: "java/java8",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java8/Java8Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java8/Java8Parser.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java8/examples/helloworld.java"
+ },
+ {
+ name: "java/java9",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java9/Java9Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java9/Java9Parser.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java9/examples/AllInOne8.java"
+ },
+ {
+ name: "javadoc",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javadoc/JavadocLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javadoc/JavadocParser.g4",
+ start: "documentation",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javadoc/examples/javadoc/BlockTagsExample.java"
+ },
+ {
+ name: "javascript/ecmascript",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/ecmascript/ECMAScript.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/ecmascript/examples/helloworld.js"
+ },
+ {
+ name: "javascript/javascript",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/javascript/JavaScriptLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/javascript/JavaScriptParser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/javascript/examples/ArrowFunctions.js"
+ },
+ {
+ name: "javascript/jsx",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/jsx/JavaScriptLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/jsx/JavaScriptParser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/jsx/examples/FileInput.jsx"
+ },
+ {
+ name: "javascript/typescript",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/typescript/TypeScriptLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/typescript/TypeScriptParser.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/javascript/typescript/examples/AbstractClass.ts"
+ },
+ {
+ name: "jpa",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/jpa/JPA.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/jpa/examples/example1.txt"
+ },
+ {
+ name: "json",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/json/JSON.g4",
+ start: "json",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/json/examples/example1.json"
+ },
+ {
+ name: "json5",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/json5/JSON5.g4",
+ start: "json5",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/json5/examples/example1.json"
+ },
+ {
+ name: "karel",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/karel/karel.g4",
+ start: "karel",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/karel/examples/example1.txt"
+ },
+ {
+ name: "kotlin/kotlin-formal",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kotlin/kotlin-formal/KotlinLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kotlin/kotlin-formal/KotlinParser.g4",
+ start: "kotlinFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kotlin/kotlin-examples/formal/fuzzer"
+ },
+ {
+ name: "kquery",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kquery/KQuery.g4",
+ start: "kqueryExpression",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kquery/examples/test1.kquery"
+ },
+ {
+ name: "kuka",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kuka/krl.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/kuka/examples/example1.txt"
+ },
+ {
+ name: "lambda",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lambda/lambda.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lambda/examples/example1.txt"
+ },
+ {
+ name: "lark",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lark/LarkLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lark/LarkParser.g4",
+ start: "start",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lark/examples/ab.lark"
+ },
+ {
+ name: "lcc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lcc/lcc.g4",
+ start: "lcc",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lcc/examples/brief_history_of_time.txt"
+ },
+ {
+ name: "less",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/less/LessLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/less/LessParser.g4",
+ start: "stylesheet",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/less/examples/example1.less"
+ },
+ {
+ name: "limbo",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/limbo/limbo.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/limbo/examples/example1.txt"
+ },
+ {
+ name: "lisa",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lisa/lisa.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lisa/examples/example1.txt"
+ },
+ {
+ name: "logo/logo",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/logo/logo/logo.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/logo/logo/examples/example1.txt"
+ },
+ {
+ name: "logo/ucb-logo",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/logo/ucb-logo/UCBLogo.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/logo/ucb-logo/examples/example1.txt"
+ },
+ {
+ name: "lolcode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lolcode/lolcode.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lolcode/examples/hai.txt"
+ },
+ {
+ name: "loop",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/loop/loop.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/loop/examples/example1.txt"
+ },
+ {
+ name: "lpc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lpc/LPC.g4",
+ start: "lpc_program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lpc/examples/example1.c"
+ },
+ {
+ name: "lrc",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lrc/lrcLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lrc/lrcParser.g4",
+ start: "lrc",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lrc/examples/example1.txt"
+ },
+ {
+ name: "ltl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ltl/ltl.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ltl/examples/example1.txt"
+ },
+ {
+ name: "lua",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lua/Lua.g4",
+ start: "chunk",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lua/examples/factorial.lua"
+ },
+ {
+ name: "lucene",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lucene/LuceneLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lucene/LuceneParser.g4",
+ start: "topLevelQuery",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/lucene/boolean-examples/1.txt"
+ },
+ {
+ name: "matlab",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/matlab/matlab.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/matlab/examples/example1.txt"
+ },
+ {
+ name: "mckeeman-form",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mckeeman-form/McKeemanForm.g4",
+ start: "grammar_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mckeeman-form/examples/json.txt"
+ },
+ {
+ name: "mdx",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mdx/mdx.g4",
+ start: "mdx_statement",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mdx/examples/example1.txt"
+ },
+ {
+ name: "memcached_protocol",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/memcached_protocol/memcached_protocol.g4",
+ start: "command_line",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/memcached_protocol/examples/example1.txt"
+ },
+ {
+ name: "metamath",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/metamath/metamath.g4",
+ start: "database",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/metamath/examples/example1.txt"
+ },
+ {
+ name: "metric",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/metric/metric.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/metric/examples/cm.txt"
+ },
+ {
+ name: "microc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/microc/microc.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/microc/examples/example1.c"
+ },
+ {
+ name: "modelica",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/modelica/modelica.g4",
+ start: "stored_definition",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/modelica/examples/Complex.mo"
+ },
+ {
+ name: "modula2pim4",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/modula2pim4/m2pim4.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/modula2pim4/examples/example1.txt"
+ },
+ {
+ name: "molecule",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/molecule/molecule.g4",
+ start: "molecule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/molecule/examples/(NH4)2[Pt(SCN)6].txt"
+ },
+ {
+ name: "moo",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/moo/moo.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/moo/examples/cupcake.txt"
+ },
+ {
+ name: "morsecode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/morsecode/morsecode.g4",
+ start: "morsecode",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/morsecode/examples/SMS.txt"
+ },
+ {
+ name: "mps",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mps/mps.g4",
+ start: "modell",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mps/examples/example1.mps"
+ },
+ {
+ name: "muddb",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/muddb/muddb.g4",
+ start: "db",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/muddb/examples/minimal.db"
+ },
+ {
+ name: "mumath",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mumath/mumath.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mumath/examples/example1.txt"
+ },
+ {
+ name: "mumps",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mumps/mumps.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/mumps/examples/epic_questions.m"
+ },
+ {
+ name: "muparser",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/muparser/MuParser.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/muparser/examples/example1.txt"
+ },
+ {
+ name: "nanofuck",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/nanofuck/nanofuck.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/nanofuck/examples/example1.txt"
+ },
+ {
+ name: "newick",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/newick/newick.g4",
+ start: "tree_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/newick/examples/example1.txt"
+ },
+ {
+ name: "oberon",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/oberon/oberon.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/oberon/examples/hello.txt"
+ },
+ {
+ name: "ocl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ocl/OCL.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ocl/examples/bondApp.km3"
+ },
+ {
+ name: "oncrpc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/oncrpc/oncrpcv2.g4",
+ start: "oncrpcv2Specification",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/oncrpc/examples/CalculatorService.x"
+ },
+ {
+ name: "orwell",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/orwell/orwell.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/orwell/examples/example1.txt"
+ },
+ {
+ name: "p",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/p/p.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/p/examples/example1.txt"
+ },
+ {
+ name: "parkingsign",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/parkingsign/parkingsign.g4",
+ start: "parkingSigns",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/parkingsign/examples/example1.txt"
+ },
+ {
+ name: "pascal",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pascal/pascal.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pascal/examples/947.pas"
+ },
+ {
+ name: "pbm",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pbm/pbm.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pbm/examples/example1.txt"
+ },
+ {
+ name: "pcre",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pcre/PCRE.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pcre/examples/apache.txt"
+ },
+ {
+ name: "pdn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pdn/pdn.g4",
+ start: "game",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pdn/examples/example1.txt"
+ },
+ {
+ name: "peoplecode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/peoplecode/PeopleCode.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/peoplecode/examples/AppClassPC.SSF_SS_PMT.SSF_Student.Student.OnExecute.pc",
+ },
+ {
+ name: "pgn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pgn/PGN.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pgn/Adams - examples/OK.pgn"
+ },
+ {
+ name: "php",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/php/PhpLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/php/PhpParser.g4",
+ start: "htmlDocument",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/php/examples/alternativeSyntax.php"
+ },
+ {
+ name: "pii",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pii/pii.g4",
+ start: "pii",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pii/examples/example1.txt"
+ },
+ {
+ name: "pl0",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pl0/pl0.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/pl0/examples/example1.txt"
+ },
+ {
+ name: "ply",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ply/ply.g4",
+ start: "ply",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ply/examples/airplane.ply"
+ },
+ {
+ name: "postalcode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/postalcode/postalcode.g4",
+ start: "postalcode",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/postalcode/examples/example1.txt"
+ },
+ {
+ name: "powerbuilder",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/powerbuilder/PowerBuilderLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/powerbuilder/PowerBuilderParser.g4",
+ start: "start_rule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/powerbuilder/examples/example1.txt"
+ },
+ {
+ name: "prolog",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/prolog/prolog.g4",
+ start: "p_text",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/prolog/examples/example1.txt"
+ },
+ {
+ name: "promql",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/promql/PromQLLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/promql/PromQLParser.g4",
+ start: "expression",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/promql/examples/aggregation1.txt"
+ },
+ {
+ name: "propcalc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/propcalc/propcalc.g4",
+ start: "proposition",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/propcalc/examples/commute1.txt"
+ },
+ {
+ name: "properties",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/properties/properties.g4",
+ start: "propertiesFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/properties/examples/ebean.properties"
+ },
+ {
+ name: "protobuf2",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/protobuf2/Protobuf2.g4",
+ start: "proto",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/protobuf2/examples/demo.proto"
+ },
+ {
+ name: "protobuf3",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/protobuf3/Protobuf3.g4",
+ start: "proto",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/protobuf3/examples/addressbook.proto"
+ },
+ {
+ name: "prov-n",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/prov-n/PROV_N.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/prov-n/examples/example1.provn"
+ },
+ {
+ name: "python/python",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python/PythonLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python/PythonParser.g4",
+ start: "root",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python/examples/argument.py"
+ },
+ {
+ name: "python/python3",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3/Python3Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3/Python3Parser.g4",
+ start: "file_input",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3/examples/__init__.py"
+ },
+ {
+ name: "python/python3-py",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3-py/Python3.g4",
+ start: "",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3-py/examples/new_features.py"
+ },
+ {
+ name: "python/python3alt",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3alt/AltPython3.g4",
+ start: "file_input",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/python/python3alt/examples/shaldq.py"
+ },
+ {
+ name: "qif",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/qif/qifLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/qif/qifParser.g4",
+ start: "qif",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/qif/examples/example1.txt"
+ },
+ {
+ name: "quakemap",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/quakemap/quakemap.g4",
+ start: "map_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/quakemap/examples/example1.map"
+ },
+ {
+ name: "racket-bsl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/racket-bsl/BSL.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/racket-bsl/temperature-examples/conversion.rkt"
+ },
+ {
+ name: "racket-isl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/racket-isl/ISL.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/racket-isl/list-examples/contains.rkt"
+ },
+ {
+ name: "redcode",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/redcode/redcode.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/redcode/examples/bigfoot.txt"
+ },
+ {
+ name: "refal",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/refal/refal.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/refal/examples/example1.txt"
+ },
+ {
+ name: "rego",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rego/RegoLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rego/RegoParser.g4",
+ start: "root",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rego/examples/00000.stmt"
+ },
+ {
+ name: "rexx",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rexx/RexxLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rexx/RexxParser.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rexx/examples/example1.txt"
+ },
+ {
+ name: "rfc1035",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc1035/domain.g4",
+ start: "domain",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc1035/examples/example1.txt"
+ },
+ {
+ name: "rfc1960",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc1960/filter.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc1960/examples/example1.txt"
+ },
+ {
+ name: "rfc822/rfc822-datetime",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc822/rfc822-datetime/datetime.g4",
+ start: "date_time",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc822/rfc822-datetime/examples/example1.txt"
+ },
+ {
+ name: "rfc822/rfc822-emailaddress",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc822/rfc822-emailaddress/emailaddress.g4",
+ start: "emailaddress",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rfc822/rfc822-emailaddress/examples/example1.txt"
+ },
+ {
+ name: "robotwars",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/robotwars/robotwar.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/robotwars/examples/bottom.txt"
+ },
+ {
+ name: "romannumerals",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/romannumerals/romannumerals.g4",
+ start: "expression",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/romannumerals/examples/I.txt"
+ },
+ {
+ name: "rpn",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rpn/rpn.g4",
+ start: "expression",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rpn/examples/cos.txt"
+ },
+ {
+ name: "ruby",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ruby/Corundum.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ruby/examples/test.rb"
+ },
+ {
+ name: "rust",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rust/RustLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rust/RustParser.g4",
+ start: "crate",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/rust/examples/comment.rs"
+ },
+ {
+ name: "scala",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scala/Scala.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scala/examples/class.scala"
+ },
+ {
+ name: "scotty",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scotty/scotty.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scotty/examples/example1.txt"
+ },
+ {
+ name: "scss",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scss/ScssLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scss/ScssParser.g4",
+ start: "stylesheet",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/scss/examples/basic.scss"
+ },
+ {
+ name: "sexpression",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sexpression/sexpression.g4",
+ start: "sexpr",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sexpression/examples/example1.txt"
+ },
+ {
+ name: "sgf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sgf/sgf.g4",
+ start: "collection",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sgf/8718-KuroNeko-creedfoxx-examples/chensicha.sgf"
+ },
+ {
+ name: "sici",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sici/sici.g4",
+ start: "sici",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sici/examples/example1.txt"
+ },
+ {
+ name: "sickbay",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sickbay/sickbay.g4",
+ start: "sickbay",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sickbay/examples/hello.txt"
+ },
+ {
+ name: "sieve",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sieve/sieve.g4",
+ start: "start",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sieve/examples/example1.txt"
+ },
+ {
+ name: "smalltalk",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smalltalk/Smalltalk.g4",
+ start: "script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smalltalk/examples/helloworld.st"
+ },
+ {
+ name: "smiles",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smiles/smiles.g4",
+ start: "smiles",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smiles/examples/biphenyl.txt"
+ },
+ {
+ name: "smtlibv2",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smtlibv2/SMTLIBv2.g4",
+ start: "start",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/smtlibv2/examples/kaluzalong.smt2"
+ },
+ {
+ name: "snobol",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/snobol/snobol.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/snobol/examples/example1.sno"
+ },
+ {
+ name: "snowball",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/snowball/snowball.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/snowball/examples/example1.txt"
+ },
+ {
+ name: "sparql",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sparql/Sparql.g4",
+ start: "query",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sparql/examples/example1.txt"
+ },
+ {
+ name: "spass",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/spass/SpassLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/spass/SpassParser.g4",
+ start: "problem",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/spass/examples/pelleter_57.spass"
+ },
+ {
+ name: "sql/plsql",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/plsql/PlSqlLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/plsql/PlSqlParser.g4",
+ start: "sql_script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/plsql/examples/aggregate01.sql"
+ },
+ {
+ name: "sql/postgresql",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/postgresql/PostgreSQLLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/postgresql/PostgreSQLParser.g4",
+ start: "root",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/postgresql/examples/advisory_lock.sql"
+ },
+ {
+ name: "sql/sqlite",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/sqlite/SQLiteLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/sqlite/SQLiteParser.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/sqlite/alter-table-drop-examples/column.sql"
+ },
+ {
+ name: "sql/trino",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/trino/TrinoLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/trino/TrinoParser.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/trino/examples/aggregation_filter.sql"
+ },
+ {
+ name: "sql/tsql",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/tsql/TSqlLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/tsql/TSqlParser.g4",
+ start: "tsql_file",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/sql/tsql/examples/analytic_windowed_functions.sql"
+ },
+ {
+ name: "star",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/star/star.g4",
+ start: "star",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/star/examples/example1.txt"
+ },
+ {
+ name: "stellaris",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/stellaris/stellaris.g4",
+ start: "content",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/stellaris/examples/aleran_ai_events.txt"
+ },
+ {
+ name: "stringtemplate",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/stringtemplate/STGLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/stringtemplate/STGParser.g4",
+ start: "template_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/stringtemplate/examples/example1.st"
+ },
+ {
+ name: "suokif",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/suokif/SUOKIF.g4",
+ start: "top_level",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/suokif/examples/example1.txt"
+ },
+ {
+ name: "swift/swift2",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift2/Swift2.g4",
+ start: "top_level",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift2/examples/AppDelegate.swift"
+ },
+ {
+ name: "swift/swift3",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift3/Swift3.g4",
+ start: "top_level",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/examples/swift3/CodeSamples"
+ },
+ {
+ name: "swift/swift5",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift5/Swift5Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift5/Swift5Parser.g4",
+ start: "top_level",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift/swift5/examples/Control Flow"
+ },
+ {
+ name: "swift-fin",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift-fin/SwiftFinLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift-fin/SwiftFinParser.g4",
+ start: "messages",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/swift-fin/examples/complex1.txt"
+ },
+ {
+ name: "szf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/szf/szf.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/szf/examples/example1.txt"
+ },
+ {
+ name: "tcpheader",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tcpheader/tcp.g4",
+ start: "segmentheader",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tcpheader/examples/example1.bin"
+ },
+ {
+ name: "teal",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/teal/Teal.g4",
+ start: "chunk",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/teal/examples/arrays.tl"
+ },
+ {
+ name: "telephone",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/telephone/telephone.g4",
+ start: "test",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/telephone/examples/example1.txt"
+ },
+ {
+ name: "terraform",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/terraform/terraform.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/terraform/examples/array.tf"
+ },
+ {
+ name: "thrift",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/thrift/Thrift.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/thrift/examples/cassandra.thrift"
+ },
+ {
+ name: "tiny",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tiny/tiny.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tiny/examples/example1.txt"
+ },
+ {
+ name: "tinybasic",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinybasic/tinybasic.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinybasic/examples/example1.txt"
+ },
+ {
+ name: "tinyc",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinyc/tinyc.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinyc/examples/example1.c"
+ },
+ {
+ name: "tinymud",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinymud/tinymud.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinymud/examples/example1.txt"
+ },
+ {
+ name: "tinyos_nesc",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinyos_nesc/TinyosLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tinyos_nesc/TinyosParser.g4",
+ start: "compilationUnit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/tinyos_nesc/Blink"
+ },
+ {
+ name: "tnsnames",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tnsnames/tnsnamesLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tnsnames/tnsnamesParser.g4",
+ start: "tnsnames",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tnsnames/tnsnames.examples/test.ora"
+ },
+ {
+ name: "tnt",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tnt/tnt.g4",
+ start: "equation",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tnt/examples/aprimeprimeequalsfive.txt"
+ },
+ {
+ name: "toml",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/toml/toml.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/toml/examples/fruit.toml"
+ },
+ {
+ name: "trac",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/trac/trac.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/trac/examples/example1.txt"
+ },
+ {
+ name: "tsv",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tsv/tsv.g4",
+ start: "tsvFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/tsv/examples/example1.txt"
+ },
+ {
+ name: "ttm",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ttm/ttm.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/ttm/examples/example1.txt"
+ },
+ {
+ name: "turing",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/turing/turing.g4",
+ start: "program",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/turing/examples/example1.txt"
+ },
+ {
+ name: "turtle",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/turtle/TURTLE.g4",
+ start: "turtleDoc",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/turtle/schema.examples/org.ttl"
+ },
+ {
+ name: "unicode/graphemes",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/unicode/graphemes/Graphemes.g4",
+ start: "graphemes",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/unicode/graphemes/examples/ascii.txt"
+ },
+ {
+ name: "unreal_angelscript",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/unreal_angelscript/UnrealAngelscriptLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/unreal_angelscript/UnrealAngelscriptParser.g4",
+ start: "script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/unreal_angelscript/examples/Example_Actor.as"
+ },
+ {
+ name: "upnp",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/upnp/Upnp.g4",
+ start: "searchCrit",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/upnp/examples/search1.upnp"
+ },
+ {
+ name: "url",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/url/url.g4",
+ start: "url",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/url/examples/example1.txt"
+ },
+ {
+ name: "useragent",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/useragent/useragent.g4",
+ start: "prog",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/useragent/examples/example1.txt"
+ },
+ {
+ name: "v",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/v/V.g4",
+ start: "sourceFile",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/v/examples/helloworld.v"
+ },
+ {
+ name: "vb6",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vb6/VisualBasic6Lexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vb6/VisualBasic6Parser.g4",
+ start: "startRule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/examples/vb6/calls"
+ },
+ {
+ name: "vba",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vba/vba.g4",
+ start: "startRule",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vba/examples/example1.bas"
+ },
+ {
+ name: "velocity",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/velocity/VTLLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/velocity/VTLParser.g4",
+ start: "parse",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/velocity/examples/block_comment.vm"
+ },
+ {
+ name: "verilog/systemverilog",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/systemverilog/SystemVerilogLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/systemverilog/SystemVerilogParser.g4",
+ start: "source_text",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/systemverilog/examples/CoreSHA1.svh"
+ },
+ {
+ name: "verilog/verilog",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/verilog/VerilogLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/verilog/VerilogParser.g4",
+ start: "source_text",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/verilog/verilog/examples/axiluart.v"
+ },
+ {
+ name: "vhdl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vhdl/vhdl.g4",
+ start: "design_file",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vhdl/examples/add_pkg.vhd"
+ },
+ {
+ name: "vmf",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vmf/vmf.g4",
+ start: "vmf",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/vmf/examples/example1.txt"
+ },
+ {
+ name: "wat",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wat/WatLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wat/WatParser.g4",
+ start: "module",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wat/examples/shared1.wat"
+ },
+ {
+ name: "wavefront",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wavefront/WavefrontOBJ.g4",
+ start: "start",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wavefront/examples/b1_14_bezier_in_u_direction_with_b_spline_in_v_direction_with_basis_matrix.txt"
+ },
+ {
+ name: "webidl",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/webidl/WebIDL.g4",
+ start: "webIDL",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/webidl/examples/document.idl"
+ },
+ {
+ name: "wkt",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wkt/wkt.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wkt/examples/example1.txt"
+ },
+ {
+ name: "wln",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wln/wln.g4",
+ start: "wln",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wln/examples/acetone.txt"
+ },
+ {
+ name: "wren",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wren/WrenLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wren/WrenParser.g4",
+ start: "script",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/wren/examples/binary_tree.wren"
+ },
+ {
+ name: "xml",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xml/XMLLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xml/XMLParser.g4",
+ start: "document",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xml/examples/books.xml"
+ },
+ {
+ name: "xpath/xpath1",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath1/xpath.g4",
+ start: "main",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath1/examples/example1.txt"
+ },
+ {
+ name: "xpath/xpath20",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath20/XPath20.g4",
+ start: "auxilary",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath20/examples/expressions.txt"
+ },
+ {
+ name: "xpath/xpath31",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath31/XPath31.g4",
+ start: "auxilary",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xpath/xpath31/examples/expressions.txt"
+ },
+ {
+ name: "xsd-regex",
+ lexer: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xsd-regex/regexLexer.g4",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xsd-regex/regexParser.g4",
+ start: "root",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xsd-regex/example-examples/any.txt"
+ },
+ {
+ name: "xyz",
+ lexer: "",
+ parser: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xyz/xyz.g4",
+ start: "file_",
+ example: "https://raw.githubusercontent.com/antlr/grammars-v4/master/xyz/examples/example1.txt"
+ },
+];
groovy. yep, let's figure out how it should work first then worry about details. Should it be a button near the grammar tabs that pops up a "file" chooser?
Qualification: I'm not a GUI guy so who knows what's the best way to do this. In fact, I just started coding the details just to see if I can get JS to read files given a URL!
I started with a basic "logical view" of grammars-v4, which is literally just the list {abb, abnf, ..., cpp, ..., java, xpath/xpath1, ..., z}
, a flat list of grammars by name. Incidentally, there was some discussion of a different organization of the grammars in grammars-v4, https://github.com/antlr/grammars-v4/issues/2826 and https://github.com/antlr/grammars-v4/pull/2830 . So, we could have something that organizes the grammars by a classification like here. Instead of a "list", the grammars could be a table of much more than name, e.g., <grammar name, date created, type of programming language, last updated, version, author of grammar, ...>
. Really, the sky is the limit. This could be a wonderful teaching tool in how programming language grammars are classified.
The selection of a grammar could be a pop-up from a button, but I thought an html select
element was fine because it is just a list. I put it right above the Run
button. But it could go anywhere you think best. Originally I thought it should be right at the top of the window, but moved to near the Run
button because I thought you may want to Select a grammar
, Run
, then quickly move on to the next grammar in the list.
The select list contents is just the names of all the grammars in grammars-g4. When a grammar is selected, the lexer, parser, start symbol, and input UI are all set up for that grammar by reading the files from github.com.
So, these are some screenshots of the UI.
I fixed the crashes that occur for most grammars--I forgot to set the lexer grammar to an empty string for combined grammars. Latest here.
Geezuz. This thing really works for many grammars. There's some "BAD JSON RESPONSE" logs in the client, e.g., acme. And the GUI crops the SVG image, providing no horizontal scrolling only vertical.
But, this is fabulous. I can go through grammars very quickly and evaluate the performance profile on a sample. I already see lots of grammar problems, e.g., cpp with declarations and expressions.
woohoo! Let me check it out and get back to you...might be a few days before I have time. thanks for doing this!
I've split the "grammar select control" into two, one for selecting a grammar in grammars-v4, and the other to select one of the input files in examples/ directory for the grammar. I moved them around to be nearby the two flex panes. But, you can see that I'm not a GUI guy.
After writing this implementation, I think there needs to be some kind of meta created for grammars-v4 that will reflect the information contained in grammars-v4.js.
It takes around 10 minutes to traverse down the file system of grammars-v4 to compute this information, not counting the time to do the "git clone". Although it is currently done using a bash script, It's clear that the client should not be querying the file system over the internet to compute this information!
The server could do this periodically, e.g., once a day. But, it would be out of date relative to the checkin's that occur on grammars-v4. The alternative would be to create an xml doc over on grammars-v4 on merges. The client could use to create the internal data structures.
The only other alternative would be, as you said, a "file browser" that lazily presents the repo over the internet. However, as I mentioned before, we might reorganize the repo, which would then make "file browsing" harder to find what you want.
Quick question: how do you filter out the grammars that won't work, such as the ones that have semantic predicates?
It takes around 10 minutes to traverse down the file system of grammars-v4
Isn't there some way to traverse grammars-v4 using the github API (python) or just URLs via fetches? Example: https://github.com/antlr/antlr4/blob/master/scripts/github_release_notes.py Ah. I think you suggest something like that later in your comment.
After writing this implementation, I think there needs to be some kind of meta created for grammars-v4 that will reflect the information contained in grammars-v4.js.
So maybe we run some thing with an action on the grammars repository and keep the file over there. Then the lab can simply load the file as json.
This code confuses me a bit
$.get(found.lexer).done(function(data){
This code confuses me a bit
$.get(found.lexer).done(function(data){
Ah, that took a while of googling to figure that one out. It's AJAX to "get"/download a file given a URL. "found" is an element of array "grammars-v4" that was just found by looking for the name of the grammar; "lexer" is the field name on the object, which stores the URL of the lexer grammar. The function "function(data){ ...}" is called after the client gets back the file as string from the internet. It modifies the lexer grammar window with that string.
Quick question: how do you filter out the grammars that won't work, such as the ones that have semantic predicates?
Yes, the bash script doesn't do that computation. It just includes the grammar if there's a pom.xml (it just does a "find . -name pom.xml" at the top). So, the grammar may not work--but sometime it might. I think C or CPP has one semantic predicate but it's rarely executed, so the grammar works most of the time.
Isn't there some way to traverse grammars-v4 using the github API (python) or just URLs via fetches?
Yes, the client could do this over the internet. The best way would be to fetch the "root pom.xml" at https://github.com/antlr/grammars-v4/blob/master/pom.xml and follow the links to nested pom.xml till you get "grammar pom.xml" e.g., https://github.com/antlr/grammars-v4/blob/master/antlr/antlr4/pom.xml . That pom.xml contains the grammars and start symbol, but not the examples (only where the examples are).
One reason why the bash script took 10 minutes it doesn't look at the root pom.xml. And it also does a "find examples/ -type f" to get the list of example inputs.
So maybe we run some thing with an action on the grammars repository and keep the file over there. Then the lab can simply load the file as json.
Maybe. Or maybe just try doing this with the root pom.xml. Fetching the root is easy. But, having the client do a DFS traverse of the pom's to all the grammars will fetch hundreds of pom.xml. Unless we remove intermediate pom.xml like here, make the pom.xml tree completely flat, then the list of grammars would just be in the root pom.xml.
Or we have the CI build over in github do the computation (chase down pom.xml, check if the grammar doesn't contain semantic predicates, get a list of examples).
Without looking at the repository for the grammar is, my knee jerk reaction would be simply to find all grammar files and group them in case there are split grammars. Then see if I can find the examples, assuming there is a common directory name for the examples.
Looks like things are fairly consistent though there is examples directories or two that have subdirectories; perhaps those could be hammered out. Then we simply have to collect all of the grammar files and examples directories underneath. That shouldn't take 10 minutes of cpu time I don't think.
Ah, that took a while of googling to figure that one out. It's AJAX to "get"/download a file given a URL.
I'm using axios which hide all of that :) E.g.,
await axios.post(ANTLR_SERVICE,
{grammar: g, lexgrammar: lg, input: I, start: s}
)
.then(processANTLRResults)
.catch((error) => {
if( error.response ){
console.log(error.response.data); // => the response payload
}
});
To do a simple fetch I think it looks like
axios.get('url')
.then((response) => {
// Code for handling the response
})
.catch((error) => {
// Code for handling the error
})
@kaby76 See https://github.com/antlr/grammars-v4/issues/2866 where I have created an already submitted, by mistake, a python implementation of your bash script that I think is a lot easier to read. Also executes instantly. :)
I just updated the "selectinput" control in my code to not expand the RHS pane from taking over the screen when a grammar is selected https://github.com/kaby76/antlr4-lab/blob/374447904cbf351997d3b14d36ab5bb4442206b6/static/js/antlr-client.js#L612 . Basically the "option" element of the select element has a "label" and a "value". The label is a short version of the input path, and the value is the full URL of the input file to parse.
I'll take a look at your grammars-v4 indexer.
not expand the RHS pane from taking over the screen when a grammar is selected
yeah, i'm looking at allowing vertical expansive in RHS pane today...just a heads up. should be able to expand parse tree and input window I guess.
(I'm also working on a docker thing so people can run more easily)
I have a droplet running the antlr4-lab server over here for a while: http://134.209.209.215/
@kaby76 @parrt does it work any more?
I found grammar drop-downs to be empty. I tried it in:
a. Safari
b. Chrome
It's using the old grammars.json. I have to get Tom to create a fine-grain PAT then update the code here. Will finish this change over to the artifact in a couple of days.
It's working for me with Chrome Version 108.0.5359.125, Edge Version 108.0.1462.54, Firefox 108.0, all on Windows 11. The grammars.json file is still there, although it is slowly getting out of synch w.r.t. the actual grammars and files there.
ok, still same issue for me 🙁
I am using Mac, Safari version: 16.0
Is it possible to open up the console for the browser and see if there are any exceptions raised?
Hmm...works on Mac OS 13.0.1 with chrome and safari for me. M1 silicon.
I'll have a PR for this shortly. Code looks good, easy to add this, works great!