mechaniputer / libreDSSP

A GPL Licensed DSSP Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parser is horrible

mechaniputer opened this issue · comments

The piece of code that takes a line of input (from either a file or the interactive prompt) and divides it into commands is especially horrible and error-prone. The command stack itself should probably be rewritten as a queue so that the parser doesn't need to fill a linked list before adding anything to the stack (in reverse order). It could instead just put stuff right into the back of the queue.

This calls for a fundamental redesign of the way commands are processed prior to being evaluated. This is the worst part of the code right now and also the most annoying to rewrite. It greatly affects the efficiency and safety of the interpreter so it is a high priority.

Relevant to this, it is currently not allowed to have a comment between clauses in a BR/ELSE statement. The new parsing system should allow this since that's a place where comments are likely to be useful.