Skip to content

Commit

Permalink
Re-generate D source code
Browse files Browse the repository at this point in the history
  • Loading branch information
linkrope committed Apr 17, 2021
1 parent 770898d commit f269e33
Show file tree
Hide file tree
Showing 23 changed files with 953 additions and 1,514 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Like other language ports, this D runtime library uses UTF-8.
3. You will find the generated ANTLR D-runtime library in lib/libantlr-d.a
4. The ANTLR tool for D will be generated by **make build_examples**
(**./build.ps1 build_examples** on windows)
in build/antlr4-4.9.2/tool/target/antlr4-4.9.2-SNAPSHOT-complete.jar
in build/antlr4-4.9.2/tool/target/antlr4-4.9.2-complete.jar

Consider providing a shortcut to make it easy to use ANTLR.
For example, define an alias:

alias antlr4='java -jar path/to/build/antlr-d/build/antlr4-4.9.2/tool/target/antlr4-4.9.2-SNAPSHOT-complete.jar'
alias antlr4='java -jar path/to/antlr-d/build/antlr4-4.9.2/tool/target/antlr4-4.9.2-complete.jar'

### Dependencies

Expand Down
25 changes: 14 additions & 11 deletions source/antlr/v4/runtime/tree/xpath/XPathLexer.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from XPathLexer.g4 by ANTLR 4.8
// Generated from XPathLexer.g4 by ANTLR 4.9.2
module antlr.v4.runtime.tree.xpath.XPathLexer;

import antlr.v4.runtime.Lexer;
Expand All @@ -20,12 +20,12 @@ import antlr.v4.runtime.LexerNoViableAltException;

public class XPathLexer : Lexer {
alias recover = Lexer.recover;
static this() { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }
static this() { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); }

protected static DFA[] _decisionToDFA;
protected PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static immutable int
public enum int
TOKEN_REF=1,RULE_REF=2,ANYWHERE=3,ROOT=4,WILDCARD=5,BANG=6,ID=7,
STRING=8;
public static string[] channelNames = [
Expand Down Expand Up @@ -56,16 +56,19 @@ public class XPathLexer : Lexer {

static this() {
VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] is null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] is null)
int index = 0;
foreach (ref tokenName; tokenNames)
{
tokenNames[i] = "<INVALID>";
tokenName = VOCABULARY.getLiteralName(index);
if (!tokenName) {
tokenName = VOCABULARY.getSymbolicName(index);
}
if (!tokenName)
{
tokenName = "<INVALID>";
}
}
}
++index;
}

override public string[] getTokenNames() {
Expand Down
2 changes: 1 addition & 1 deletion unittest/complex/RuleTranslatorBaseListener.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from RuleTranslator.g4 by ANTLR 4.8
// Generated from RuleTranslator.g4 by ANTLR 4.9.2

import antlr.v4.runtime.ParserRuleContext;
import antlr.v4.runtime.tree.ErrorNode;
Expand Down
902 changes: 452 additions & 450 deletions unittest/complex/RuleTranslatorLexer.d

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion unittest/complex/RuleTranslatorListener.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from RuleTranslator.g4 by ANTLR 4.8
// Generated from RuleTranslator.g4 by ANTLR 4.9.2
import antlr.v4.runtime.tree.ParseTreeListener;
import RuleTranslatorParser : RuleTranslatorParser;

Expand Down
Loading

0 comments on commit f269e33

Please sign in to comment.