def __init__(self, ast, real = True): GenericASTTraversal.__init__(self, ast) self.output = [] self.automator = Automator(real) self.postorder() self.automator.flush()
def __init__(self, version, scanner, showast=False, debug_parser=PARSER_DEFAULT_DEBUG): GenericASTTraversal.__init__(self, ast=None) self.scanner = scanner params = { 'f': StringIO(), 'indent': '', } self.version = version self.p = get_python_parser(version, dict(debug_parser)) self.showast = showast self.__params = params self.__param_stack = [] self.ERROR = None self.prec = 100 self.return_none = False self.mod_globs = set() self.currentclass = None self.classes = [] self.pending_newlines = 0 self.hide_internal = False self.offsets = {} self.last_finish = -1 # Customize with our more-pervisive rules TABLE_DIRECT.update(TABLE_DIRECT_FRAGMENT)
def __init__(self, ast, indent=0, isLambda=0): GenericASTTraversal.__init__(self, ast) self._globals = {} self.f = cStringIO.StringIO() self.f.seek(0) self.indent = indent self.isLambda = isLambda
def __init__(self, ast): self.mnargsDict = x86args self.longcalls = {} done = 0 GenericASTTraversal.__init__(self, ast) while not done: try: # print "Trying traversal" self.currentMN = "" self.currentAL = [] self.currentVL = [] self.tempaddr = None self.value = "" self.calls = 0 self.labels = {} self.redoDict = {} self.inredo = 0 self.redocallnum = 0 self.postorder() done = 1 except needLongCall: # print "New long call at %d"%self.calls if self.inredo: self.longcalls[self.redocallnum] = 1 else: self.longcalls[self.calls] = 1
def __init__(self,ast,remoteresolver=None,variableresolver=None): self.labels={} self.redoList={} self.value="" self.currentMN="" self.currentAL=[] self.currentVL=[] self.vartree=vartree() self.remoteresolver=None self.newlabel=0 self.variableresolver=None self.vartypes={} self.initvartypes() self.stackaddr=0 self.argumentlist=None #used for statements before we have a function self.value2="" self.setRemoteResolver(remoteresolver) self.setVariableResolver(variableresolver) GenericASTTraversal.__init__(self, ast) self.value+="GETPC\n" #we always call main, which takes no args self.value+="call main\n" self.value+="ret 0\n" self.postorder() return
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) msword = DispatchEx('Word.Application') msword.Visible = 1 # 1表示要顯示畫面,若為0則不顯示畫面。 self.word = msword self.doc = msword.Documents.Add() # 開啟一個新的文件。 self.range = self.doc.Range() # 設定字型為標楷體 self.range.Font.Name = u"標楷體".encode('cp950') self.preorder() ti = 1 # title line number # Format Title if ast.title: para = self.doc.Paragraphs.First para.Format.Alignment = 1 # center para.Range.Select() msword.Selection.Font.Size = 18 msword.Selection.Font.Bold = 1 if ast.title.count('\n') == 1: para = self.doc.Paragraphs(2) para.Format.Alignment = 1 # center para.Range.Select() msword.Selection.Font.Size = 18 msword.Selection.Font.Bold = 1 ti = 2 try: history = ast.attrs[u'訂定'] + u'函訂定' para = self.doc.Paragraphs(ti + 1) para.Format.Alignment = 2 # center para.Range.Select() msword.Selection.Font.Size = 10 except KeyError, k: pass
def __init__(self, ast): self.mnargsDict = x86args self.longcalls = {} done = 0 GenericASTTraversal.__init__(self, ast) while not done: try: #print "Trying traversal" self.currentMN = "" self.currentAL = [] self.currentVL = [] self.tempaddr = None self.value = "" self.calls = 0 self.labels = {} self.redoDict = {} self.inredo = 0 self.redocallnum = 0 self.postorder() done = 1 except needLongCall: #print "New long call at %d"%self.calls if self.inredo: self.longcalls[self.redocallnum] = 1 else: self.longcalls[self.calls] = 1
def __init__(self, ast, real=True): GenericASTTraversal.__init__(self, ast) self.output = [] self.automator = Automator(real) self.postorder_flat() self.automator.flush() global counter counter = 0
def __init__(self, gallery): self.gallery = gallery self.album = None self.references = {} self.store = {} GenericASTTraversal.__init__(self, None)
def __init__(self, out, scanner, showast=0): GenericASTTraversal.__init__(self, ast=None) self.scanner = scanner params = { 'f': out, 'indent': '', } self.showast = showast self.__params = params self.__param_stack = []
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) msword = DispatchEx('Word.Application') msword.Visible = 1 # 1表示要顯示畫面,若為0則不顯示畫面。 self.word = msword self.doc = msword.Documents.Add() # 開啟一個新的文件。 pageSetup = self.doc.PageSetup pageSetup.TopMargin = 64 pageSetup.BottomMargin = 64 #With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary) # .PageNumbers.Add PageNumberAlignment:=wdAlignPageNumberRight #End With section = self.doc.Sections(1) self.range = self.doc.Range() # 設定字型為標楷體 self.range.Font.Name = u"標楷體".encode('cp950') self.range.Font.Size = 14 self.range.ParagraphFormat.LineSpacingRule = 4 self.range.ParagraphFormat.LineSpacing = 22 #import pdb; pdb.set_trace() #self.range.paragraphs.LineSpacingRule = 4 #constants.WdLineSpaceExactly #self.range.LineSpacing = 22 self.preorder() ti = 1 # title line number # Format Title if ast.title: para = self.doc.Paragraphs.First para.Format.Alignment = 1 # center para.Range.Font.Size = 18 para.Range.Font.Bold = 1 if ast.title.count('\n') == 1: para = self.doc.Paragraphs(2) para.Format.Alignment = 1 # center para.Range.Select() msword.Selection.Font.Size = 18 msword.Selection.Font.Bold = 1 ti = 2 try: history = ast.attrs[u'訂定'] + u'函訂定' para = self.doc.Paragraphs(ti + 1) para.Format.Alignment = 2 # center para.Range.Select() msword.Selection.Font.Size = 10 except KeyError, k: pass
def __init__(self, out, scanner, showast=0): GenericASTTraversal.__init__(self, ast=None) self.scanner = scanner params = {"f": out, "indent": ""} self.showast = showast self.__params = params self.__param_stack = [] self.ERROR = None self.prec = 100 self.return_none = False self.mod_globs = set() self.currentclass = None self.pending_newlines = 0
def __init__(self, out, scanner, showast=0): GenericASTTraversal.__init__(self, ast=None) self.scanner = scanner params = { 'f': out, 'indent': '', } self.showast = showast self.__params = params self.__param_stack = [] self.ERROR = None self.prec = 100 self.return_none = False self.mod_globs = set()
def __init__(self, ast, real=True): GenericASTTraversal.__init__(self, ast) self.output = [] if 'Linux' in platform.system(): self.automator = XDoAutomator(real) elif 'Darwin' in platform.system(): self.automator = CLIClickAutomator(real) elif 'Windows' in platform.system(): self.automator = NirCmdAutomator(real) else: print "No suitable automator for platform", platform.system() self.postorder_flat() self.automator.flush()
def __init__(self, out, scanner, showast=0): GenericASTTraversal.__init__(self, ast=None) self.scanner = scanner params = { 'f': out, 'indent': '', } self.showast = showast self.__params = params self.__param_stack = [] self.ERROR = None self.prec = 100 self.return_none = False self.mod_globs = set() self.currentclass = None
def __init__(self, ast): """ We deepcopy the original x86opcodes.x86args dictionary here because we need our very own instructions since we modify internal variables inside them """ self.mnargsDict = deepcopy(x86args) self.longcalls = {} done = 0 GenericASTTraversal.__init__(self, ast) while not done: try: #print "Trying traversal" self.metadata = [ ] #our list of metadata which can be used by advanced assemblers self.currentMN = "" self.currentAL = [] self.currentVL = [] self.tempaddr = None self.value = "" self.calls = 0 self.labels = {} self.redoDict = {} self.inredo = 0 self.redocallnum = 0 self.postorder() done = 1 except needLongCall: #print "New long call at %d"%self.calls if self.inredo: self.longcalls[self.redocallnum] = 1 else: self.longcalls[self.calls] = 1 unresolved = 0 for k in self.redoDict: print "Note: unresolved symbol: %s" % k unresolved = 1 if unresolved: import traceback traceback.print_stack()
def __init__(self, ast, context): GenericASTTraversal.__init__(self, ast) self.context = context self.contextLevel = ExprLevel.index(context) self.postorder()
def preorder(self, *args): GenericASTTraversal.preorder(self, *args)
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.errors = {}
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.postorder() print ast.value
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.postorder()
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.postorder() self.argList = ast.argList
def __init__(self,ast): GenericASTTraversal.__init__(self,ast)
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.macros = {}
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.preorder()
def __init__(self, ast): GenericASTTraversal.__init__(self, ast)
def __init__(self, ast): GenericASTTraversal.__init__(self, ast) self.symbolTable = {} self.preorder()