Adds generic child link support to ASTNode (addChild/setChild for multi/single- valued roles, getChildren/getChild/allChildren for traversal). Function and Variable as first child concepts of Module. Test builds Module->Function tree, walks parent/child pointers in both directions, verifies single-valued replace. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
301 B
C++
15 lines
301 B
C++
#pragma once
|
|
#include "ASTNode.h"
|
|
|
|
class Variable : public ASTNode {
|
|
public:
|
|
std::string name;
|
|
|
|
Variable() { conceptType = "Variable"; }
|
|
Variable(const std::string& id, const std::string& name)
|
|
: name(name) {
|
|
this->id = id;
|
|
this->conceptType = "Variable";
|
|
}
|
|
};
|