Commit b95c9b89 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

lib: Extend alphabet of terminals for grammars with '-', '~', and '='

parent 12be346b
Pipeline #79985 passed with stage
in 1 minute and 35 seconds
......@@ -28,7 +28,7 @@ LEFT_ANGLE : '<';
RIGHT_ANGLE : '>';
APOSTROPHE : '\'';
UNDERSCORE : '_';
TERMINAL : [a-z0-9];
TERMINAL : [-~=a-z0-9];
CAPS : [A-Z];
ARROW : ('→' | '->');
EPSILON : ('ε' | '\\''e');
......
# Generated from lib/parsing/CFG.g4 by ANTLR 4.8
# Generated from lib/parsing/CFG.g4 by ANTLR 4.9.2
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
......@@ -16,23 +19,24 @@ def serializedATN():
buf.write("\3\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\16\6\16?\n\16\r\16")
buf.write("\16\16@\3\16\3\16\3\17\3\17\2\2\20\3\3\5\4\7\5\t\6\13")
buf.write("\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\3\2")
buf.write("\6\4\2\62;c|\3\2C\\\5\2\f\f..==\5\2\13\13\17\17\"\"\2")
buf.write("H\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13")
buf.write("\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3")
buf.write("\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2")
buf.write("\2\2\2\35\3\2\2\2\3\37\3\2\2\2\5!\3\2\2\2\7#\3\2\2\2\t")
buf.write("%\3\2\2\2\13\'\3\2\2\2\r)\3\2\2\2\17.\3\2\2\2\21\63\3")
buf.write("\2\2\2\23\65\3\2\2\2\25\67\3\2\2\2\279\3\2\2\2\31;\3\2")
buf.write("\2\2\33>\3\2\2\2\35D\3\2\2\2\37 \7>\2\2 \4\3\2\2\2!\"")
buf.write("\7@\2\2\"\6\3\2\2\2#$\7)\2\2$\b\3\2\2\2%&\7a\2\2&\n\3")
buf.write("\2\2\2\'(\t\2\2\2(\f\3\2\2\2)*\t\3\2\2*\16\3\2\2\2+/\7")
buf.write("\u2194\2\2,-\7/\2\2-/\7@\2\2.+\3\2\2\2.,\3\2\2\2/\20\3")
buf.write("\2\2\2\60\64\7\u03b7\2\2\61\62\7^\2\2\62\64\7g\2\2\63")
buf.write("\60\3\2\2\2\63\61\3\2\2\2\64\22\3\2\2\2\65\66\7~\2\2\66")
buf.write("\24\3\2\2\2\678\t\4\2\28\26\3\2\2\29:\7%\2\2:\30\3\2\2")
buf.write("\2;<\7$\2\2<\32\3\2\2\2=?\t\5\2\2>=\3\2\2\2?@\3\2\2\2")
buf.write("@>\3\2\2\2@A\3\2\2\2AB\3\2\2\2BC\b\16\2\2C\34\3\2\2\2")
buf.write("DE\13\2\2\2E\36\3\2\2\2\6\2.\63@\3\b\2\2")
buf.write("\6\7\2//\62;??c|\u0080\u0080\3\2C\\\5\2\f\f..==\5\2\13")
buf.write("\13\17\17\"\"\2H\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2")
buf.write("\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21")
buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3")
buf.write("\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\3\37\3\2\2\2\5!\3\2\2")
buf.write("\2\7#\3\2\2\2\t%\3\2\2\2\13\'\3\2\2\2\r)\3\2\2\2\17.\3")
buf.write("\2\2\2\21\63\3\2\2\2\23\65\3\2\2\2\25\67\3\2\2\2\279\3")
buf.write("\2\2\2\31;\3\2\2\2\33>\3\2\2\2\35D\3\2\2\2\37 \7>\2\2")
buf.write(" \4\3\2\2\2!\"\7@\2\2\"\6\3\2\2\2#$\7)\2\2$\b\3\2\2\2")
buf.write("%&\7a\2\2&\n\3\2\2\2\'(\t\2\2\2(\f\3\2\2\2)*\t\3\2\2*")
buf.write("\16\3\2\2\2+/\7\u2194\2\2,-\7/\2\2-/\7@\2\2.+\3\2\2\2")
buf.write(".,\3\2\2\2/\20\3\2\2\2\60\64\7\u03b7\2\2\61\62\7^\2\2")
buf.write("\62\64\7g\2\2\63\60\3\2\2\2\63\61\3\2\2\2\64\22\3\2\2")
buf.write("\2\65\66\7~\2\2\66\24\3\2\2\2\678\t\4\2\28\26\3\2\2\2")
buf.write("9:\7%\2\2:\30\3\2\2\2;<\7$\2\2<\32\3\2\2\2=?\t\5\2\2>")
buf.write("=\3\2\2\2?@\3\2\2\2@>\3\2\2\2@A\3\2\2\2AB\3\2\2\2BC\b")
buf.write("\16\2\2C\34\3\2\2\2DE\13\2\2\2E\36\3\2\2\2\6\2.\63@\3")
buf.write("\b\2\2")
return buf.getvalue()
......@@ -77,7 +81,7 @@ class CFGLexer(Lexer):
def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.8")
self.checkVersion("4.9.2")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
......
# Generated from lib/parsing/CFG.g4 by ANTLR 4.8
# Generated from lib/parsing/CFG.g4 by ANTLR 4.9.2
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CFGParser import CFGParser
......
# Generated from lib/parsing/CFG.g4 by ANTLR 4.8
# Generated from lib/parsing/CFG.g4 by ANTLR 4.9.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
......@@ -100,7 +100,7 @@ class CFGParser ( Parser ):
def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.8")
self.checkVersion("4.9.2")
self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
self._predicates = None
......@@ -108,6 +108,7 @@ class CFGParser ( Parser ):
class StartContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -210,6 +211,7 @@ class CFGParser ( Parser ):
class OneruleContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -284,6 +286,7 @@ class CFGParser ( Parser ):
class RewriteContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -354,6 +357,7 @@ class CFGParser ( Parser ):
class Term_or_nontermContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -411,6 +415,7 @@ class CFGParser ( Parser ):
class TerminalContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -491,6 +496,7 @@ class CFGParser ( Parser ):
class NonterminalContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -605,6 +611,7 @@ class CFGParser ( Parser ):
class SymbolContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -657,6 +664,7 @@ class CFGParser ( Parser ):
class CommentContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......@@ -725,6 +733,7 @@ class CFGParser ( Parser ):
class AnyvalueContext(ParserRuleContext):
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment