Quick wizard for function tables
|Top Previous Next|
The function table wizard makes the extension of a function table with new functions easier. The wizard appears if you click with the right mouse button on the name of a function table in the list of the class elements.
Write the label of the node type and the name of the function, which shall handle this type, in the upper two fields. Then, by the Insert button an additional entry for the function table is created:
and at the same time a new function is created, which has the same parameters as defined for the function table and a return type, which corresponds to the type of the function table.
In the combo box Kind, you first can chose a frame type for the new function.
If e.g. the actual function table is of the type str_mstrfun with a node parameter, with the iterator frame the following function will be inserted on the element page:
Parameter: const node& xnNode
node pos = xnNode.firstChild();
while(pos != node::npos)
s += m_ftExpr.visit(xState, pos);
pos = pos.nextSibling();
For the Kind value the following text is created:
For the Kind empty the brackets are created only.
The function frame then can be modified by hand.
A simple method to construct a solid linkage of:
is, to name the label by the name of the production. That's why the wizard contains a list of the names of the productions as choice for the label.
If the check box Insert tree nodes in production is activated, in front of the parameters of the production is put an additional node parameter and to the beginning of the text the following code is written:
For the calls of the production the additional parameter must be inserted by hand.
If in the calling production the same code was written by the wizard, the additional parameter mostly is: n:
This page belongs to the TextTransformer Documentation
|Home Content German|