22 class Version :
public std::vector<std::int64_t> {
28 explicit Version(
const std::string &version =
"1.0");
46 int compare(
const std::string &other)
const;
94 void *scanner =
nullptr;
117 ParseHelper(
const std::string &filename,
const std::string &data,
bool use_file);
123 ParseHelper(
const std::string &filename, FILE *fptr);
145 static void push_error(
const std::string &error);
Version version
The parse result.
Version parse_file(const std::string &filename)
Parse the given file to get its version number.
Toplevel namespace with entry points for the new API.
Version(const std::string &version="1.0")
Constructs a version object from a string, defaulting to 1.0.
Version number primitive used within the AST and semantic trees.
std::ostream & operator<<(std::ostream &os, const Version &object)
Stream << overload for version nodes.
Internal helper class for parsing cQASM file versions.
std::string filename
Name of the file being parsed.
Version parse_string(const std::string &data, const std::string &filename)
Parse the given string as a file to get its version number.
int compare(const Version &other) const
Compares this version against the other version.