forked from jasder/antlr
Set version in code to 4.6.
This commit is contained in:
parent
bbfca7c99c
commit
ffaedd209d
|
@ -45,7 +45,7 @@ var tokenTypeMapCache = make(map[string]int)
|
|||
var ruleIndexMapCache = make(map[string]int)
|
||||
|
||||
func (b *BaseRecognizer) checkVersion(toolVersion string) {
|
||||
runtimeVersion := "4.5.2"
|
||||
runtimeVersion := "4.6"
|
||||
if runtimeVersion != toolVersion {
|
||||
fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.5</version>
|
||||
<version>4.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>antlr</id>
|
||||
|
|
|
@ -91,7 +91,7 @@ public class RuntimeMetaData {
|
|||
* omitted.</li>
|
||||
* </ul>
|
||||
*/
|
||||
public static final String VERSION = "4.5.3";
|
||||
public static final String VERSION = "4.6";
|
||||
|
||||
/**
|
||||
* Gets the currently executing version of the ANTLR 4 runtime library.
|
||||
|
|
|
@ -45,7 +45,7 @@ Recognizer.ruleIndexMapCache = {};
|
|||
|
||||
|
||||
Recognizer.prototype.checkVersion = function(toolVersion) {
|
||||
var runtimeVersion = "4.5.3";
|
||||
var runtimeVersion = "4.6";
|
||||
if (runtimeVersion!==toolVersion) {
|
||||
console.log("ANTLR runtime and generated code versions disagree: "+runtimeVersion+"!="+toolVersion);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "antlr4",
|
||||
"version": "4.5.3",
|
||||
"version": "4.6",
|
||||
"description": "JavaScript runtime for ANTLR4",
|
||||
"main": "src/antlr4/index.js",
|
||||
"repository": "antlr/antlr4.git",
|
||||
|
|
|
@ -2,12 +2,12 @@ from distutils.core import setup
|
|||
|
||||
setup(
|
||||
name='antlr4-python2-runtime',
|
||||
version='4.5.3',
|
||||
version='4.6',
|
||||
packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'],
|
||||
package_dir={'': 'src'},
|
||||
url='http://www.antlr.org',
|
||||
license='BSD',
|
||||
author='Eric Vergnaud, Terence Parr, Sam Harwell',
|
||||
author_email='eric.vergnaud@wanadoo.fr',
|
||||
description='ANTLR 4.5.3 runtime for Python 2.7.6'
|
||||
description='ANTLR 4.6 runtime for Python 2.7.6'
|
||||
)
|
||||
|
|
|
@ -55,7 +55,7 @@ class Recognizer(object):
|
|||
return major, minor
|
||||
|
||||
def checkVersion(self, toolVersion):
|
||||
runtimeVersion = "4.5.3"
|
||||
runtimeVersion = "4.6"
|
||||
rvmajor, rvminor = self.extractVersion(runtimeVersion)
|
||||
tvmajor, tvminor = self.extractVersion(toolVersion)
|
||||
if rvmajor!=tvmajor or rvminor!=tvminor:
|
||||
|
@ -66,10 +66,10 @@ class Recognizer(object):
|
|||
|
||||
def removeErrorListener(self, listener):
|
||||
self._listeners.remove(listener)
|
||||
|
||||
|
||||
def removeErrorListeners(self):
|
||||
self._listeners = []
|
||||
|
||||
|
||||
def getTokenTypeMap(self):
|
||||
tokenNames = self.getTokenNames()
|
||||
if tokenNames is None:
|
||||
|
|
|
@ -2,12 +2,12 @@ from distutils.core import setup
|
|||
|
||||
setup(
|
||||
name='antlr4-python3-runtime',
|
||||
version='4.5.3',
|
||||
version='4.6',
|
||||
packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'],
|
||||
package_dir={'': 'src'},
|
||||
url='http://www.antlr.org',
|
||||
license='BSD',
|
||||
author='Eric Vergnaud, Terence Parr, Sam Harwell',
|
||||
author_email='eric.vergnaud@wanadoo.fr',
|
||||
description='ANTLR 4.5.3 runtime for Python 3.4.0'
|
||||
description='ANTLR 4.6 runtime for Python 3.4.0'
|
||||
)
|
||||
|
|
|
@ -58,7 +58,7 @@ class Recognizer(object):
|
|||
return major, minor
|
||||
|
||||
def checkVersion(self, toolVersion):
|
||||
runtimeVersion = "4.5.3"
|
||||
runtimeVersion = "4.6"
|
||||
rvmajor, rvminor = self.extractVersion(runtimeVersion)
|
||||
tvmajor, tvminor = self.extractVersion(toolVersion)
|
||||
if rvmajor!=tvmajor or rvminor!=tvminor:
|
||||
|
|
|
@ -42,20 +42,19 @@
|
|||
# <p>
|
||||
# Whitespace is not allowed.</p>
|
||||
#
|
||||
from xmlrpc.client import boolean
|
||||
from antlr4 import CommonTokenStream, DFA, PredictionContextCache, Lexer, LexerATNSimulator, ParserRuleContext, TerminalNode
|
||||
from antlr4 import CommonTokenStream, DFA, PredictionContextCache, Lexer, LexerATNSimulator
|
||||
from antlr4.InputStream import InputStream
|
||||
from antlr4.Parser import Parser
|
||||
from antlr4.RuleContext import RuleContext
|
||||
from antlr4.Token import Token
|
||||
from antlr4.atn.ATNDeserializer import ATNDeserializer
|
||||
from antlr4.error.ErrorListener import ErrorListener
|
||||
from antlr4.error.Errors import LexerNoViableAltException
|
||||
from antlr4.tree.Tree import ParseTree
|
||||
from antlr4.tree.Trees import Trees
|
||||
from antlr4.atn.ATNDeserializer import ATNDeserializer
|
||||
|
||||
from io import StringIO
|
||||
|
||||
|
||||
def serializedATN():
|
||||
with StringIO() as buf:
|
||||
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\n")
|
||||
|
@ -115,7 +114,7 @@ class XPathLexer(Lexer):
|
|||
|
||||
def __init__(self, input=None):
|
||||
super().__init__(input)
|
||||
self.checkVersion("4.5")
|
||||
self.checkVersion("4.6")
|
||||
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
||||
self._actions = None
|
||||
self._predicates = None
|
||||
|
|
|
@ -718,81 +718,81 @@ class CLexer(Lexer):
|
|||
modeNames = [ "DEFAULT_MODE" ]
|
||||
|
||||
literalNames = [ "<INVALID>",
|
||||
"'__extension__'", "'__builtin_va_arg'", "'__builtin_offsetof'",
|
||||
"'__m128'", "'__m128d'", "'__m128i'", "'__typeof__'", "'__inline__'",
|
||||
"'__stdcall'", "'__declspec'", "'__asm'", "'__attribute__'",
|
||||
"'__asm__'", "'__volatile__'", "'auto'", "'break'", "'case'",
|
||||
"'char'", "'const'", "'continue'", "'default'", "'do'", "'double'",
|
||||
"'else'", "'enum'", "'extern'", "'float'", "'for'", "'goto'",
|
||||
"'if'", "'inline'", "'int'", "'long'", "'register'", "'restrict'",
|
||||
"'return'", "'short'", "'signed'", "'sizeof'", "'static'", "'struct'",
|
||||
"'switch'", "'typedef'", "'union'", "'unsigned'", "'void'",
|
||||
"'volatile'", "'while'", "'_Alignas'", "'_Alignof'", "'_Atomic'",
|
||||
"'_Bool'", "'_Complex'", "'_Generic'", "'_Imaginary'", "'_Noreturn'",
|
||||
"'_Static_assert'", "'_Thread_local'", "'('", "')'", "'['",
|
||||
"']'", "'{'", "'}'", "'<'", "'<='", "'>'", "'>='", "'<<'", "'>>'",
|
||||
"'+'", "'++'", "'-'", "'--'", "'*'", "'/'", "'%'", "'&'", "'|'",
|
||||
"'&&'", "'||'", "'^'", "'!'", "'~'", "'?'", "':'", "';'", "','",
|
||||
"'='", "'*='", "'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='",
|
||||
"'__extension__'", "'__builtin_va_arg'", "'__builtin_offsetof'",
|
||||
"'__m128'", "'__m128d'", "'__m128i'", "'__typeof__'", "'__inline__'",
|
||||
"'__stdcall'", "'__declspec'", "'__asm'", "'__attribute__'",
|
||||
"'__asm__'", "'__volatile__'", "'auto'", "'break'", "'case'",
|
||||
"'char'", "'const'", "'continue'", "'default'", "'do'", "'double'",
|
||||
"'else'", "'enum'", "'extern'", "'float'", "'for'", "'goto'",
|
||||
"'if'", "'inline'", "'int'", "'long'", "'register'", "'restrict'",
|
||||
"'return'", "'short'", "'signed'", "'sizeof'", "'static'", "'struct'",
|
||||
"'switch'", "'typedef'", "'union'", "'unsigned'", "'void'",
|
||||
"'volatile'", "'while'", "'_Alignas'", "'_Alignof'", "'_Atomic'",
|
||||
"'_Bool'", "'_Complex'", "'_Generic'", "'_Imaginary'", "'_Noreturn'",
|
||||
"'_Static_assert'", "'_Thread_local'", "'('", "')'", "'['",
|
||||
"']'", "'{'", "'}'", "'<'", "'<='", "'>'", "'>='", "'<<'", "'>>'",
|
||||
"'+'", "'++'", "'-'", "'--'", "'*'", "'/'", "'%'", "'&'", "'|'",
|
||||
"'&&'", "'||'", "'^'", "'!'", "'~'", "'?'", "':'", "';'", "','",
|
||||
"'='", "'*='", "'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='",
|
||||
"'&='", "'^='", "'|='", "'=='", "'!='", "'->'", "'.'", "'...'" ]
|
||||
|
||||
symbolicNames = [ "<INVALID>",
|
||||
"Auto", "Break", "Case", "Char", "Const", "Continue", "Default",
|
||||
"Do", "Double", "Else", "Enum", "Extern", "Float", "For", "Goto",
|
||||
"If", "Inline", "Int", "Long", "Register", "Restrict", "Return",
|
||||
"Short", "Signed", "Sizeof", "Static", "Struct", "Switch", "Typedef",
|
||||
"Union", "Unsigned", "Void", "Volatile", "While", "Alignas",
|
||||
"Alignof", "Atomic", "Bool", "Complex", "Generic", "Imaginary",
|
||||
"Noreturn", "StaticAssert", "ThreadLocal", "LeftParen", "RightParen",
|
||||
"LeftBracket", "RightBracket", "LeftBrace", "RightBrace", "Less",
|
||||
"LessEqual", "Greater", "GreaterEqual", "LeftShift", "RightShift",
|
||||
"Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", "Mod",
|
||||
"And", "Or", "AndAnd", "OrOr", "Caret", "Not", "Tilde", "Question",
|
||||
"Colon", "Semi", "Comma", "Assign", "StarAssign", "DivAssign",
|
||||
"ModAssign", "PlusAssign", "MinusAssign", "LeftShiftAssign",
|
||||
"RightShiftAssign", "AndAssign", "XorAssign", "OrAssign", "Equal",
|
||||
"NotEqual", "Arrow", "Dot", "Ellipsis", "Identifier", "Constant",
|
||||
"StringLiteral", "LineDirective", "PragmaDirective", "Whitespace",
|
||||
"Auto", "Break", "Case", "Char", "Const", "Continue", "Default",
|
||||
"Do", "Double", "Else", "Enum", "Extern", "Float", "For", "Goto",
|
||||
"If", "Inline", "Int", "Long", "Register", "Restrict", "Return",
|
||||
"Short", "Signed", "Sizeof", "Static", "Struct", "Switch", "Typedef",
|
||||
"Union", "Unsigned", "Void", "Volatile", "While", "Alignas",
|
||||
"Alignof", "Atomic", "Bool", "Complex", "Generic", "Imaginary",
|
||||
"Noreturn", "StaticAssert", "ThreadLocal", "LeftParen", "RightParen",
|
||||
"LeftBracket", "RightBracket", "LeftBrace", "RightBrace", "Less",
|
||||
"LessEqual", "Greater", "GreaterEqual", "LeftShift", "RightShift",
|
||||
"Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", "Mod",
|
||||
"And", "Or", "AndAnd", "OrOr", "Caret", "Not", "Tilde", "Question",
|
||||
"Colon", "Semi", "Comma", "Assign", "StarAssign", "DivAssign",
|
||||
"ModAssign", "PlusAssign", "MinusAssign", "LeftShiftAssign",
|
||||
"RightShiftAssign", "AndAssign", "XorAssign", "OrAssign", "Equal",
|
||||
"NotEqual", "Arrow", "Dot", "Ellipsis", "Identifier", "Constant",
|
||||
"StringLiteral", "LineDirective", "PragmaDirective", "Whitespace",
|
||||
"Newline", "BlockComment", "LineComment" ]
|
||||
|
||||
ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
|
||||
"T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
|
||||
"Auto", "Break", "Case", "Char", "Const", "Continue",
|
||||
"Default", "Do", "Double", "Else", "Enum", "Extern", "Float",
|
||||
"For", "Goto", "If", "Inline", "Int", "Long", "Register",
|
||||
"Restrict", "Return", "Short", "Signed", "Sizeof", "Static",
|
||||
"Struct", "Switch", "Typedef", "Union", "Unsigned", "Void",
|
||||
"Volatile", "While", "Alignas", "Alignof", "Atomic", "Bool",
|
||||
"Complex", "Generic", "Imaginary", "Noreturn", "StaticAssert",
|
||||
"ThreadLocal", "LeftParen", "RightParen", "LeftBracket",
|
||||
"RightBracket", "LeftBrace", "RightBrace", "Less", "LessEqual",
|
||||
"Greater", "GreaterEqual", "LeftShift", "RightShift",
|
||||
"Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div",
|
||||
"Mod", "And", "Or", "AndAnd", "OrOr", "Caret", "Not",
|
||||
"Tilde", "Question", "Colon", "Semi", "Comma", "Assign",
|
||||
"StarAssign", "DivAssign", "ModAssign", "PlusAssign",
|
||||
"MinusAssign", "LeftShiftAssign", "RightShiftAssign",
|
||||
"AndAssign", "XorAssign", "OrAssign", "Equal", "NotEqual",
|
||||
"Arrow", "Dot", "Ellipsis", "Identifier", "IdentifierNondigit",
|
||||
"Nondigit", "Digit", "UniversalCharacterName", "HexQuad",
|
||||
"Constant", "IntegerConstant", "DecimalConstant", "OctalConstant",
|
||||
"HexadecimalConstant", "HexadecimalPrefix", "NonzeroDigit",
|
||||
"OctalDigit", "HexadecimalDigit", "IntegerSuffix", "UnsignedSuffix",
|
||||
"LongSuffix", "LongLongSuffix", "FloatingConstant", "DecimalFloatingConstant",
|
||||
"HexadecimalFloatingConstant", "FractionalConstant", "ExponentPart",
|
||||
"Sign", "DigitSequence", "HexadecimalFractionalConstant",
|
||||
"BinaryExponentPart", "HexadecimalDigitSequence", "FloatingSuffix",
|
||||
"CharacterConstant", "CCharSequence", "CChar", "EscapeSequence",
|
||||
"SimpleEscapeSequence", "OctalEscapeSequence", "HexadecimalEscapeSequence",
|
||||
"StringLiteral", "EncodingPrefix", "SCharSequence", "SChar",
|
||||
"LineDirective", "PragmaDirective", "Whitespace", "Newline",
|
||||
ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
|
||||
"T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
|
||||
"Auto", "Break", "Case", "Char", "Const", "Continue",
|
||||
"Default", "Do", "Double", "Else", "Enum", "Extern", "Float",
|
||||
"For", "Goto", "If", "Inline", "Int", "Long", "Register",
|
||||
"Restrict", "Return", "Short", "Signed", "Sizeof", "Static",
|
||||
"Struct", "Switch", "Typedef", "Union", "Unsigned", "Void",
|
||||
"Volatile", "While", "Alignas", "Alignof", "Atomic", "Bool",
|
||||
"Complex", "Generic", "Imaginary", "Noreturn", "StaticAssert",
|
||||
"ThreadLocal", "LeftParen", "RightParen", "LeftBracket",
|
||||
"RightBracket", "LeftBrace", "RightBrace", "Less", "LessEqual",
|
||||
"Greater", "GreaterEqual", "LeftShift", "RightShift",
|
||||
"Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div",
|
||||
"Mod", "And", "Or", "AndAnd", "OrOr", "Caret", "Not",
|
||||
"Tilde", "Question", "Colon", "Semi", "Comma", "Assign",
|
||||
"StarAssign", "DivAssign", "ModAssign", "PlusAssign",
|
||||
"MinusAssign", "LeftShiftAssign", "RightShiftAssign",
|
||||
"AndAssign", "XorAssign", "OrAssign", "Equal", "NotEqual",
|
||||
"Arrow", "Dot", "Ellipsis", "Identifier", "IdentifierNondigit",
|
||||
"Nondigit", "Digit", "UniversalCharacterName", "HexQuad",
|
||||
"Constant", "IntegerConstant", "DecimalConstant", "OctalConstant",
|
||||
"HexadecimalConstant", "HexadecimalPrefix", "NonzeroDigit",
|
||||
"OctalDigit", "HexadecimalDigit", "IntegerSuffix", "UnsignedSuffix",
|
||||
"LongSuffix", "LongLongSuffix", "FloatingConstant", "DecimalFloatingConstant",
|
||||
"HexadecimalFloatingConstant", "FractionalConstant", "ExponentPart",
|
||||
"Sign", "DigitSequence", "HexadecimalFractionalConstant",
|
||||
"BinaryExponentPart", "HexadecimalDigitSequence", "FloatingSuffix",
|
||||
"CharacterConstant", "CCharSequence", "CChar", "EscapeSequence",
|
||||
"SimpleEscapeSequence", "OctalEscapeSequence", "HexadecimalEscapeSequence",
|
||||
"StringLiteral", "EncodingPrefix", "SCharSequence", "SChar",
|
||||
"LineDirective", "PragmaDirective", "Whitespace", "Newline",
|
||||
"BlockComment", "LineComment" ]
|
||||
|
||||
grammarFileName = "C.bnf"
|
||||
|
||||
def __init__(self, input=None):
|
||||
super().__init__(input)
|
||||
self.checkVersion("4.5.1")
|
||||
self.checkVersion("4.6")
|
||||
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
||||
self._actions = None
|
||||
self._predicates = None
|
||||
|
|
|
@ -915,7 +915,7 @@ class CParser ( Parser ):
|
|||
|
||||
def __init__(self, input:TokenStream):
|
||||
super().__init__(input)
|
||||
self.checkVersion("4.5.1")
|
||||
self.checkVersion("4.6")
|
||||
self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
|
||||
self._predicates = None
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CSharpTarget extends Target {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "4.5.3";
|
||||
return "4.6";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GoTarget extends Target {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "4.5.2";
|
||||
return "4.6";
|
||||
}
|
||||
|
||||
public Set<String> getBadWords() {
|
||||
|
|
|
@ -74,7 +74,7 @@ public class JavaScriptTarget extends Target {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "4.5.3";
|
||||
return "4.6";
|
||||
}
|
||||
|
||||
public Set<String> getBadWords() {
|
||||
|
|
|
@ -117,7 +117,7 @@ public class Python2Target extends Target {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "4.5.3";
|
||||
return "4.6";
|
||||
}
|
||||
|
||||
public Set<String> getBadWords() {
|
||||
|
|
|
@ -119,7 +119,7 @@ public class Python3Target extends Target {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "4.5.3";
|
||||
return "4.6";
|
||||
}
|
||||
|
||||
/** Avoid grammar symbols in this set to prevent conflicts in gen'd code. */
|
||||
|
|
Loading…
Reference in New Issue