From 25314fd2aed81aa5281bc3d93dbcc7919368ebe1 Mon Sep 17 00:00:00 2001 From: Bicker Date: Wed, 22 May 2019 17:45:37 +0200 Subject: Initial commit --- .../__pycache__/block_statement.cpython-35.pyc | Bin 0 -> 804 bytes .../__pycache__/form_statement.cpython-35.pyc | Bin 0 -> 820 bytes .../__pycache__/if_statement.cpython-35.pyc | Bin 0 -> 807 bytes .../__pycache__/question_statement.cpython-35.pyc | Bin 0 -> 1495 bytes ql/ast/nodes/statements/block_statement.py | 11 ++++++++ ql/ast/nodes/statements/form_statement.py | 12 ++++++++ ql/ast/nodes/statements/if_statement.py | 11 ++++++++ ql/ast/nodes/statements/question_statement.py | 31 +++++++++++++++++++++ 8 files changed, 65 insertions(+) create mode 100644 ql/ast/nodes/statements/__pycache__/block_statement.cpython-35.pyc create mode 100644 ql/ast/nodes/statements/__pycache__/form_statement.cpython-35.pyc create mode 100644 ql/ast/nodes/statements/__pycache__/if_statement.cpython-35.pyc create mode 100644 ql/ast/nodes/statements/__pycache__/question_statement.cpython-35.pyc create mode 100644 ql/ast/nodes/statements/block_statement.py create mode 100644 ql/ast/nodes/statements/form_statement.py create mode 100644 ql/ast/nodes/statements/if_statement.py create mode 100644 ql/ast/nodes/statements/question_statement.py (limited to 'ql/ast/nodes/statements') diff --git a/ql/ast/nodes/statements/__pycache__/block_statement.cpython-35.pyc b/ql/ast/nodes/statements/__pycache__/block_statement.cpython-35.pyc new file mode 100644 index 0000000..8ec170d Binary files /dev/null and b/ql/ast/nodes/statements/__pycache__/block_statement.cpython-35.pyc differ diff --git a/ql/ast/nodes/statements/__pycache__/form_statement.cpython-35.pyc b/ql/ast/nodes/statements/__pycache__/form_statement.cpython-35.pyc new file mode 100644 index 0000000..e10775a Binary files /dev/null and b/ql/ast/nodes/statements/__pycache__/form_statement.cpython-35.pyc differ diff --git a/ql/ast/nodes/statements/__pycache__/if_statement.cpython-35.pyc b/ql/ast/nodes/statements/__pycache__/if_statement.cpython-35.pyc new file mode 100644 index 0000000..e81cfc1 Binary files /dev/null and b/ql/ast/nodes/statements/__pycache__/if_statement.cpython-35.pyc differ diff --git a/ql/ast/nodes/statements/__pycache__/question_statement.cpython-35.pyc b/ql/ast/nodes/statements/__pycache__/question_statement.cpython-35.pyc new file mode 100644 index 0000000..6b86ed9 Binary files /dev/null and b/ql/ast/nodes/statements/__pycache__/question_statement.cpython-35.pyc differ diff --git a/ql/ast/nodes/statements/block_statement.py b/ql/ast/nodes/statements/block_statement.py new file mode 100644 index 0000000..2013c82 --- /dev/null +++ b/ql/ast/nodes/statements/block_statement.py @@ -0,0 +1,11 @@ +from ql.ast.nodes.base import BaseNode + + +class BlockStatementNode(BaseNode): + def __init__(self, metadata, block): + super(BlockStatementNode, self).__init__(metadata) + self.__block = block + + @property + def block(self): + return self.__block diff --git a/ql/ast/nodes/statements/form_statement.py b/ql/ast/nodes/statements/form_statement.py new file mode 100644 index 0000000..0030623 --- /dev/null +++ b/ql/ast/nodes/statements/form_statement.py @@ -0,0 +1,12 @@ +from ql.ast.nodes.statements.block_statement import BlockStatementNode + + +class FormNode(BlockStatementNode): + def __init__(self, metadata, block, identifier): + super(FormNode, self).__init__(metadata, block) + self.__identifier = identifier + + @property + def identifier(self): + return self.__identifier + diff --git a/ql/ast/nodes/statements/if_statement.py b/ql/ast/nodes/statements/if_statement.py new file mode 100644 index 0000000..68845b8 --- /dev/null +++ b/ql/ast/nodes/statements/if_statement.py @@ -0,0 +1,11 @@ +from ql.ast.nodes.statements.block_statement import BlockStatementNode + + +class IfNode(BlockStatementNode): + def __init__(self, metadata, block, condition): + super(IfNode, self).__init__(metadata, block) + self.__condition = condition + + @property + def condition(self): + return self.__condition diff --git a/ql/ast/nodes/statements/question_statement.py b/ql/ast/nodes/statements/question_statement.py new file mode 100644 index 0000000..2878449 --- /dev/null +++ b/ql/ast/nodes/statements/question_statement.py @@ -0,0 +1,31 @@ +from ql.ast.nodes.base import BaseNode + + +class QuestionNode(BaseNode): + def __init__(self, line_number, label, identifier, answer_type, answer, computed): + super(QuestionNode, self).__init__(line_number) + self.__label = label + self.__identifier = identifier + self.__answer_type = answer_type + self.__answer = answer + self.__computed = computed + + @property + def label(self): + return self.__label + + @property + def identifier(self): + return self.__identifier + + @property + def answer_type(self): + return self.__answer_type + + @property + def answer(self): + return self.__answer + + @property + def computed(self): + return self.__computed -- cgit v1.2.3