Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

26 rader
644 B

1 år sedan
1 år sedan
1 år sedan
  1. #pragma once
  2. #include <vector>
  3. #include <map>
  4. #include <string>
  5. namespace molasses {
  6. // We will always want symbols to be convertible to int for dictionary lookups
  7. struct symbol {
  8. int id;
  9. std::string file_name;
  10. int line;
  11. int column;
  12. [[no_unique_address]] bool is_string;
  13. operator int() const {
  14. return id;
  15. }
  16. };
  17. struct lexed_output {
  18. std::map<int, std::string> dictionary;
  19. std::vector<symbol> symbols;
  20. };
  21. lexed_output lex(const std::string & file_name,const std::string & source);
  22. lexed_output concatenate(const lexed_output& lhs, const lexed_output& rhs);
  23. }