6#include <unordered_map>
12#define PRODUCTION_TOK TOK_ID
31std::vector<Token>
lSystem(
int iterations,
const std::vector<ProductionRule>& productionRules,
const std::vector<Token>& inputTokens);
42int match(std::string
match,
const std::vector<ProductionRule>& rules);
64void applyCallIds(std::list<Token>& outputTokens,
int& callCounter);
75void applyProductionRules(std::list<Token>& outputTokens,
const std::vector<ProductionRule>& productionRules);
The lSystem namespace contains functions to apply L-system rules to sequences of tokens,...
Definition lSystem.h:18
void applyProductionRules(std::list< Token > &outputTokens, const std::vector< ProductionRule > &productionRules)
Applies production rules to the output tokens.
Definition lSystem.cpp:76
int match(std::string match, const std::vector< ProductionRule > &rules)
Matches a string to a production rule.
Definition lSystem.cpp:22
int findEqualCall(const std::unordered_map< std::vector< Token >, int, TokenVectorHash, TokenVectorEqual > &callMap, const std::vector< Token > &callTokens)
Finds an existing call ID for a given set of tokens, if one exists.
Definition lSystem.cpp:30
void applyCallIds(std::list< Token > &outputTokens, int &callCounter)
Applies call IDs to sequences of tokens representing function calls.
Definition lSystem.cpp:37
Equality comparison object for vectors of Tokens.
Definition globalStructs.h:67
Hash function object for a vector of Tokens.
Definition globalStructs.h:42