Ejemplo n.º 1
0
from schema import immutable, fileformat_flat
import os

mtime = os.path.getmtime("scratch.flat")
data = fileformat_flat.load_file("scratch.flat", immutable)
data.set_info({
    "filename":"scratch.flat",
    "mtime":mtime,
})

print data

print data[0].callee
print data[0].arguments

print data[0].arguments.proxy.unroll()
Ejemplo n.º 2
0
whiteish   = rgba(0xf6, 0xf3, 0xe8)

class default_theme(object):
    background   = rgba(0x24, 0x24, 0x24)
    symbol_color  = whiteish
    keyword_color = cyan
    string_color = lime
    number_color = red
    object_color = gray
    malform_color = red

theme = default_theme

filename = (sys.argv[1] if len(sys.argv) > 1 else 'scratch.flat')
if os.path.exists(filename):
    document = fileformat_flat.load_file(filename, mutable)
else:
    document = mutable.Document([])
document.filename = filename

argon = Argon(600, 800)

#from mode import Mode, SelectionMode

default = renderer.get_default_style(argon).inherit(
    color = whiteish,
)

language = __import__('strike')
EditMode = language.EditMode
layouter = language.init(argon, default, theme)
Ejemplo n.º 3
0
"""
import os
from llvm import *
from llvm.core import *
from llvm.ee import *

from schema import immutable, fileformat_flat
from schema.immutable import istype

int_t = Type.int()
main_t = Type.function(int_t, [])

filename = "strike_test.flat"

mtime = os.path.getmtime(filename)
source = fileformat_flat.load_file(filename, immutable)
source.set_info({
    "filename":filename,
    "mtime":mtime,
})

runtime_module = Module.from_assembly(file("strikert.s", 'r'))

main_module = Module.new("main")
main_module.link_in(runtime_module)


main_fn = main_module.add_function(main_t, "main")

main_fn_entry = main_fn.append_basic_block("entry")