Browse Source

Fix imports for HUTN.

Bentley James Oakes 3 years ago
parent
commit
6269b79f2e

+ 1 - 1
interface/HUTN/hutn_compiler/bootstrap_visitor.py

@@ -1,5 +1,5 @@
 import string
-from interface.HUTN.hutn_compiler.primitives_visitor import PrimitivesVisitor, Action
+from hutn_compiler.primitives_visitor import PrimitivesVisitor, Action
 
 class BootstrapVisitor(PrimitivesVisitor):
     def __init__(self, args):

+ 11 - 11
interface/HUTN/hutn_compiler/compiler.py

@@ -8,10 +8,10 @@ import os
 import sys
 import time
 
-from interface.HUTN.hutn_compiler.grammar_compiler_visitor import GrammarCompilerVisitor
-from interface.HUTN.hutn_compiler.hutnparser import Parser, Tree
-from interface.HUTN.hutn_compiler.meta_grammar import Grammar
-from interface.HUTN.hutn_compiler.cached_exception import CachedException
+from hutn_compiler.grammar_compiler_visitor import GrammarCompilerVisitor
+from hutn_compiler.hutnparser import Parser, Tree
+from hutn_compiler.meta_grammar import Grammar
+from hutn_compiler.cached_exception import CachedException
 import hashlib
 
 global parsers
@@ -181,13 +181,13 @@ def do_compile(inputfile, grammarfile, visitors=[], include_paths = [], mode="")
         return result
 
 def main(input_file, grammar_file, mode, args=[]):
