當前位置: 首頁>>代碼示例>>Python>>正文


Python parse_node.ParseNode類代碼示例

本文整理匯總了Python中sheet.parser.parse_node.ParseNode的典型用法代碼示例。如果您正苦於以下問題:Python ParseNode類的具體用法?Python ParseNode怎麽用?Python ParseNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ParseNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testRegisteredWithParse

 def testRegisteredWithParse(self):
     "test registered with ParseNode"
     self.assertEquals(
         type(ParseNode.construct_node(
             ParseNode.FL_CELL_RANGE, ['a1', ':', 'b4'])),
         FLCellRangeParseNode,
         "Class is not registered with ParseNode")
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:7,代碼來源:test_fl_cell_range_parse_node.py

示例2: testParseNodeShould

    def testParseNodeShould(self):
        "test ParseNode should allow registering of node classes"
        class CustomParseNode(ParseNode):
            def __init__(self, children):
                ParseNode.__init__(self, "CUSTOM_NODE_TYPE", children)

        ParseNode.register_node_type("CUSTOM_NODE_TYPE", CustomParseNode)
        try:

            node = ParseNode.construct_node("CUSTOM_NODE_TYPE", [])
            self.assertEquals(type(node), CustomParseNode, "ParseNode.construct_node didn't dispatch to CustomParseNode")
            self.assertEquals(node.type, "CUSTOM_NODE_TYPE", "Wrong type attribute")
            self.assertEquals(node.children, [], "Wrong children")


            node = ParseNode.construct_node("FISH BOWL", ["gox blamp"])
            self.assertEquals(type(node), ParseNode, "ParseNode.construct_node didn't fall back to ParseNode")
            self.assertEquals(node.type, "FISH BOWL", "Wrong type attribute")
            self.assertEquals(node.children, ["gox blamp"], "Wrong children")


            self.assertIsNotNone(ParseNode.classRegistry, "ParseNode didn't have a class registry")
        finally:
            del ParseNode.classRegistry["CUSTOM_NODE_TYPE"]
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:24,代碼來源:test_parse_node.py

示例3: ListMaker

def ListMaker(children):
    return ParseNode.construct_node(ParseNode.LIST_MAKER, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例4: ListIf

def ListIf(children):
    return ParseNode.construct_node(ParseNode.LIST_IF, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例5: LambDef

def LambDef(children):
    return ParseNode.construct_node(ParseNode.LAMBDEF, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例6: GenIf

def GenIf(children):
    return ParseNode.construct_node(ParseNode.GEN_IF, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例7: FPList

def FPList(children):
    return ParseNode.construct_node(ParseNode.FP_LIST, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例8: Factor

def Factor(children):
    return ParseNode.construct_node(ParseNode.FACTOR, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例9: FLDeletedReference

def FLDeletedReference(children):
    return ParseNode.construct_node(ParseNode.FL_DELETED_REFERENCE, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例10: FLDDECall

def FLDDECall(children):
    return ParseNode.construct_node(ParseNode.FL_DDE_CALL, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例11: Atom

def Atom(children):
    return ParseNode.construct_node(ParseNode.ATOM, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例12: ArithExpr

def ArithExpr(children):
    return ParseNode.construct_node(ParseNode.ARITH_EXPR, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例13: Argument

def Argument(children):
    return ParseNode.construct_node(ParseNode.ARGUMENT, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例14: ArgList

def ArgList(children):
    return ParseNode.construct_node(ParseNode.ARG_LIST, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例15: AndTest

def AndTest(children):
    return ParseNode.construct_node(ParseNode.AND_TEST, children)
開發者ID:AlexanderAA,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py


注:本文中的sheet.parser.parse_node.ParseNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。