public void _AR_(ParseNode_Id id, ParseNode_Base rhs, SemanticFlags kSF = 0, bool bContextualKeyword = false, bool bAuto = false) { m_kParseRoot.AddRule(new ParseNode_Rule(id.Name, rhs) { semantics = kSF, contextualKeyword = bContextualKeyword, autoExclude = bAuto }); }
/// <summary> /// Utility function used to determine if the passed in MLWorldPlane object's /// flags contain the passed in SemanticFlags. /// </summary> /// <param name="plane">The MLWorldPlane object to be checked</param> /// <param name="flag">The SemanticFlags to be checked</param> public static bool DoesPlaneHaveFlag(MLWorldPlane plane, SemanticFlags flag) { return (plane.Flags & (uint)flag) == (uint)flag; }
public static ParseTree.Node EnclosingScopeNode(ParseTree.Node node, SemanticFlags scopeType1, SemanticFlags scopeType2, SemanticFlags scopeType3) { while (node != null) { var scopeSemantics = node.semantics & SemanticFlags.ScopesMask; if (scopeSemantics != SemanticFlags.None) if (scopeType1 == scopeSemantics || scopeType2 == scopeSemantics || scopeType3 == scopeSemantics) return node; node = node.parent; } return null; }
public static ParseTree.Node EnclosingSemanticNode(ParseTree.Node node, SemanticFlags flags) { while (node != null) { var scopeSemantics = node.semantics & flags; if (scopeSemantics != SemanticFlags.None) return node; node = node.parent; } return null; }
public static ParseTree.Node EnclosingSemanticNode(ParseTree.BaseNode node, SemanticFlags flags) { if (node is ParseTree.Leaf) return EnclosingSemanticNode(node.parent, flags); return EnclosingSemanticNode((ParseTree.Node) node, flags); }