本文整理汇总了C#中ProtoCore.PushUpdateNode方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.PushUpdateNode方法的具体用法?C# ProtoCore.PushUpdateNode怎么用?C# ProtoCore.PushUpdateNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCore
的用法示例。
在下文中一共展示了ProtoCore.PushUpdateNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DFSGetSymbolList_Simple
// Deperecate this function after further regression testing and just use DFSGetSymbolList
public void DFSGetSymbolList_Simple(Node pNode, ref ProtoCore.Type lefttype, ref int functionindex, ProtoCore.AssociativeGraph.UpdateNodeRef nodeRef)
{
dynamic node = pNode;
if (node is ProtoCore.AST.ImperativeAST.IdentifierListNode || node is ProtoCore.AST.AssociativeAST.IdentifierListNode)
{
dynamic bnode = node;
DFSGetSymbolList_Simple(bnode.LeftNode, ref lefttype, ref functionindex, nodeRef);
node = bnode.RightNode;
}
if (node is ProtoCore.AST.ImperativeAST.IdentifierNode || node is ProtoCore.AST.AssociativeAST.IdentifierNode)
{
dynamic identnode = node;
ProtoCore.DSASM.SymbolNode symbolnode = null;
bool isAccessible = false;
bool isAllocated = VerifyAllocation(identnode.Value, lefttype.UID, functionindex, out symbolnode, out isAccessible);
if (isAllocated)
{
if (null == symbolnode)
{
// It is inaccessible from here due to access modifier.
// Just attempt to retrieve the symbol
int symindex = core.ClassTable.ClassNodes[lefttype.UID].GetFirstVisibleSymbolNoAccessCheck(identnode.Value);
if (ProtoCore.DSASM.Constants.kInvalidIndex != symindex)
{
symbolnode = core.ClassTable.ClassNodes[lefttype.UID].Symbols.symbolList[symindex];
}
}
// Since the variable was found, all succeeding nodes in the ident list are class members
// Class members have a function scope of kGlobalScope as they are only local to the class, not with any member function
functionindex = ProtoCore.DSASM.Constants.kGlobalScope;
lefttype = symbolnode.datatype;
ProtoCore.AssociativeGraph.UpdateNode updateNode = new AssociativeGraph.UpdateNode();
updateNode.symbol = symbolnode;
updateNode.nodeType = ProtoCore.AssociativeGraph.UpdateNodeType.kSymbol;
nodeRef.PushUpdateNode(updateNode);
}
else
{
// Is it a class?
int ci = core.ClassTable.IndexOf(identnode.Value);
if (ProtoCore.DSASM.Constants.kInvalidIndex != ci)
{
lefttype.UID = ci;
// Comment Jun:
// Create a symbol node that contains information about the class type that contains static properties
ProtoCore.DSASM.SymbolNode classSymbol = new DSASM.SymbolNode();
classSymbol.memregion = DSASM.MemoryRegion.kMemStatic;
classSymbol.name = identnode.Value;
classSymbol.classScope = ci;
ProtoCore.AssociativeGraph.UpdateNode updateNode = new AssociativeGraph.UpdateNode();
updateNode.symbol = classSymbol;
updateNode.nodeType = ProtoCore.AssociativeGraph.UpdateNodeType.kSymbol;
nodeRef.PushUpdateNode(updateNode);
}
else
{
// In this case, the lhs type is undefined
// Just attempt to create a symbol node
string ident = identnode.Value;
if (0 != ident.CompareTo(ProtoCore.DSDefinitions.Keyword.This))
{
symbolnode = new SymbolNode();
symbolnode.name = identnode.Value;
ProtoCore.AssociativeGraph.UpdateNode updateNode = new AssociativeGraph.UpdateNode();
updateNode.symbol = symbolnode;
updateNode.nodeType = AssociativeGraph.UpdateNodeType.kSymbol;
nodeRef.PushUpdateNode(updateNode);
}
}
}
}
else if (node is ProtoCore.AST.ImperativeAST.FunctionCallNode || node is ProtoCore.AST.AssociativeAST.FunctionCallNode)
{
string functionName = node.Function.Value;
if (ProtoCore.Utils.CoreUtils.IsGetterSetter(functionName))
{
string property;
if (CoreUtils.TryGetPropertyName(functionName, out property))
{
functionName = property;
}
ProtoCore.DSASM.SymbolNode symbolnode = null;
bool isAccessible = false;
bool isAllocated = VerifyAllocation(functionName, lefttype.UID, globalProcIndex, out symbolnode, out isAccessible);
if (isAllocated)
{
if (null == symbolnode)
//.........这里部分代码省略.........