blob: caf0726eec6cd2d298ff2914c3fa52da202637c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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()
|