aboutsummaryrefslogtreecommitdiff
path: root/pyquest.py
diff options
context:
space:
mode:
authorBicker <bickerkards@tuta.io>2019-05-22 17:45:37 +0200
committerBicker <bickerkards@tuta.io>2019-05-22 17:45:37 +0200
commit25314fd2aed81aa5281bc3d93dbcc7919368ebe1 (patch)
tree1995521ee652e419926de5fced0f2e3b655e70fb /pyquest.py
Initial commitHEADmaster
Diffstat (limited to 'pyquest.py')
-rw-r--r--pyquest.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/pyquest.py b/pyquest.py
new file mode 100644
index 0000000..caf0726
--- /dev/null
+++ b/pyquest.py
@@ -0,0 +1,43 @@
+from argparse import ArgumentParser
+from sys import argv
+from sys import exit
+
+from PyQt5.QtWidgets import QApplication
+
+from gui.windows.main import MainWindow
+from ql.parser.lexer import QLLexer
+from ql.parser.parser import QLParser
+from ql.test.expression_evaluation.test_expression_evaluation import TestExpressionEvaluation
+from ql.test.lexing.test_lexing import TestLexing
+from ql.test.parsing.test_parsing import TestParsing
+from ql.test.semantic_analysis.test_semantic_analysis import TestSemanticAnalysis
+
+
+def main():
+ parser = ArgumentParser(prog='PyQuest')
+ parser.add_argument('-t', '--test', action='store_true', help="Perform tests.")
+ arguments = parser.parse_args()
+
+ if arguments.test:
+ ql_lexer = QLLexer()
+ ql_lexer.build()
+ ql_parser = QLParser()
+ ql_parser.build()
+
+ test_lexer = TestLexing('ql/test/lexing/', ql_lexer)
+ test_parser = TestParsing('ql/test/parsing/', ql_lexer, ql_parser)
+ test_semantic_analyzer = TestSemanticAnalysis('ql/test/semantic_analysis/', ql_lexer, ql_parser)
+ test_evaluation = TestExpressionEvaluation('ql/test/expression_evaluation/', ql_lexer, ql_parser)
+
+ test_lexer.test()
+ test_parser.test()
+ test_semantic_analyzer.test()
+ test_evaluation.test()
+ else:
+ application = QApplication(argv)
+ main_window = MainWindow()
+ exit(application.exec_())
+
+
+if __name__ == '__main__':
+ main()