Ethan Ward's Project Blog

Work this week has still been slow so far, though I think I have had a few breakthroughs with some of my problems. The user input for set notation now works, so the next step is adding the parsing that will check the input for syntax, and then an algorithm to generate a parse tree. I had seriously underestimated both the complexity and importance of this part of the task. My first instinct with this was to use a recursive descent parser, though parens are giving me a little trouble with conceptualizing that. My current idea for solving that would involve recursively calling a new instance of my parsing function for every left paren I encounter, ending when a right paren is found. I figure I would need to include a depth level in the function so that I could check against having more right parens than left parens. Luckily, the language I need to deal with for parsing is fairly easy, with my sets acting as terminals, three operators of the same significance, parens that ultimately condense down to the value of a terminal, and the complement operator. I should write up some BNF notation to technically describe this.