libqasm
library for handling cQASM files
|
Internal helper class for parsing cQASM files. More...
Public Member Functions | |
virtual | ~ParseHelper () |
Destroys the parse helper. More... | |
void | push_error (const std::string &error) |
Pushes an error. More... | |
Public Attributes | |
FILE * | fptr = nullptr |
File pointer being scanned, if no data was specified. More... | |
void * | buf = nullptr |
Flex data buffer, if data was specified. More... | |
void * | scanner = nullptr |
Flex reentrant scanner data. More... | |
std::string | filename |
Name of the file being parsed. More... | |
ParseResult | result |
The parse result. More... | |
Friends | |
ParseResult | parse_file (const std::string &filename) |
Parse the given file. More... | |
ParseResult | parse_file (FILE *file, const std::string &filename) |
Parse using the given file pointer. More... | |
ParseResult | parse_string (const std::string &data, const std::string &filename) |
Parse the given string. More... | |
Internal helper class for parsing cQASM files.
Definition at line 65 of file cqasm-v1-parse-helper.hpp.
#include <cqasm-v1-parse-helper.hpp>
|
virtual |
Destroys the parse helper.
Destroys the analyzer.
Definition at line 130 of file cqasm-v1-parse-helper.cpp.
void cqasm::v1::parser::ParseHelper::push_error | ( | const std::string & | error | ) |
Pushes an error.
Definition at line 145 of file cqasm-v1-parse-helper.cpp.
|
friend |
Parse the given file.
Throws an AnalysisError if this fails.
Definition at line 16 of file cqasm-v1-parse-helper.cpp.
|
friend |
Parse using the given file pointer.
Throws an AnalysisError if this fails. The file is rewound back to the start when parsing completes.
Definition at line 23 of file cqasm-v1-parse-helper.cpp.
|
friend |
Parse the given string.
A filename may be given in addition for use within error messages.
A filename may be given in addition for use within the AnalysisError thrown when version parsing fails.
Definition at line 31 of file cqasm-v1-parse-helper.cpp.
FILE* cqasm::v1::parser::ParseHelper::fptr = nullptr |
File pointer being scanned, if no data was specified.
Definition at line 71 of file cqasm-v1-parse-helper.hpp.
void* cqasm::v1::parser::ParseHelper::buf = nullptr |
Flex data buffer, if data was specified.
Definition at line 76 of file cqasm-v1-parse-helper.hpp.
void* cqasm::v1::parser::ParseHelper::scanner = nullptr |
Flex reentrant scanner data.
Definition at line 81 of file cqasm-v1-parse-helper.hpp.
std::string cqasm::v1::parser::ParseHelper::filename |
Name of the file being parsed.
Definition at line 86 of file cqasm-v1-parse-helper.hpp.
ParseResult cqasm::v1::parser::ParseHelper::result |
The parse result.
Definition at line 91 of file cqasm-v1-parse-helper.hpp.