// Visitor top level program rule/node handler. Runs the program evaluating each block at a time public override object VisitProgram([NotNull] FanucGCodeParser.ProgramContext context) { // interpret the blocks of the gcode program var blockContexts = context.programContent().block(); do { uint currBlockPtr = _stack.Peek().CurrentBlockIndex; VisitBlock(blockContexts[currBlockPtr]); if (currBlockPtr == _stack.Peek().CurrentBlockIndex) { // ptr was unmodified by block, so go to next block _stack.Peek().CurrentBlockIndex++; } } while (_stack.Peek().CurrentBlockIndex < blockContexts.Length); return(null); }
public override void EnterProgram([NotNull] FanucGCodeParser.ProgramContext context) { _name = $"O{context.programNumber().DIGITS().GetText()}"; base.EnterProgram(context); }