1
0
Fork 0

change antlr4 includes to specific members

This commit is contained in:
Kevin Matz 2018-10-29 04:43:04 -10:00
parent e7d0a59ccb
commit 9378112570
1 changed files with 7 additions and 5 deletions

View File

@ -15,11 +15,13 @@ __email__ = "kevin@company235.com"
__status__ = "Prototype" __status__ = "Prototype"
import antlr4
import configparser import configparser
import logging import logging
import sys import sys
from antlr4 import CommonTokenStream
from antlr4 import InputStream
from antlr4 import ParseTreeWalker
from antlr4.error.ErrorListener import ErrorListener from antlr4.error.ErrorListener import ErrorListener
from CommentMacroLexer import CommentMacroLexer from CommentMacroLexer import CommentMacroLexer
from CommentMacroParser import CommentMacroParser from CommentMacroParser import CommentMacroParser
@ -52,13 +54,13 @@ servers[net] = udp_client.SimpleUDPClient(server.get("ip", "10.0.0.1"),
server.getint("port", 6600)) server.getint("port", 6600))
oscMacro = OscCommentMacroListener(servers) oscMacro = OscCommentMacroListener(servers)
walker = antlr4.ParseTreeWalker() walker = ParseTreeWalker()
def comment(text): def comment(text):
input_stream = antlr4.InputStream(text) input_stream = InputStream(text)
lexer = CommentMacroLexer(input_stream) lexer = CommentMacroLexer(input_stream)
stream = antlr4.CommonTokenStream(lexer) stream = CommonTokenStream(lexer)
parser = CommentMacroParser(stream) parser = CommentMacroParser(stream)
parser._listeners.append(SyntaxErrorListener()) parser._listeners.append(SyntaxErrorListener())
try: try: