Commit 4b7768ca authored by Michael Büsch's avatar Michael Büsch

core: Move parser to awlcompiler submodule

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent c4e79739
......@@ -31,6 +31,7 @@ import signal
from awlsim_loader.common import *
from awlsim_loader.core import *
from awlsim_loader.coreclient import *
from awlsim_loader.awlcompiler import *
from awlsim_loader.fupcompiler import *
import awlsim_loader.cython_helper as cython_helper
......
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.awlcompiler.tokenizer import *
......@@ -4,5 +4,4 @@ from awlsim.common.compat import *
from awlsim.core.main import *
from awlsim.core.cpu import *
from awlsim.core.hardware import *
from awlsim.core.parser import *
from awlsim.core.util import *
......@@ -24,6 +24,7 @@ from awlsim.common.compat import *
from awlsim.common.refmanager import *
from awlsim.common.blockinfo import *
from awlsim.common.wordpacker import *
from awlsim.core.labels import *
from awlsim.core.datastructure import *
......
......@@ -36,7 +36,6 @@ from awlsim.common.blockinfo import *
from awlsim.library.libentry import *
from awlsim.core.parser import *
from awlsim.core.symbolparser import *
from awlsim.core.datatypes import *
from awlsim.core.instructions.all_insns import * #@nocy
......
......@@ -30,6 +30,8 @@ from awlsim.core.timers import *
from awlsim.core.offset import *
from awlsim.core.identifier import *
from awlsim.awlcompiler import AwlParser
import datetime
......@@ -791,8 +793,7 @@ class AwlDataType(OptionalImmutable):
if len(token) > maxLen:
raise AwlSimError("String too long (>%d characters)" % maxLen)
try:
import awlsim.core.parser as parser
data = token.encode(parser.AwlParser.TEXT_ENCODING)
data = token.encode(AwlParser.TEXT_ENCODING)
data = bytearray(data)
if len(data) != len(token):
raise ValueError
......
......@@ -21,12 +21,13 @@
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
#from awlsim.core.instructions.all_insns cimport * #@cy
from awlsim.common.cpuspecs import *
from awlsim.core.util import *
#from awlsim.core.instructions.all_insns cimport * #@cy
from awlsim.core.instructions.all_insns import * #@nocy
from awlsim.core.parser import *
from awlsim.awlcompiler import *
class AwlInsnTranslator(object):
......
......@@ -27,7 +27,6 @@ from awlsim.common.datatypehelpers import *
from awlsim.core.util import *
from awlsim.core.operators import *
from awlsim.core.optrans import *
from awlsim.core.parser import *
class AwlInsn(object): #+cdef
......
......@@ -22,7 +22,6 @@
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.core.parser import *
from awlsim.core.operators import *
from awlsim.core.util import *
......
......@@ -25,7 +25,6 @@ from awlsim.common.compat import *
from awlsim.common.project import *
from awlsim.core.util import *
from awlsim.core.parser import *
from awlsim.core.cpu import *
from awlsim.core.hardware import *
......
......@@ -31,6 +31,8 @@ from awlsim.core.statusword import * #@nocy
from awlsim.core.lstack import *
from awlsim.core.util import *
from awlsim.awlcompiler import AwlParser
class AwlOperator(DynAttrs):
"""An AWL operator.
......@@ -403,8 +405,7 @@ class AwlOperator(DynAttrs):
return self.value.toPointerString()
elif self.type == self.IMM_STR:
strLen = self.value[1]
import awlsim.core.parser as parser
return "'" + self.value[2:2+strLen].decode(parser.AwlParser.TEXT_ENCODING) + "'"
return "'" + self.value[2:2+strLen].decode(AwlParser.TEXT_ENCODING) + "'"
elif self.type in (self.MEM_A, self.MEM_E,
self.MEM_M, self.MEM_L, self.MEM_VL):
pfx = self.type2str[self.type]
......
......@@ -27,13 +27,15 @@ import re
#from awlsim.core.statusword cimport * #@cy
from awlsim.common.cpuspecs import *
from awlsim.core.util import *
from awlsim.core.operators import *
from awlsim.core.parameters import *
from awlsim.core.datatypes import *
from awlsim.core.parser import *
from awlsim.core.timers import *
from awlsim.awlcompiler import *
class OpDescriptor(object):
"Instruction operator descriptor"
......
......@@ -22,6 +22,8 @@
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.common.wordpacker import *
from awlsim.core.systemblocks.systemblocks import *
from awlsim.core.util import *
......
......@@ -27,10 +27,11 @@ from awlsim.common.compat import *
from awlsim.core.instructions.all_insns import * #@nocy
from awlsim.core.optrans import *
from awlsim.core.insntrans import *
from awlsim.core.parser import *
from awlsim.core.util import *
from awlsim.core.datastructure import *
from awlsim.awlcompiler import *
class AwlTranslator(object):
"AWL instruction and operator translator."
......
......@@ -28,7 +28,8 @@ from awlsim.common.sources import *
from awlsim.common.net import *
from awlsim.core.main import *
from awlsim.core.parser import *
from awlsim.awlcompiler import *
from awlsim.coreserver.messages import *
from awlsim.coreserver.memarea import *
......
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim_loader.cython_helper as __cython
__importmod = "awlsim.awlcompiler"
if __cython.shouldUseCython(__importmod): #@nocy
#if True: #@cy
__importcymod = __cython.cythonModuleName(__importmod)
try:
exec("from %s import *" % __importcymod)
except ImportError as e:
__cython.cythonImportError(__importcymod, str(e))
if not __cython.shouldUseCython(__importmod): #@nocy
exec("from %s import *" % __importmod) #@nocy
......@@ -3,6 +3,7 @@ debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/common u
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/core usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/coreclient usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/coreserver usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/awlcompiler usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/fupcompiler usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_cython/library usr/lib/python2.7/dist-packages/awlsim_cython
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_loader_cython usr/lib/python2.7/dist-packages
......@@ -3,6 +3,7 @@ debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/common us
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/core usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/coreclient usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/coreserver usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/awlcompiler usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/fupcompiler usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_cython/library usr/lib/python3/dist-packages/awlsim_cython
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_loader_cython usr/lib/python3/dist-packages
......@@ -3,6 +3,7 @@ debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/common usr/lib/pypy
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/core usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/coreclient usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/coreserver usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/awlcompiler usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/fupcompiler usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim/library usr/lib/pypy/dist-packages/awlsim
debian/destdir-pypy-awlsim/usr/lib/pypy/dist-packages/awlsim_loader usr/lib/pypy/dist-packages
......@@ -3,6 +3,7 @@ debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/common usr/lib/
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/core usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/coreclient usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/coreserver usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/awlcompiler usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/fupcompiler usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim/library usr/lib/python2.7/dist-packages/awlsim
debian/destdir-py2-awlsim/usr/lib/python2.7/dist-packages/awlsim_loader usr/lib/python2.7/dist-packages
......@@ -3,6 +3,7 @@ debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/common usr/lib/p
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/core usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/coreclient usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/coreserver usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/awlcompiler usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/fupcompiler usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim/library usr/lib/python3/dist-packages/awlsim
debian/destdir-py3-awlsim/usr/lib/python3*/dist-packages/awlsim_loader usr/lib/python3/dist-packages
......@@ -136,6 +136,7 @@ setup( name = "awlsim",
"awlsim/core/systemblocks",
"awlsim/coreclient",
"awlsim/coreserver",
"awlsim/awlcompiler",
"awlsim/fupcompiler",
"awlsim/gui",
"awlsim/gui/fup",
......
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