-    from interface.HUTN.hutn_compiler.prettyprint_visitor import PrettyPrintVisitor
-    from interface.HUTN.hutn_compiler.prettyprint_visitor import PrintVisitor
-    from interface.HUTN.hutn_compiler.semantics_visitor import SemanticsVisitor
-    from interface.HUTN.hutn_compiler.bootstrap_visitor import BootstrapVisitor
-    from interface.HUTN.hutn_compiler.constructors_visitor import ConstructorsVisitor
-    from interface.HUTN.hutn_compiler.model_visitor import ModelVisitor
-    from interface.HUTN.hutn_compiler.model_bootstrap_visitor import ModelBootstrapVisitor
+    from hutn_compiler.prettyprint_visitor import PrettyPrintVisitor
+    from hutn_compiler.prettyprint_visitor import PrintVisitor
+    from hutn_compiler.semantics_visitor import SemanticsVisitor
+    from hutn_compiler.bootstrap_visitor import BootstrapVisitor
+    from hutn_compiler.constructors_visitor import ConstructorsVisitor
+    from hutn_compiler.model_visitor import ModelVisitor
+    from hutn_compiler.model_bootstrap_visitor import ModelBootstrapVisitor
 
     modes = {
         "N" : [],

+ 1 - 1
interface/HUTN/hutn_compiler/constructors_visitor.py

@@ -4,7 +4,7 @@ try:
 except ImportError:
     import pickle as pickle
 
-from interface.HUTN.hutn_compiler.visitor import Visitor
+from hutn_compiler.visitor import Visitor
 
 class ConstructorsVisitor(Visitor):
     def __init__(self, args):

+ 3 - 3
interface/HUTN/hutn_compiler/declare_functions_visitor.py

@@ -1,6 +1,6 @@
-import interface.HUTN.hutn_compiler.symbol_table as st
-import interface.HUTN.hutn_compiler.types_mv as types_mv
-from interface.HUTN.hutn_compiler.visitor import Visitor
+import hutn_compiler.symbol_table as st
+import hutn_compiler.types_mv as types_mv
+from hutn_compiler.visitor import Visitor
 
 
 # Declare the function but do not visit its body

+ 1 - 1
interface/HUTN/hutn_compiler/grammar_compiler_visitor.py

@@ -5,7 +5,7 @@ Date October 2014
 A visitor that takes a tree returned by the parser parsing a grammar
 and returns a structure that the parser can use to parse files written in that grammar
 """
-from interface.HUTN.hutn_compiler.hutnparser import * #we  import the parser for constant, and the Tree Class
+from hutn_compiler.hutnparser import * #we  import the parser for constant, and the Tree Class
 from time import time
 
 def dicToStr(dic):

+ 2 - 2
interface/HUTN/hutn_compiler/hutnparser.py

@@ -26,7 +26,7 @@ import re
 
 from copy import deepcopy 
 
-from interface.HUTN.hutn_compiler.position import Position
+from hutn_compiler.position import Position
 
 line_cache = {}
 
@@ -300,7 +300,7 @@ class Parser(object):
         results = self.applyrule('@start', 0)
         if len(results) > 1:
             # Handle ambiguity
-            from interface.HUTN.hutn_compiler.prettyprint_visitor import PrettyPrintVisitor
+            from hutn_compiler.prettyprint_visitor import PrettyPrintVisitor
             for p in results:
                 print("===================================")
                 print("VISIT RESULT")

+ 2 - 2
interface/HUTN/hutn_compiler/model_bootstrap_visitor.py

@@ -1,5 +1,5 @@
-from interface.HUTN.hutn_compiler.visitor import Visitor
-from interface.HUTN.hutn_compiler.compiler import main as do_compile
+from hutn_compiler.visitor import Visitor
+from hutn_compiler.compiler import main as do_compile
 import os
 import uuid
 

+ 2 - 2
interface/HUTN/hutn_compiler/model_visitor.py

@@ -1,5 +1,5 @@
-from interface.HUTN.hutn_compiler.visitor import Visitor
-from interface.HUTN.hutn_compiler.compiler import main as do_compile
+from hutn_compiler.visitor import Visitor
+from hutn_compiler.compiler import main as do_compile
 import os
 
 def empty(s):

+ 2 - 2
interface/HUTN/hutn_compiler/prettyprint_visitor.py

@@ -1,5 +1,5 @@
-from interface.HUTN.hutn_compiler.hutnparser import Tree
-from interface.HUTN.hutn_compiler.visitor import Visitor
+from hutn_compiler.hutnparser import Tree
+from hutn_compiler.visitor import Visitor
 
 class PrintVisitor(Visitor):
     def __init__(self, args):

+ 1 - 1
interface/HUTN/hutn_compiler/primitives_visitor.py

@@ -1,5 +1,5 @@
 import string
-from interface.HUTN.hutn_compiler.visitor import Visitor
+from hutn_compiler.visitor import Visitor
 import json
 
 class Action():

+ 5 - 5
interface/HUTN/hutn_compiler/semantics_visitor.py

@@ -1,9 +1,9 @@
-import interface.HUTN.hutn_compiler.hutnparser as hp
-import interface.HUTN.hutn_compiler.symbol_table as st
+import hutn_compiler.hutnparser as hp
+import hutn_compiler.symbol_table as st
 import sys
-import interface.HUTN.hutn_compiler.types_mv as types_mv
-from interface.HUTN.hutn_compiler.declare_functions_visitor import DeclareFunctionsVisitor
-from interface.HUTN.hutn_compiler.visitor import Visitor
+import hutn_compiler.types_mv as types_mv
+from hutn_compiler.declare_functions_visitor import DeclareFunctionsVisitor
+from hutn_compiler.visitor import Visitor
 
 
 class SemanticsVisitor(Visitor):

+ 1 - 1
interface/HUTN/hutn_compiler/symbol_table.py

@@ -1,4 +1,4 @@
-import interface.HUTN.hutn_compiler.types_mv as types_mv
+import hutn_compiler.types_mv as types_mv
 
 
 class Symbol(object):

+ 2 - 2
interface/HUTN/hutn_compiler/visitor.py

@@ -1,4 +1,4 @@
-import interface.HUTN.hutn_compiler.symbol_table as st
+import hutn_compiler.symbol_table as st
 
 
 class Visitor(object):
@@ -33,7 +33,7 @@ class Visitor(object):
 
     @staticmethod
     def print_tree(tree):
-        from interface.HUTN.hutn_compiler.prettyprint_visitor import PrintVisitor
+        from hutn_compiler.prettyprint_visitor import PrintVisitor
         pv = PrintVisitor()
         pv.visit(tree)
         print(pv.dump())

+ 2 - 2
interface/HUTN/test/constructor_compilation_action_language/test_compile.py

@@ -3,9 +3,9 @@ import unittest
 try:
     import util  # needed for Python2
 except ImportError:
-    import interface.HUTN.test.constructor_compilation_action_language.util as util
+    import test.constructor_compilation_action_language.util as util
 
-from interface.HUTN.hutn_compiler.compiler import main
+from compiler import main
 import json
 
 def compile_file(obj, filename):

+ 2 - 2
interface/HUTN/test/grammar_action_language/test_invalids.py

@@ -3,9 +3,9 @@ import unittest
 try:
     import util  # needed for Python2
 except ImportError:
-    import interface.HUTN.test.grammar_action_language.util as util
+    import test.grammar_action_language.util as util
 
-from interface.HUTN.hutn_compiler.compiler import main
+from compiler import main
 
 def parse_file(filename):
     try:

+ 2 - 2
interface/HUTN/test/grammar_action_language/test_valids.py

@@ -3,9 +3,9 @@ import unittest
 try:
     import util  # needed for Python2
 except ImportError:
-    import interface.HUTN.test.grammar_action_language.util as util
+    import test.grammar_action_language.util as util
 
-from interface.HUTN.hutn_compiler.compiler import main
+from compiler import main
 
 def parse_file(filename):
     main(util.get_code_path(filename), "grammars/actionlanguage.g", "N", [])

+ 2 - 2
interface/HUTN/test/modelling_language/test_compile.py

@@ -2,9 +2,9 @@ import unittest
 try:
     import util #needed for Python2
 except ImportError:
-    import interface.HUTN.test.modelling_language.util as util
+    import test.modelling_language.util as util
 
-from interface.HUTN.hutn_compiler.compiler import main
+from compiler import main
 import json
 
 def compile_file(obj, filename):