private void ConvertActionList(PegNode node, IList<IBfsAction> actions) { if (GetNodeId(node) != EBinaryFileSchemaParser.action_list) throw new AstConvertException("Wasn't an action list node!"); for (node = node.child_; node != null; node = node.next_) { switch(GetNodeId(node)) { case EBinaryFileSchemaParser.output: BfsActionOutput output = new BfsActionOutput(); StoreSourceRange(node, output); BfsSourceRange range = new BfsSourceRange(); range.Begin = node.child_.next_.match_.posBeg_; range.Length = node.child_.next_.match_.Length; output.ArgumentSourceRange = range; output.FunctionName = GetNodeText(node.child_); output.Argument = GetNodeText(node.child_.next_); actions.Add(output); break; case EBinaryFileSchemaParser.assignment: BfsActionUnresolvedAssignment assignment = new BfsActionUnresolvedAssignment(); StoreSourceRange(node, assignment); assignment.UnresolvedVariableName = GetNodeText(node.child_); assignment.Expression = ConvertExpression(node.child_.next_); actions.Add(assignment); break; } } }