|
DynGenPar
Dynamic Generalized Parser
|
PMCFG. More...
Public Attributes | |
grammar | |
| QList< Function > | functions |
| list of PMCFG functions | |
| RuleSet | rules |
| set of PMCFG rules | |
| TokenSet | tokens |
| set of true tokens | |
| Cat | startCat |
| start category | |
| RuleSet | cfRules |
| optional context-free rules | |
function name tables (optional) | |
| QHash< int, QString > | functionNames |
| QHash< QString, int > | functionIndices |
| void | addFunction (const QString &name, const Function &function) |
| Function | lookupFunction (const QVariant &id) const |
PMCFG.
Definition at line 906 of file dyngenpar.h.
| void DynGenPar::Pmcfg::addFunction | ( | const QString & | name, |
| const Function & | function | ||
| ) | [inline] |
Definition at line 954 of file dyngenpar.h.
| Function DynGenPar::Pmcfg::lookupFunction | ( | const QVariant & | id | ) | const [inline] |
Definition at line 960 of file dyngenpar.h.
optional context-free rules
allows specifying rules for context-free categories which can be used as "token" terms in PMCFG functions, e.g. A -> "a" | "an"
Definition at line 947 of file dyngenpar.h.
| QHash<QString, int> DynGenPar::Pmcfg::functionIndices |
Definition at line 953 of file dyngenpar.h.
| QHash<int, QString> DynGenPar::Pmcfg::functionNames |
Definition at line 952 of file dyngenpar.h.
list of PMCFG functions
This list does not store function names. They can be optionally used and are stored in functionNames and functionIndices.
Definition at line 913 of file dyngenpar.h.
set of PMCFG rules
Rules should be labeled with the index of the function in functions or its name as found in functionNames and functionIndices. The expression of the rule is interpreted as the argument list for the function. For example:
Rule(1) << "A" << "B"; // calls function #1 with (A, B) as parameters Rule("f") << "A" << "B"; // calls f(A, B)
In a standard PMCFG, the argument list may contain only PMCFG nonterminals. The syntax tree then only contains the function and the syntax trees for each argument. This implementation also allows tokens and context-free nonterminals as function arguments, in which case the syntax tree will contain the parse tree for the context-free argument. In particular, in the case of a token, the data attached to the token is retained.
Definition at line 932 of file dyngenpar.h.
start category
The start category must be 1-dimensional.
Definition at line 938 of file dyngenpar.h.
set of true tokens
(must NOT contain context-free nonterminals)
Definition at line 935 of file dyngenpar.h.
1.7.4