// Generic function that handles ENDFILE, BACKSPACE and REWIND since they // all take the exact same parameters. ParseNode PositionStatement(string keyword) { ExtCallParseNode node = new ExtCallParseNode("JComLib.IO,jcomlib", keyword); InitFunctionNodes(); ControlList cilist = ParseCIList(_posFunction.ParameterList); if (cilist == null) { SkipToEndOfLine(); return null; } if (cilist["UNIT"] == null) { _messages.Error(MessageCode.UNITREQUIRED, "UNIT specifier required for REWIND"); return null; } node.Parameters = _posFunction.ParametersNode(cilist); // Wrap into a conditional if an ERR label is specified. if (cilist.Has("ERR")) { SwitchParseNode switchNode = new SwitchParseNode(); switchNode.CompareExpression = node; switchNode.Add(new NumberParseNode(-1), cilist["ERR"]); return switchNode; } return node; }
/// INQUIRE keyword /// Inquire of the state of a file. ParseNode KInquire() { ExtCallParseNode node = new ExtCallParseNode("JComLib.IO,jcomlib", "INQUIRE"); InitFunctionNodes(); ControlList cilist = ParseCIList(_inquireFunction.ParameterList); if (cilist == null) { SkipToEndOfLine(); return null; } node.Parameters = _inquireFunction.ParametersNode(cilist); // Wrap into a conditional if an ERR label is specified. if (cilist.Has("ERR")) { SwitchParseNode switchNode = new SwitchParseNode(); switchNode.CompareExpression = node; switchNode.Add(new NumberParseNode(-1), cilist["ERR"]); return switchNode; } return node; }