ParserTokens.hpp 793 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef PARSER_TOKENS
  2. #define PARSER_TOKENS
  3. #include "inc.hpp"
  4. /*
  5. why hello there!
  6. i know most of this is bad, i honestly don't care too much because it's my first project. -yogurt
  7. */
  8. static string token_names[] = {
  9. "end of file",
  10. "a '.'",
  11. "a ','",
  12. "a ';'",
  13. "a '='",
  14. "a '{'",
  15. "a '}'",
  16. "a '('",
  17. "a ')'",
  18. "\"Project\"",
  19. "\"Library\"",
  20. "\"static\"",
  21. "\"dynamic\"",
  22. "\"recursive\"",
  23. "a string literal",
  24. "an identifier",
  25. "\"true\""
  26. "\"false\""
  27. };
  28. enum ParserTokenKind: uint8_t
  29. {
  30. END,
  31. DOT,
  32. COMMA,
  33. SEMICOLON,
  34. ASSIGN,
  35. LCURLY,
  36. RCURLY,
  37. LPAREN,
  38. RPAREN,
  39. PROJECT,
  40. LIBRARY,
  41. STATIC,
  42. DYNAMIC,
  43. RECURSIVE,
  44. STRING_LITERAL,
  45. IDENTIFIER,
  46. SYSTEM,
  47. B_TRUE,
  48. B_FALSE,
  49. };
  50. struct ParserToken
  51. {
  52. ParserTokenKind type;
  53. std::string value;
  54. int32_t line;
  55. };
  56. #endif //PARSER_TOKENS