本文整理汇总了C#中Galaxy_Editor_2.Compiler.Generated.node.Node.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# Node.Apply方法的具体用法?C# Node.Apply怎么用?C# Node.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Galaxy_Editor_2.Compiler.Generated.node.Node
的用法示例。
在下文中一共展示了Node.Apply方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefaultIn
public override void DefaultIn(Node node)
{
if (node is PExp)
{
PExp exp = (PExp) node;
if (finalTrans.data.ExpTypes[exp] is ANamedType)
{
ANamedType type = (ANamedType) finalTrans.data.ExpTypes[exp];
if (finalTrans.data.StructTypeLinks.ContainsKey(type))
{
AStructDecl strDecl = finalTrans.data.StructTypeLinks[type];
if (strDecl.GetLocals().Cast<PLocalDecl>().Select(decl => decl is AALocalDecl).Count() == 0)
{
if (node.Parent() is AAssignmentExp)
node = node.Parent().Parent();
MoveMethodDeclsOut mover = new MoveMethodDeclsOut("removedStructVar", finalTrans.data);
node.Apply(mover);
foreach (PStm pStm in mover.NewStatements)
{
pStm.Apply(this);
}
node.Parent().RemoveChild(node);
if (node.Parent() is ABinopExp)
{
ABinopExp parent = (ABinopExp) node.Parent();
ABooleanConstExp replacer;
if (parent.GetBinop() is ANeBinop || parent.GetBinop() is AGtBinop || parent.GetBinop() is ALtBinop)
replacer = new ABooleanConstExp(new AFalseBool());
else
replacer = new ABooleanConstExp(new ATrueBool());
finalTrans.data.ExpTypes[replacer] = new ANamedType(new TIdentifier("bool"), null);
parent.ReplaceBy(replacer);
}
}
}
}
}
}
示例2: Parser
public Parser(Node start)
{
start.Apply(this);
}
示例3: Parse
public static void Parse(Node ast)
{
ast.Apply(new SimpleTransformations());
}
示例4: Parser
public Parser(Node structDecl)
{
structDecl.Apply(this);
}
示例5: Parse
public static List<AALocalDecl> Parse(Node node, SharedData data)
{
GetUsedLocals getter = new GetUsedLocals(data);
node.Apply(getter);
return getter.UsedLocals;
}
示例6: Parser
public Parser(Node ast)
{
ast.Apply(this);
}
示例7: IsWhileNeeded
public static bool IsWhileNeeded(Node root)
{
CheckIfWhilesIsNeeded check = new CheckIfWhilesIsNeeded();
root.Apply(check);
return check.NeedWhileLoop;
}