浏览代码

remove dependency from Shell as it is not the concern of this script to open a shell. The script should generate gpl code from an SCCD textual specification

Cláudio Gomes 8 年之前
父节点
当前提交
185470a65b
共有 3 个文件被更改,包括 12 次插入6 次删除
  1. 4 3
      textualnotations/mvk_loader.py
  2. 1 1
      textualnotations/sccd_to_xml.py
  3. 7 2
      textualnotations/sccdtnc.py

+ 4 - 3
textualnotations/mvk_loader.py

@@ -28,7 +28,7 @@ from sccd_asg_mapper import SCCD_ASG_Mapper
 
 pathname = os.path.dirname(os.path.realpath(__file__))
 
-from shell import Shell
+#from shell import Shell
 from sccd_modelverse_sources.sccd_metamodel import Gen as GenSCCD
 
 DEBUG = False
@@ -867,7 +867,7 @@ def _read(n, *args):
 	with open(os.path.join(os.getcwd(), n), *args, **kwargs) as f:
 		return f.read()
 
-
+"""
 if __name__ == '__main__':
 	mapper = SCCD_ASG_Mapper()
 	if(len(sys.argv) > 1):
@@ -878,4 +878,5 @@ if __name__ == '__main__':
 		context = MvKLoader(mapper.rules, mapper.metamodel_location, mapper.metamodel_path, 'MyFormalisms').load()
 	shell = Shell()
 	shell.mvk = context.mvk
-	shell.setupCommandLine()
+	shell.setupCommandLine()
+"""

+ 1 - 1
textualnotations/sccd_to_xml.py

@@ -14,7 +14,7 @@ from mvk.impl.python.object import ClabjectReference, Clabject
 
 from mvk.mvk import MvK
 import mvk
-from shell import Shell
+#from shell import Shell
 
 #from sccd_to_xml_rules import XMLRules
 

+ 7 - 2
textualnotations/sccdtnc.py

@@ -1,7 +1,7 @@
 import argparse
 import os
-from shell import Shell
 
+#from shell import Shell
 from sccd.compiler.generic_generator import GenericGenerator, Platforms
 from sccd.compiler.utils import Enum, Logger, FileWriter
 from sccd.compiler.generic_language_constructs import GenericConstruct
@@ -80,7 +80,7 @@ def main():
     parser.add_argument('-v', '--verbose', type=int, help='2 = all output; 1 = only warnings and errors; 0 = only errors; -1 = no output.  Defaults to 2.', default = 2)
     parser.add_argument('-p', '--platform', type=str, help="Let the compiled code run on top of threads, gameloop or eventloop. The default is eventloop.")
     parser.add_argument('-l', '--language', type=str, help='Target language, either "javascript" or "python". Defaults to the latter.')
-    parser.add_argument('-m', '--mvklocation', type=str, help='Location in the Modelverse. After compilation the modelverse shell is opened.')
+    #parser.add_argument('-m', '--mvklocation', type=str, help='Location in the Modelverse. After compilation the modelverse shell is opened.')
     parser.add_argument('-justxml', dest='justxml', action='store_true')
     parser.set_defaults(justxml=False)
 
@@ -129,12 +129,15 @@ def main():
     else :
         platform = Platforms.Threads
 
+    mvklocation = 'unused_location'
+    """
     if args['mvklocation'] :
         mvklocation = args['mvklocation']
         modelverseshell = True
     else:
         mvklocation = 'temporaryLocation'
         modelverseshell = False
+    """
 
     if args['justxml']:
         try :
@@ -160,10 +163,12 @@ def main():
     except CompilerException as exception :
         Logger.showError(str(exception));
 
+    """
     if(modelverseshell):
         shell = Shell()
         shell.mvk = context.mvk
         shell.setupCommandLine()
+    """
 
 if __name__ == "__main__":
     main()