Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Antlr patch version #101

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ For developers, dependency management is through `Poetry`_. Installation is acco

If you change the source grammar file you need to regenerate the parser and lexer.

With docker installed, run these commands from this the repo's root directory
If your network uses custom certificates, ensure you are on a different network before attempting the following.

With docker installed, run these commands from this the repo's root directory:

.. code-block:: bash

Expand All @@ -104,7 +106,7 @@ If not using Docker, Install antlr4 following `these instructions <https://githu

.. code-block:: bash

# in modelica_building/modelica_parser
# in modelica_builder/modelica_parser
antlr4 -Dlanguage=Python3 modelica.g4

# commit results along with grammar file
Expand Down
6 changes: 3 additions & 3 deletions antlr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM eclipse-temurin:17

WORKDIR /usr/local/lib
RUN wget https://www.antlr.org/download/antlr-4.13.1-complete.jar
ENV CLASSPATH=".:/usr/local/lib/antlr-4.13.1-complete.jar:$CLASSPATH"
RUN wget https://www.antlr.org/download/antlr-4.13.2-complete.jar
ENV CLASSPATH=".:/usr/local/lib/antlr-4.13.2-complete.jar:$CLASSPATH"

ENTRYPOINT ["java", "-jar", "/usr/local/lib/antlr-4.13.1-complete.jar"]
ENTRYPOINT ["java", "-jar", "/usr/local/lib/antlr-4.13.2-complete.jar"]
CMD []
66 changes: 32 additions & 34 deletions modelica_builder/modelica_parser/modelicaLexer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from /var/antlrResult/modelica.g4 by ANTLR 4.13.1
# Generated from /var/antlrResult/modelica.g4 by ANTLR 4.13.2
from antlr4 import *
from io import StringIO
import sys
Expand Down Expand Up @@ -401,50 +401,48 @@ class modelicaLexer(Lexer):
modeNames = [ "DEFAULT_MODE" ]

literalNames = [ "<INVALID>",
"'final'", "';'", "'within'", "'encapsulated'", "'partial'",
"'class'", "'model'", "'operator'", "'record'", "'block'", "'expandable'",
"'connector'", "'type'", "'package'", "'pure'", "'impure'",
"'function'", "'end'", "'extends'", "'='", "'enumeration'",
"'('", "':'", "')'", "'der'", "','", "'public'", "'protected'",
"'external'", "'redeclare'", "'inner'", "'outer'", "'replaceable'",
"'import'", "'.*'", "'.{'", "'}'", "'constrainedby'", "'flow'",
"'stream'", "'discrete'", "'parameter'", "'constant'", "'input'",
"'output'", "'if'", "':='", "'each'", "'initial'", "'equation'",
"'algorithm'", "'break'", "'return'", "'then'", "'elseif'",
"'else'", "'for'", "'loop'", "'in'", "'while'", "'when'", "'elsewhen'",
"'connect'", "'or'", "'and'", "'not'", "'<'", "'<='", "'>'",
"'>='", "'=='", "'<>'", "'+'", "'-'", "'.+'", "'.-'", "'*'",
"'/'", "'./'", "'^'", "'.^'", "'false'", "'true'", "'['", "']'",
"'final'", "';'", "'within'", "'encapsulated'", "'partial'",
"'class'", "'model'", "'operator'", "'record'", "'block'", "'expandable'",
"'connector'", "'type'", "'package'", "'pure'", "'impure'",
"'function'", "'end'", "'extends'", "'='", "'enumeration'",
"'('", "':'", "')'", "'der'", "','", "'public'", "'protected'",
"'external'", "'redeclare'", "'inner'", "'outer'", "'replaceable'",
"'import'", "'.*'", "'.{'", "'}'", "'constrainedby'", "'flow'",
"'stream'", "'discrete'", "'parameter'", "'constant'", "'input'",
"'output'", "'if'", "':='", "'each'", "'initial'", "'equation'",
"'algorithm'", "'break'", "'return'", "'then'", "'elseif'",
"'else'", "'for'", "'loop'", "'in'", "'while'", "'when'", "'elsewhen'",
"'connect'", "'or'", "'and'", "'not'", "'<'", "'<='", "'>'",
"'>='", "'=='", "'<>'", "'+'", "'-'", "'.+'", "'.-'", "'*'",
"'/'", "'./'", "'^'", "'.^'", "'false'", "'true'", "'['", "']'",
"'{'", "'.'", "'annotation'" ]

symbolicNames = [ "<INVALID>",
"IDENT", "STRING", "UNSIGNED_NUMBER", "WS", "COMMENT", "LINE_COMMENT" ]

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",
"T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
"T__20", "T__21", "T__22", "T__23", "T__24", "T__25",
"T__26", "T__27", "T__28", "T__29", "T__30", "T__31",
"T__32", "T__33", "T__34", "T__35", "T__36", "T__37",
"T__38", "T__39", "T__40", "T__41", "T__42", "T__43",
"T__44", "T__45", "T__46", "T__47", "T__48", "T__49",
"T__50", "T__51", "T__52", "T__53", "T__54", "T__55",
"T__56", "T__57", "T__58", "T__59", "T__60", "T__61",
"T__62", "T__63", "T__64", "T__65", "T__66", "T__67",
"T__68", "T__69", "T__70", "T__71", "T__72", "T__73",
"T__74", "T__75", "T__76", "T__77", "T__78", "T__79",
"T__80", "T__81", "T__82", "T__83", "T__84", "T__85",
"T__86", "T__87", "IDENT", "Q_IDENT", "S_CHAR", "NONDIGIT",
"STRING", "Q_CHAR", "S_ESCAPE", "DIGIT", "UNSIGNED_INTEGER",
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",
"T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
"T__20", "T__21", "T__22", "T__23", "T__24", "T__25",
"T__26", "T__27", "T__28", "T__29", "T__30", "T__31",
"T__32", "T__33", "T__34", "T__35", "T__36", "T__37",
"T__38", "T__39", "T__40", "T__41", "T__42", "T__43",
"T__44", "T__45", "T__46", "T__47", "T__48", "T__49",
"T__50", "T__51", "T__52", "T__53", "T__54", "T__55",
"T__56", "T__57", "T__58", "T__59", "T__60", "T__61",
"T__62", "T__63", "T__64", "T__65", "T__66", "T__67",
"T__68", "T__69", "T__70", "T__71", "T__72", "T__73",
"T__74", "T__75", "T__76", "T__77", "T__78", "T__79",
"T__80", "T__81", "T__82", "T__83", "T__84", "T__85",
"T__86", "T__87", "IDENT", "Q_IDENT", "S_CHAR", "NONDIGIT",
"STRING", "Q_CHAR", "S_ESCAPE", "DIGIT", "UNSIGNED_INTEGER",
"UNSIGNED_NUMBER", "WS", "COMMENT", "LINE_COMMENT" ]

grammarFileName = "modelica.g4"

def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.13.1")
self.checkVersion("4.13.2")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None


2 changes: 1 addition & 1 deletion modelica_builder/modelica_parser/modelicaListener.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from /var/antlrResult/modelica.g4 by ANTLR 4.13.1
# Generated from /var/antlrResult/modelica.g4 by ANTLR 4.13.2
from antlr4 import *
if "." in __name__:
from .modelicaParser import modelicaParser
Expand Down
Loading
Loading