public void Parse(Context context) { context.SkipToken("repeat"); number = context.CurrentNumber(); context.NextToken(); commandListNode = new CommandListNode(); commandListNode.Parse(context); }
public void Parse(Context context) { name = context.CurrentToken(); context.SkipToken(name); if (!name.Equals("go") && !name.Equals("right") && !name.Equals("left")) { throw new ParseException(name + " is undefined"); } }
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); } } }
public void Parse(Context context) { context.SkipToken("program"); commandListNode = new CommandListNode(); commandListNode.Parse(context); }