Lines Matching refs:directive
932 self.throw( BadExpectedToken, "missing right-paren after 'defined' directive")
1532 - directive blocks: contain the tokens of a single pre-processor directive (e.g. #if)
1533 - text blocks, contain the tokens of non-directive blocks
1538 def __init__(self,tokens,directive=None,lineno=0):
1539 """initialize a new block, if 'directive' is None, this is a text block
1542 if directive == "ifdef":
1546 directive = "if"
1548 elif directive == "ifndef":
1554 directive = "if"
1557 self.directive = directive
1567 """returns True iff this is a directive block"""
1568 return self.directive != None
1571 """returns True iff this is a conditional directive block"""
1572 return self.directive in ["if","ifdef","ifndef","else","elif","endif"]
1575 """returns the macro name in a #define directive, or None otherwise"""
1576 if self.directive != "define":
1582 """returns True iff this is an #if-like directive block"""
1583 return self.directive in ["if","ifdef","ifndef","elif"]
1586 """checks wether this is a #include directive. if true, then returns the
1588 if self.directive != "include":
1615 if self.directive != None:
1670 # removeWhiteSpace() will sometimes creates non-directive blocks
1675 if not self.directive and self.tokens == []:
1678 if self.directive:
1699 if self.directive:
1700 result = "#%s " % self.directive
1715 if self.directive:
1716 if self.directive == "if":
1727 result = "#%s" % self.directive
1915 # a directive mixed inside it.
2006 # this is the start of a directive
2031 directive = tok.value
2045 block = Block(dirtokens,directive,lineno)
2118 dir = blocks[i].directive
2157 dir = blocks[j].directive
2164 blocks[j].directive = "if"
2170 blocks[j].directive = "if"
2182 dir = blocks[k].directive
2191 blocks[k].directive = "if"