Qorus Integration Engine®
4.0.3.p2_git
|
Qorus Source Code parser class. More...
Public Member Methods | |
constructor (string n_type, hash n_tags, string n_encoding="utf8", bool n_verbose=False, bool n_quiet=False, bool n_missing_tag_warning=True) | |
the constructor only sets internal values and does not do any other processing | |
list< hash< auto > > | content () |
returns a list of hashes with Qorus object information More... | |
suppressFileAnnouncement () | |
supress output when starting to parse each file | |
parse (string fn) | |
Parse content of the file. More... | |
parseInput (string fn, AbstractLineIterator i) | |
Parse content of the input iterator. More... | |
finalizeParsing () | |
"virtual" method; to be reimplemented in derived classes | |
postParsing () | |
"virtual" method; to be reimplemented in derived classes | |
abstract | doEnd (bool explicit, *hash< auto > orig_tags) |
to be reimplemented in derived classes | |
bool | gotTag (string tag, reference val) |
"virtual" method; to be overloaded in derived classes More... | |
Private Attributes | |
hash | info |
tag info hash | |
string | type |
type of object being parsed (ie: "function", "class", etc) | |
hash | re |
regex cache | |
string | fn |
file name | |
int | line = 0 |
line number | |
int | offset = 0 |
line number offset for object | |
int | count = 0 |
number of objects parsed | |
hash | tags |
hash of tags | |
hash | uinfo |
hash of parsed user tags values (to be stored in the *_tags table) | |
string | buf |
object's string buffer | |
string | encoding |
encoding of the file | |
bool | verbose |
additional "verbose" output (default False) | |
bool | quiet |
suppress all outputs except errors (default False) | |
bool | suppress_file_announcement |
suppress file output when starting to parse a file | |
bool | do_ok |
output "OK\n" at the end of parsing | |
bool | missing_tag_warning |
show missing tag warnings (default True) | |
list< hash< auto > > | content |
Keep parsed objects to return wuth content(); see addToContent(); name -> content hash. | |
Qorus Source Code parser class.
This class verifies metadata (tags) provided in the source file and parse the content to be potentially loaded into Qorus DB.
construct the object, call parse()
, and verify it by content()
returns a list of hashes with Qorus object information
metainfo:
A hash with meta information per object ("name"
, "version"
, "patch"
, ...); its structure depends on the object typebuffer:
the source code of the objecttype:
the type of the object ("constant"
, "class"
, ...)filename:
Name of the original filetags:
A hash with tags provided to the instance constructor bool OMQ::TaggedFileParser::gotTag | ( | string | tag, |
reference | val | ||
) |
"virtual" method; to be overloaded in derived classes
tag | the tag found |
val | a reference to the value read; always initially passed as a string, can be modified by the method |
OMQ::TaggedFileParser::parse | ( | string | fn | ) |
Parse content of the file.
fn | string, a file name (including path) to be parsed |
OMQ::TaggedFileParser::parseInput | ( | string | fn, |
AbstractLineIterator | i | ||
) |
Parse content of the input iterator.
fn | string, the file name (including path) |
i | the input iterator |