private bool isAToken(PieceTokenizer f, bool advance = true) { bool j = isToken(f, "+", false) || isToken(f, "(", false) || isToken(f, ")", false) || isToken(f, "|", false) || isToken(f, "?", false); if (j) { if (advance) f.Progress(); } return j; }
public bool isToken(PieceTokenizer f, string tok, bool advance = true) { int d; bool fc = f.CurrentPiece() == tok; if (fc && advance) f.Progress(); return fc; }
public bool isString(PieceTokenizer f, bool advance = true) { bool fc = f.CurrentPiece().StartsWith("\"") && f.CurrentPiece().EndsWith("\""); if (fc && advance) f.Progress(); return fc; }
public bool isNumber(PieceTokenizer f, bool advance = true) { int d; bool fc = int.TryParse(f.CurrentPiece(), out d); if (fc && advance) f.Progress(); return fc; }
public bool isBool(PieceTokenizer f, bool advance = true) { bool d; bool fc = bool.TryParse(f.CurrentPiece(), out d); if (fc && advance) f.Progress(); return fc; }
public string getWord(PieceTokenizer f, bool advance = true) { bool j = !isAToken(f, false) && !isBool(f, false) && !isNumber(f, false) && !isString(f, false); if (j) { string d; Console.WriteLine(d = f.CurrentPiece()); if (advance) f.Progress(); return d; } return null; }