Commit bf8e9920 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Removing dead code (lex/yacc ASN.1 parser)

parent 8fc00789
......@@ -282,13 +282,6 @@ def main():
uniqueDataFiles[param._signal._asnFilename][sp._language].append(sp)
uniqueASNfiles = {}
# for asnFile in uniqueDataFiles.iterkeys():
# commonPy.asnParser.ParseInput(asnFile)
# uniqueASNfiles[asnFile] = [copy.copy(commonPy.asnParser.g_names),copy.copy(commonPy.asnParser.g_inputAsnAST),copy.copy(commonPy.asnParser.g_leafTypeDict)]
# if 0 == len(uniqueDataFiles.iterkeys()):
# panic("There are no data references anywhere in the given AADL files. Aborting...")
# sys.exit(0)
if len(list(uniqueDataFiles.keys())) != 0:
commonPy.asnParser.ParseAsnFileList(list(uniqueDataFiles.keys()))
......
......@@ -996,41 +996,6 @@ It returns a map providing the leafType of each type.
return knownTypes
def ParseInput(asnFilename, bClearFirst=True, bFixAST=True):
global g_asnFilename
g_asnFilename = asnFilename
try:
lines = "\n".join(open(asnFilename, 'r').readlines())
except:
utility.panic("AsnParser: Can't find file '%s'\n" % asnFilename)
if bClearFirst:
global g_names
g_names = {}
global g_typesOfFile
g_typesOfFile = {}
global g_inputAsnAST
g_inputAsnAST = []
global g_leafTypeDict
g_leafTypeDict = {}
if not configMT.debugParser:
import lex
lex.lex()
import yacc
yacc.yacc(debug=0, write_tables=0)
yacc.parse(lines)
else:
import lex
lexer = lex.lex(debug=1)
lexer.input(lines)
lex.runmain()
if bFixAST:
g_leafTypeDict.update(VerifyAndFixAST())
def IsInvalidType(name):
return \
(name.lower() in g_invalidKeywords) or \
......@@ -1079,19 +1044,6 @@ def ParseAsnFileList(listOfFilenames):
asn1SccPath = spawn.find_executable('asn1.exe')
if asn1SccPath is None:
utility.panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n")
sys.stderr.write("WARNING: ASN1SCC environment var unset, using naive ASN.1 parser...\n")
global g_filename
g_filename = listOfFilenames[0]
ParseInput(listOfFilenames[0], True, False)
for f in listOfFilenames[1:]:
g_filename = f
ParseInput(f, False, False)
g_leafTypeDict.update(VerifyAndFixAST())
for nodeTypename in list(g_names.keys()):
if nodeTypename not in g_checkedSoFarForKeywords:
g_checkedSoFarForKeywords[nodeTypename] = 1
CheckForInvalidKeywords(nodeTypename)
else:
(dummy, xmlAST) = tempfile.mkstemp()
os.fdopen(dummy).close()
......
Markdown is supported
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