void PrepareValidation(Root root, Expression expression, Import import) { if (import != null) { expression.Imports.Add(import); foreach (var c in expression.ChildExpressions) PrepareValidation(root, c, import); } }
// Build an import expression: one for each name imported. public static void BuildImport(IronyParser parser, Root root, Expression parentExpression, ParseTreeNode currentNode) { foreach (var node in currentNode.ChildNodes[1].ChildNodes) { var i = new Import(parentExpression, currentNode.FindToken().Convert()); parentExpression.ChildExpressions.Add(i); i.ParentExpression = parentExpression; i.Name = node.FindTokenAndGetText(); } }