change antlr4 includes to specific members
This commit is contained in:
parent
e7d0a59ccb
commit
9378112570
12
comment.py
12
comment.py
|
@ -15,11 +15,13 @@ __email__ = "kevin@company235.com"
|
|||
__status__ = "Prototype"
|
||||
|
||||
|
||||
import antlr4
|
||||
import configparser
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from antlr4 import CommonTokenStream
|
||||
from antlr4 import InputStream
|
||||
from antlr4 import ParseTreeWalker
|
||||
from antlr4.error.ErrorListener import ErrorListener
|
||||
from CommentMacroLexer import CommentMacroLexer
|
||||
from CommentMacroParser import CommentMacroParser
|
||||
|
@ -43,7 +45,7 @@ logger.addHandler(ch) # add console log handler
|
|||
# TODO: refactor this to support multiple net#s
|
||||
config = configparser.ConfigParser(allow_no_value=True)
|
||||
config.read('server.cfg') # open config file
|
||||
servers = {} # init an empty dictionary
|
||||
servers = {} # init an empty dictionary
|
||||
server = config['hog4'] # section of config file
|
||||
net = server.getint("net", 1) # default to net #1
|
||||
logger.info("Adding Hog device at net# " + str(net))
|
||||
|
@ -52,13 +54,13 @@ servers[net] = udp_client.SimpleUDPClient(server.get("ip", "10.0.0.1"),
|
|||
server.getint("port", 6600))
|
||||
|
||||
oscMacro = OscCommentMacroListener(servers)
|
||||
walker = antlr4.ParseTreeWalker()
|
||||
walker = ParseTreeWalker()
|
||||
|
||||
|
||||
def comment(text):
|
||||
input_stream = antlr4.InputStream(text)
|
||||
input_stream = InputStream(text)
|
||||
lexer = CommentMacroLexer(input_stream)
|
||||
stream = antlr4.CommonTokenStream(lexer)
|
||||
stream = CommonTokenStream(lexer)
|
||||
parser = CommentMacroParser(stream)
|
||||
parser._listeners.append(SyntaxErrorListener())
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue