diff --git a/contributors.txt b/contributors.txt index 585812c42..81aec6bde 100644 --- a/contributors.txt +++ b/contributors.txt @@ -181,4 +181,5 @@ YYYY/MM/DD, github id, Full name, email 2017/12/20, kbsletten, Kyle Sletten, kbsletten@gmail.com 2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com 2018/02/11, io7m, Mark Raynsford, code@io7m.com -2018/03/26, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com +2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com +2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com \ No newline at end of file diff --git a/doc/javascript-target.md b/doc/javascript-target.md index 3473e95b5..bfc985c06 100644 --- a/doc/javascript-target.md +++ b/doc/javascript-target.md @@ -62,7 +62,7 @@ The steps to create your parsing code are the following: You are now ready to bundle your parsing code as follows: - following webpack specs, create a webpack.config file - in the webpack.config file, exclude node.js only modules using: node: { module: "empty", net: "empty", fs: "empty" } - - from the cmd line, nag-vigate to the directory containing webpack.config and type: webpack + - from the cmd line, navigate to the directory containing webpack.config and type: webpack This will produce a single js file containing all your parsing code. Easy to include in your web pages! diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg index 492c56644..1683a18f8 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg @@ -236,9 +236,12 @@ public class extends { public static final int = }; separator=", ", wrap, anchor>; - public static final String[] ruleNames = { - "}; separator=", ", wrap, anchor> - }; + private static String[] makeRuleNames() { + return new String[] { + "}; separator=", ", wrap, anchor> + }; + } + public static final String[] ruleNames = makeRuleNames(); @@ -275,12 +278,18 @@ case : >> vocabulary(literalNames, symbolicNames) ::= << -private static final String[] _LITERAL_NAMES = { - }; null="null", separator=", ", wrap, anchor> -}; -private static final String[] _SYMBOLIC_NAMES = { - }; null="null", separator=", ", wrap, anchor> -}; +private static String[] makeLiteralNames() { + return new String[] { + }; null="null", separator=", ", wrap, anchor> + }; +} +private static final String[] _LITERAL_NAMES = makeLiteralNames(); +private static String[] makeSymbolicNames() { + return new String[] { + }; null="null", separator=", ", wrap, anchor> + }; +} +private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** @@ -914,9 +923,12 @@ public class extends { "}; separator=", ", wrap, anchor> }; - public static final String[] ruleNames = { - "}; separator=", ", wrap, anchor> - }; + private static String[] makeRuleNames() { + return new String[] { + "}; separator=", ", wrap, anchor> + }; + } + public static final String[] ruleNames = makeRuleNames();