public override void ExitKeyword([NotNull] ClojureObrParser.KeywordContext context) { // KeyWordNode node = new KeyWordNode(context.GetText()); TypedNodes.Put(context, node); }
public override void ExitMap([NotNull] ClojureObrParser.MapContext context) { // int count = context.children.Count; var pairs = new List <KeyValuePairNode>(); for (int i = 1; i < count - 1; i += 2) { KeyWordNode key = (KeyWordNode)TypedNodes.Get(context.children[i]); ExprNode val = (ExprNode)TypedNodes.Get(context.children[i + 1]); pairs.Add(new KeyValuePairNode(key, val)); } MapNode node = new MapNode(pairs); TypedNodes.Put(context, node); }
public KeyValuePairNode(KeyWordNode keyNode, ExprNode valueNode) { type = NodeType.KeyValuePair; key = keyNode; value = valueNode; }