You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ava files. ANTLR4 generates two files with mistake.
Some code from file xidstart.java:
// Generated from src\main\antlr4\imports\xidstart.g4 by ANTLR 4.7
package src.main.antlr4.imports;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.;
import org.antlr.v4.runtime.atn.;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class xidstart extends Lexer {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
Some code from file xidcontinue.java:
// Generated from src\main\antlr4\imports\xidcontinue.g4 by ANTLR 4.7
package src.main.antlr4.imports;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.;
import org.antlr.v4.runtime.atn.;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class xidcontinue extends Lexer {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
Project with code places on https://github.com/onekosha/nb-rust. Apache Maven 3.5.0. Windows 10 64 bit. JDK 1.8.0_141 64 bit. Add files from folder 'generated-sources'. generated-sources.zip
If I use Clojure grammar file all good. I try to use other versions ANTLR4 but it does not help me. I think that problem in xidcontinue.g4 and xidstart.g4 but I find not other newer version for these files. Thanks.
The text was updated successfully, but these errors were encountered:
I had the same problem you had (in another grammar).
You shouldn't try to generate parsers for xidstart.g4 and xidcontinue.g4 (the build.sh script in the mentioned repo doesn't attempt to compile them... are you using it?). These files exist only to be included by the actual grammar, since they have only fragment rules.
Also, you could probably just use [\p{XID_start}] and [\p{XID_continue}] instead of including these files.
About the bug in code generation (where it generates public static final int ;): there is a pull request (#2007) to correct it.
I try to generate from Rust grammar file getting https://github.com/jorendorff/rust-grammar j
ava files. ANTLR4 generates two files with mistake.
Some code from file xidstart.java:
// Generated from src\main\antlr4\imports\xidstart.g4 by ANTLR 4.7
package src.main.antlr4.imports;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.;
import org.antlr.v4.runtime.atn.;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class xidstart extends Lexer {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
Some code from file xidcontinue.java:
// Generated from src\main\antlr4\imports\xidcontinue.g4 by ANTLR 4.7
package src.main.antlr4.imports;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.;
import org.antlr.v4.runtime.atn.;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class xidcontinue extends Lexer {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
Project with code places on https://github.com/onekosha/nb-rust. Apache Maven 3.5.0. Windows 10 64 bit. JDK 1.8.0_141 64 bit. Add files from folder 'generated-sources'.
generated-sources.zip
If I use Clojure grammar file all good. I try to use other versions ANTLR4 but it does not help me. I think that problem in xidcontinue.g4 and xidstart.g4 but I find not other newer version for these files. Thanks.
The text was updated successfully, but these errors were encountered: