Author: Matt Chapman
form exampleForm {
"Test question 1"
testQuestion1: boolean;
"Test question 2"
testQuestion2: boolean;
"Test question 3"
testQuestion3: boolean;
if (testQuestion1 && testQuestion2 || testQuestion3) {
"Conditional question 1"
conditionalQuestion1: integer;
"Conditional question 2"
conditionalQuestion2: integer;
"Math question 1:"
mathQuestion1:integer =
(conditionalQuestion1 - conditionalQuestion2);
}
if (complexConditional) {
"if Question"
complexConditionalQuestion1: boolean;
} else {
"else Question"
complexConditionalQuestion2: boolean;
}
}
- Antlr4
- JUnit 4
java Launcher
to run. The application will provide a filepicker for input. Append the argument -debug
to bypass the filepicker and run using res/test.txt
.
- QL Grammar
- QLVisitor implementation
- Replacement error listener for parser
- Application launcher
- AST
- Form, Statement, Question classes
- IfStatement, IfElseStatement classes
- Classes for Operations
- Basic types
- Strings
- Booleans
- Integers
- AST Processing
- Type checking
- reference to undefined questions
- duplicate question declarations with different types
- conditions that are not of the type boolean
- operands of invalid type to operators
- cyclic dependencies between questions
- duplicate labels
- Error handling
- Error class
- Error collection class
- Make all tests return Error objects
- Halt on bad error - don't throw exception!
- Output in GUI
- Type checking
- GUI generation
- Unit tests