tree-sitter/src/compiler/rules/metadata.h

34 lines
843 B
C
Raw Normal View History

#ifndef COMPILER_RULES_METADATA_H_
#define COMPILER_RULES_METADATA_H_
#include <string>
#include <map>
#include "compiler/rules/rule.h"
namespace tree_sitter {
namespace rules {
typedef enum {
START_TOKEN,
PRECEDENCE,
IS_TOKEN,
} MetadataKey;
class Metadata : public Rule {
public:
Metadata(rule_ptr rule, std::map<MetadataKey, int> value);
2014-04-04 13:10:55 -07:00
bool operator==(const Rule& other) const;
size_t hash_code() const;
rule_ptr copy() const;
std::string to_string() const;
void accept(Visitor *visitor) const;
int value_for(MetadataKey key) const;
2014-04-04 13:10:55 -07:00
const rule_ptr rule;
const std::map<MetadataKey, int> value;
};
}
}
#endif // COMPILER_RULES_METADATA_H_