aboutsummaryrefslogtreecommitdiff
path: root/src/tree.h
AgeCommit message (Collapse)Author
2014-10-01Moved child pointers to OperatorNode classAdrian Kummerlaender
* access was restricted by declaring them private and offering member methods such as "hasChildren" * only OperatorNode instances have children, there is no reason for wasting space by keeping empty pointers around in all other instances * this enabled the removal of all nullptr comparisons from tree construction * changed "Tree::addNode" factory method template to return a pointer to the type of the constructed node instance instead of a plain node pointer
2014-09-26Simplified Tree::addNode and continued cleanupAdrian Kummerlaender
* member method "addNode" of "Tree" was relieved of its uneccessary "place" argument * again contified where possible ** e.g. the "buildTree" local element vectors for storing the lexer result
2014-09-25Increased tree constness and added constructor aliasesAdrian Kummerlaender
* as with all Node classes the public member methods of the "Tree" class do not need to be non-const * both constructors are more easily expressed as aliases of a single constructor that takes both the term and a pointer to a constant map instance * the tree is now constructed during member initialization
2014-03-04Did some refactoring to improve readabilityAdrian Kummerländer
* now using range for-loops during Tree printing * inroduced popNode helper method which helps to simplify the Tree construction implementation
2013-10-29Added previously missing parser.ccAdrian Kummerländer
2013-10-20Implemented constant identifier functionalityAdrian Kummerländer
* SimpleParser optionally acceps a pointer to an ConstantMap containing string keys mapping to values * Constants are handled in their own ConstantNode class derived from the standard Node class * Operator precedence is now determined separated from the TokenType using a new PrecedenceLevel enum ** Conversion between tokens and their PrecedenceLevel is possible using the new utility function getPrecedence * Added additional test cases for constant identifier resolutions
2013-10-19Merged Node factory-methods into template methodAdrian Kummerländer
Added ConstantNode blueprint
2013-10-19Switched OperatorNode to TokenTypeAdrian Kummerländer
* OperatorNode class now uses TokenType for internal operator storage and logic selection * print-Method resolves the TokenType back into its character representation
2013-10-19POC: alphabetic constantsAdrian Kummerländer
* New priority for alphabetic characters * Overloaded OperandNode constructor * Currently not usable, only basic proof of concept
2013-09-26Code restructuring of tree and parsing logicAdrian Kummerländer
* Enabled tree to generate itself ** Main work is now done during tree construction * Moved lexer and getPriority utility functions into separate compilation unit
2013-01-05Moved node classes into separate compilation unit; File extension changeAdrian Kummerländer
2013-01-05Folder structure change; Further improvements of parser codeAdrian Kummerländer