keywords.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*-------------------------------------------------------------------------
  2. *
  3. * keywords.h
  4. * lexical token lookup for key words in PostgreSQL
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/common/keywords.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef KEYWORDS_H
  15. #define KEYWORDS_H
  16. /* Keyword categories --- should match lists in gram.y */
  17. #define UNRESERVED_KEYWORD 0
  18. #define COL_NAME_KEYWORD 1
  19. #define TYPE_FUNC_NAME_KEYWORD 2
  20. #define RESERVED_KEYWORD 3
  21. typedef struct ScanKeyword
  22. {
  23. const char *name; /* in lower case */
  24. int16 value; /* grammar's token code */
  25. int16 category; /* see codes above */
  26. } ScanKeyword;
  27. #ifndef FRONTEND
  28. extern PGDLLIMPORT const ScanKeyword ScanKeywords[];
  29. extern PGDLLIMPORT const int NumScanKeywords;
  30. #else
  31. extern const ScanKeyword ScanKeywords[];
  32. extern const int NumScanKeywords;
  33. #endif
  34. extern const ScanKeyword *ScanKeywordLookup(const char *text,
  35. const ScanKeyword *keywords,
  36. int num_keywords);
  37. #endif /* KEYWORDS_H */