public void VerifyType(Token2Type type) { if (CurrentToken.type != type) { throw new Exception(string.Format("Expected {0}, got {1}", type, CurrentToken)); } }
public void AcceptOrThrow(Token2Type type, string value) { if (CurrentToken.type != type) { throw new Exception(string.Format("Expected {0} '{2}', got {1}", type, CurrentToken, value)); } if (CurrentToken.value != value) { throw new Exception(string.Format("Expected '{0}', not '{1}'", value, CurrentToken.value)); } Advance(true); }
public bool Accept(Token2Type type, string value) { if (CurrentToken.type != type) { return(false); } if (CurrentToken.value != value) { return(false); } Advance(true); return(true); }
public void AcceptOrThrow (Token2Type type, string value) { if (CurrentToken.type != type) throw new Exception (string.Format ("Expected {0} '{2}', got {1}", type, CurrentToken, value)); if (CurrentToken.value != value) throw new Exception (string.Format ("Expected '{0}', not '{1}'", value, CurrentToken.value)); Advance (true); }
public bool Accept (Token2Type type, string value) { if (CurrentToken.type != type) return false; if (CurrentToken.value != value) return false; Advance (true); return true; }
public void VerifyType (Token2Type type) { if (CurrentToken.type != type) throw new Exception (string.Format ("Expected {0}, got {1}", type, CurrentToken)); }
public Token2 (Token2Type type, char value) { //Console.WriteLine ("Token2: {0}, '{1}'", type, value); this.type = type; this.value = value.ToString (); }
public Token2 (Token2Type type, string value) { //Console.WriteLine ("Token2: {0}, '{1}'", type, value); this.type = type; this.value = value; }
public Token2(Token2Type type, char value) { //Console.WriteLine ("Token2: {0}, '{1}'", type, value); this.type = type; this.value = value.ToString(); }
public Token2(Token2Type type, string value) { //Console.WriteLine ("Token2: {0}, '{1}'", type, value); this.type = type; this.value = value; }