public override void Parse(Context context) { while (true) { if (context.CurrentToken() == null) { throw new InvalidCastException(); } else if (context.CurrentToken().Equals("end")) { context.SkipToken("end"); break; } else { Node commandNode = new CommandNode(); commandNode.Parse(context); _list.Add(commandNode); } } }
public void Parse(Context context) { while (true) { if (context.CurrentToken() == null) { throw new ParseException("Missing 'end'"); } else if (context.CurrentToken().Equals("end")) { context.SkipToken("end"); break; } else { INode commandNode = new CommandNode(); commandNode.Parse(context); list.Add(commandNode); } } }