本文整理汇总了C++中SNode::firstChild方法的典型用法代码示例。如果您正苦于以下问题:C++ SNode::firstChild方法的具体用法?C++ SNode::firstChild怎么用?C++ SNode::firstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SNode
的用法示例。
在下文中一共展示了SNode::firstChild方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyVariable
void DerivationWriter :: copyVariable(SNode node)
{
SNode local = node.firstChild();
_writer.newNode(lxVariable);
if (_hints != lxNone) {
copyHints(_hints);
_hints = lxNone;
}
unpackNode(local, 0);
_writer.closeNode();
SNode current = node.findChild((LexicalType)nsAssigning);
if (current != lxNone) {
_writer.newNode(lxExpression);
_writer.appendNode(lxAssign);
unpackNode(local, 1);
unpackChildren(current);
_writer.closeNode();
}
}
示例2: if
void DerivationWriter :: copySwitching(SNode node)
{
SNode current = node.firstChild();
while (current != lxNone) {
Symbol symbol = (Symbol)current.type;
switch (symbol) {
case nsSwitchOption:
case nsBiggerSwitchOption:
case nsLessSwitchOption:
_writer.newBookmark();
unpackChildren(current);
if (symbol == nsBiggerSwitchOption) {
_writer.insert(lxOption, GREATER_MESSAGE_ID);
}
else if (symbol == nsLessSwitchOption) {
_writer.insert(lxOption, LESS_MESSAGE_ID);
}
else _writer.insert(lxOption, EQUAL_MESSAGE_ID);
_writer.closeNode();
_writer.removeBookmark();
break;
case nsLastSwitchOption:
_writer.newBookmark();
unpackChildren(current);
_writer.insert(lxElse);
_writer.closeNode();
_writer.removeBookmark();
break;
default:
break;
}
current = current.nextNode();
}
}
示例3: unpackChildren
void DerivationWriter :: unpackChildren(SNode node, int mode)
{
SNode current = node.firstChild();
while (current != lxNone) {
unpackNode(current, mode);
current = current.nextNode();
}
}
示例4: injectVariableAssigning
void CompilerLogic :: injectVariableAssigning(SNode node, _CompilerScope& scope, _Compiler& compiler, ref_t targetRef, ref_t& type, bool paramMode)
{
ClassInfo info;
defineClassInfo(scope, info, targetRef);
node.setArgument(defineStructSize(info, false));
//HOTFIX : allowing to assign a reference variable
if (!node.argument && paramMode) {
// replace the parameter with the field expression
compiler.injectFieldExpression(node.firstChild(lxObjectMask));
type = info.fieldTypes.get(0).value2;
}
}
示例5: copyObject
void DerivationWriter :: copyObject(SNode node, int mode)
{
int exprCounter = 0;
SNode current = node.firstChild();
while (current != lxNone) {
if (current == nsExpression)
exprCounter++;
unpackNode(current, mode);
current = current.nextNode();
}
if (mode == 1 && exprCounter > 1) {
_writer.insert(lxExpression);
_writer.closeNode();
}
}
示例6: copyMessage
void DerivationWriter :: copyMessage(SNode node, bool operationMode)
{
SNode current = node.firstChild();
while (current != lxNone) {
Symbol symbol = (Symbol)current.type;
switch (symbol) {
case nsSubjectArg:
_writer.newNode(lxMessage);
unpackChildren(current);
_writer.closeNode();
break;
case nsMessageParameter:
case nsObject:
case nsExpression:
_writer.newBookmark();
unpackChildren(current, 1);
_writer.removeBookmark();
break;
case nsElseOperation:
_writer.newNode(lxExpression);
unpackChildren(current);
_writer.closeNode();
break;
case nsSubCode:
unpackNode(current, 1);
break;
case nsL0Operation:
case nsL3Operation:
case nsL4Operation:
case nsL5Operation:
case nsL6Operation:
case nsL7Operation:
case nsNewOperator:
case nsMessageOperation:
copyMessage(current, (symbol != nsMessageOperation));
_writer.insert(lxExpression);
_writer.closeNode();
break;
case tsIdentifier:
case tsPrivate:
case tsReference:
if (!operationMode) {
_writer.newNode(lxMessage);
unpackNode(current, 0);
_writer.closeNode();
break;
}
default:
if (operationMode && current.existChild(lxTerminal)) {
if ((Symbol)node.type == nsNewOperator) {
//HOTFIX : mark new operator
_writer.appendNode(lxOperator, -1);
if (symbol == tsInteger || symbol == tsIdentifier) {
unpackNode(current, 0);
}
}
else {
_writer.newNode(lxOperator);
copyChildren(current);
_writer.closeNode();
}
_writer.newBookmark();
}
break;
}
current = current.nextNode();
}
if (operationMode) {
_writer.removeBookmark();
}
}